1
我正在使用Django來處理相當長的http post請求,我想知道當我在同一時間收到很多請求時,我的設置是否有一些限制。Django + lighttpd + fcgi性能
lighttpd.conf FCGI:
fastcgi.server = ( "a.fcgi" => ( "main" => ( # Use host/port instead of socket for TCP fastcgi "host" => "127.0.0.1", "port" => 3033, "check-local" => "disable", "allow-x-send-file" => "enable" )) )
的Django的init.d腳本開始部:
start-stop-daemon --start --quiet \ --pidfile /var/www/tmp/a.pid \ --chuid www-data --exec /usr/bin/env -- python \ /var/www/a/manage.py runfcgi \ host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
開始的Django使用上述在一個多線程的Django服務器結果腳本:
www-data 342 7873 0 04:58 ? 00:01:04 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid www-data 343 7873 0 04:58 ? 00:01:15 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid www-data 378 7873 0 Feb14 ? 00:04:45 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid www-data 382 7873 0 Feb12 ? 00:14:53 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid www-data 386 7873 0 Feb12 ? 00:12:49 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid www-data 7873 1 0 Feb12 ? 00:00:24 python /var/www/a/manage.py runfcgi host=127.0.0.1 port=3033 pidfile=/var/www/tmp/a.pid
在lighttpd error.log中,我確實看到load = 10,這表明我同時收到很多請求,這個happ一天幾次:
2010-02-16 05:17:17: (mod_fastcgi.c.2979) got proc: pid: 0 socket: tcp:127.0.0.1:3033 load: 10
我的設置是否正確,以同時處理很多長的http發佈請求(可以持續幾分鐘)?