2016-11-22 1 views
2

im runing Python/Django auf Apache mit modwsgiZu viele Python-Initialisierung auf httpd starten

Ich habe meine Apache error_log Trog suchen und ich habe etwas Seltsames bemerkt

ich habe nur 2 virtuellen Host mit wsgi Daemon
aber wenn ich httpd-Dienst starten erhalte ich viele python-Initialisierung (ich habe 17 gezählt)

hier ist das andere ist einfach so

WSGIDaemonProcess myproject python-path=/home/xyz/public_html/myproject:/usr/local/lib/python3.4/site-packages/ 
WSGIProcessGroup myproject 
WSGIScriptAlias//home/xyz/public_html/myproject/myproject/wsgi.py 
    <Directory /home/xyz/public_html/myproject/myproject> 
    <Files wsgi.py> 
     Order deny,allow 
     Require all granted 
     WSGIProcessGroup myproject 
    </Files> 
    </Directory> 
Alias /static/ /home/xyz/public_html/myproject/static/ 
<Directory /home/xyz/public_html/myproject/static> 
Require all granted 
</Directory> 

hier ist, was ich, wenn ich httpd starten

[Tue Nov 22 06:23:46.979171 2016] [unique_id:info] [pid 14914] AH01566: using ip addr 136.243.122.67 
[Tue Nov 22 06:23:47.000460 2016] [ssl:info] [pid 14914] AH01887: Init: Initializing (virtual) servers for SSL 
[Tue Nov 22 06:23:47.000491 2016] [ssl:info] [pid 14914] AH01914: Configuring server static.67.122.243.136.clients.your-server.de:443 for SSL protocol 
[Tue Nov 22 06:23:47.002249 2016] [ssl:info] [pid 14914] AH02568: Certificate and private key static.67.122.243.136.clients.your-server.de:443:0 configured from /var/cpanel/ssl/cpanel/mycpanel.pem and /var/cpanel/ssl/cpanel/mycpanel.pem 
[Tue Nov 22 06:23:47.002850 2016] [ssl:info] [pid 14914] AH01876: mod_ssl/2.4.18 compiled against Server: Apache/2.4.18, Library: OpenSSL/1.0.1e 
[Tue Nov 22 06:23:47.002916 2016] [suexec:notice] [pid 14914] AH: suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec) 
[Tue Nov 22 06:23:47.003027 2016] [:notice] [pid 14914] ModSecurity for Apache/2.9.0 (http://www.modsecurity.org/) configured. 
[Tue Nov 22 06:23:47.003036 2016] [:notice] [pid 14914] ModSecurity: APR compiled version="1.5.2"; loaded version="1.5.2" 
[Tue Nov 22 06:23:47.003042 2016] [:notice] [pid 14914] ModSecurity: PCRE compiled version="8.38 "; loaded version="8.38 2015-11-23" 
[Tue Nov 22 06:23:47.003048 2016] [:notice] [pid 14914] ModSecurity: LUA compiled version="Lua 5.1" 
[Tue Nov 22 06:23:47.003052 2016] [:notice] [pid 14914] ModSecurity: LIBXML compiled version="2.9.2" 
[Tue Nov 22 06:23:47.003056 2016] [:notice] [pid 14914] ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On. 
[Tue Nov 22 06:23:47.065136 2016] [unique_id:info] [pid 14915] AH01566: using ip addr 136.243.122.67 
[Tue Nov 22 06:23:48.001185 2016] [socache_shmcb:info] [pid 14915] AH00830: Shared memory socache initialised 
[Tue Nov 22 06:23:48.001313 2016] [socache_shmcb:info] [pid 14915] AH00830: Shared memory socache initialised 
[Tue Nov 22 06:23:48.001319 2016] [ssl:info] [pid 14915] AH01887: Init: Initializing (virtual) servers for SSL 
[Tue Nov 22 06:23:48.001324 2016] [ssl:info] [pid 14915] AH01914: Configuring server static.67.122.243.136.clients.your-server.de:443 for SSL protocol 
[Tue Nov 22 06:23:48.002274 2016] [ssl:info] [pid 14915] AH02568: Certificate and private key static.67.122.243.136.clients.your-server.de:443:0 configured from /var/cpanel/ssl/cpanel/mycpanel.pem and /var/cpanel/ssl/cpanel/mycpanel.pem 
[Tue Nov 22 06:23:48.002581 2016] [ssl:info] [pid 14915] AH01876: mod_ssl/2.4.18 compiled against Server: Apache/2.4.18, Library: OpenSSL/1.0.1e 
[Tue Nov 22 06:23:48.005064 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Starting process 'myproject' with uid=99, gid=99 and threads=15. 
[Tue Nov 22 06:23:48.005389 2016] [wsgi:info] [pid 14918] mod_wsgi (pid=14918): Starting process 'adminmyproject' with uid=99, gid=99 and threads=15. 
[Tue Nov 22 06:23:48.006008 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Initializing Python. 
[Tue Nov 22 06:23:48.006745 2016] [wsgi:info] [pid 14919] mod_wsgi (pid=14919): Initializing Python. 
[Tue Nov 22 06:23:48.006939 2016] [mpm_prefork:notice] [pid 14915] AH00163: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_wsgi/4.5.2 Python/3.4.4 configured -- resuming normal operations 
[Tue Nov 22 06:23:48.006950 2016] [mpm_prefork:info] [pid 14915] AH00164: Server built: Jun 13 2016 22:00:03 
[Tue Nov 22 06:23:48.006972 2016] [core:notice] [pid 14915] AH00094: Command line: '/usr/local/apache/bin/httpd' 
[Tue Nov 22 06:23:48.007462 2016] [wsgi:info] [pid 14920] mod_wsgi (pid=14920): Initializing Python. 
[Tue Nov 22 06:23:48.014889 2016] [wsgi:info] [pid 14918] mod_wsgi (pid=14918): Initializing Python. 
[Tue Nov 22 06:23:48.017097 2016] [wsgi:info] [pid 14922] mod_wsgi (pid=14922): Initializing Python. 
[Tue Nov 22 06:23:48.017441 2016] [wsgi:info] [pid 14921] mod_wsgi (pid=14921): Initializing Python. 
[Tue Nov 22 06:23:48.034254 2016] [wsgi:info] [pid 14920] mod_wsgi (pid=14920): Attach interpreter ''. 
[Tue Nov 22 06:23:48.037473 2016] [wsgi:info] [pid 14923] mod_wsgi (pid=14923): Initializing Python. 
[Tue Nov 22 06:23:48.046362 2016] [wsgi:info] [pid 14922] mod_wsgi (pid=14922): Attach interpreter ''. 
[Tue Nov 22 06:23:48.056491 2016] [wsgi:info] [pid 14921] mod_wsgi (pid=14921): Attach interpreter ''. 
[Tue Nov 22 06:23:48.068671 2016] [wsgi:info] [pid 14923] mod_wsgi (pid=14923): Attach interpreter ''. 
[Tue Nov 22 06:23:48.075155 2016] [wsgi:info] [pid 14918] mod_wsgi (pid=14918): Attach interpreter ''. 
[Tue Nov 22 06:23:48.076183 2016] [wsgi:info] [pid 14918] mod_wsgi (pid=14918): Adding '/home/tttsdgf4/public_html/paypal_admin' to path. 
[Tue Nov 22 06:23:48.076443 2016] [wsgi:info] [pid 14918] mod_wsgi (pid=14918): Adding '/usr/local/lib/python3.4/site-packages/' to path. 
[Tue Nov 22 06:23:48.078562 2016] [wsgi:info] [pid 14919] mod_wsgi (pid=14919): Attach interpreter ''. 
[Tue Nov 22 06:23:48.082261 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Attach interpreter ''. 
[Tue Nov 22 06:23:48.083561 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Adding '/home/xyz/public_html/myproject' to path. 
[Tue Nov 22 06:23:48.083908 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Adding '/usr/local/lib/python3.4/site-packages/' to path. 
(XID uurvwj) Database Connect Error: Access denied for user 'leechprotect'@'localhost' (using password: YES) 
[Tue Nov 22 06:23:52.732171 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Create interpreter 'myproject.com|'. 
[Tue Nov 22 06:23:52.762576 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Adding '/home/xyz/public_html/myproject' to path. 
[Tue Nov 22 06:23:52.763093 2016] [wsgi:info] [pid 14917] mod_wsgi (pid=14917): Adding '/usr/local/lib/python3.4/site-packages/' to path. 
[Tue Nov 22 06:23:52.764574 2016] [wsgi:info] [pid 14917] [remote 178.253.28.32:0] mod_wsgi (pid=14917, process='myproject', application='myproject.com|'): Loading WSGI script '/home/xyz/public_html/myproject/myproject/wsgi.py'. 
[Tue Nov 22 06:23:53.014092 2016] [wsgi:info] [pid 14959] mod_wsgi (pid=14959): Initializing Python. 
[Tue Nov 22 06:23:53.052726 2016] [wsgi:info] [pid 14959] mod_wsgi (pid=14959): Attach interpreter ''. 
[Tue Nov 22 06:23:55.016852 2016] [wsgi:info] [pid 14961] mod_wsgi (pid=14961): Initializing Python. 
[Tue Nov 22 06:23:55.035254 2016] [wsgi:info] [pid 14961] mod_wsgi (pid=14961): Attach interpreter ''. 
[Tue Nov 22 06:23:56.020259 2016] [wsgi:info] [pid 14962] mod_wsgi (pid=14962): Initializing Python. 
[Tue Nov 22 06:23:56.020497 2016] [wsgi:info] [pid 14963] mod_wsgi (pid=14963): Initializing Python. 
[Tue Nov 22 06:23:56.056777 2016] [wsgi:info] [pid 14963] mod_wsgi (pid=14963): Attach interpreter ''. 
[Tue Nov 22 06:23:56.057672 2016] [wsgi:info] [pid 14962] mod_wsgi (pid=14962): Attach interpreter ''. 
[Tue Nov 22 06:23:57.023399 2016] [wsgi:info] [pid 14966] mod_wsgi (pid=14966): Initializing Python. 
[Tue Nov 22 06:23:57.024092 2016] [wsgi:info] [pid 14967] mod_wsgi (pid=14967): Initializing Python. 
[Tue Nov 22 06:23:57.024797 2016] [wsgi:info] [pid 14968] mod_wsgi (pid=14968): Initializing Python. 
[Tue Nov 22 06:23:57.025605 2016] [wsgi:info] [pid 14969] mod_wsgi (pid=14969): Initializing Python. 
[Tue Nov 22 06:23:57.057302 2016] [wsgi:info] [pid 14966] mod_wsgi (pid=14966): Attach interpreter ''. 
[Tue Nov 22 06:23:57.059648 2016] [wsgi:info] [pid 14969] mod_wsgi (pid=14969): Attach interpreter ''. 
[Tue Nov 22 06:23:57.061447 2016] [wsgi:info] [pid 14967] mod_wsgi (pid=14967): Attach interpreter ''. 
[Tue Nov 22 06:23:57.079172 2016] [wsgi:info] [pid 14968] mod_wsgi (pid=14968): Attach interpreter ''. 

ist das normal oder es ist etwas falsch?

Antwort

1

das scheint wie eine Menge Prozesse zu starten. Sie könnten versuchen, einige zusätzliche Parameter zu Ihrem WSGIDaemonProcess hinzuzufügen, um explizit die Anzahl der Prozesse und Threads festzulegen, die es spawnen soll. in Ihrem Fall versuchen, so etwas wie diese (Anmerkung Richtlinien über ganz rechts):

WSGIDaemonProcess myproject python-path=/home/xyz/public_html/myproject:/usr/local/lib/python3.4/site-packages/ processes=2 threads=5 

hier weitere Informationen über diese Richtlinien hier: http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html

+0

Ihr Beispiel erstellt mehr Prozess als er jetzt hat. Der Standardwert ist 1 Prozess mit 25 Threads. Sie machen es 2 Prozesse. :-) –

+0

true, aber ich habe ihm auch (hoffentlich) beigebracht, wie man genau abstimmt, wie viele Prozesse gestartet werden und wie viele Threads pro Prozess erzeugt werden. :) –

+0

Gültiger Punkt. Zu wenige Leute versuchen tatsächlich, die Einstellungen überhaupt abzustimmen. –