我的服务器在过去几周变得越来越忙,我试图跟上需求,但在努力跟上需求时做错了事。我有两个域:www.example.com和api.example.com及以下httpd.conf文件:如何使用虚拟主机扩展我的apache服务器?
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
ThreadsPerChild 15
WSGIDaemonProcess api python-path=/path/to/python2.7 processes=8 threads=15
<VirtualHost *:18546>
ServerName api.example.com
ServerAlias api.example.com
KeepAlive Off
WSGIDaemonProcess api.example.com processes=1 threads=20 inactivity-timeout=100 display-name=[api]httpd
WSGIProcessGroup api.example.com
WSGIScriptAlias//path/to/wsgi.py
ErrorLog /path/to/error.log
</VirtualHost>
<VirtualHost *:18546>
ServerName www.example.com
ServerAlias www.example.com
KeepAlive Off
WSGIDaemonProcess www.example.com processes=1 threads=20 inactivity-timeout=10 display-name=[www]httpd
WSGIProcessGroup www.example.com
WSGIScriptAlias//path/to/wsgi2.py
ErrorLog /path/to/error2.log
</VirtualHost>
当我看着我的processlist在Linux中我看到下面的过程:
[www]httpd
[api]httpd
/path/to/api/
/path/to/api/
/path/to/api/
/path/to/api/
/path/to/api/
/path/to/api/
/path/to/api/
/path/to/api/
该api子域似乎是产卵的儿童,但www子域不。我究竟做错了什么?
编辑:使用Apache 2.2.25
我不确定,但是我看到在配置的顶部有'WSGIDaemonProcess api ... processes = 8',而其他的'WSGIDaemonProcess'指令具有'processes = 1'。这可能就是为什么有8个API进程和1个其他进程(即,因为这是你问Apache要做的)。 – larsks
是的,www有1个进程,api有1个进程。但为什么有8个线程的API和没有WWW的? –