django部署在apache上的一些疑问
写了个程序,在django上自带的服务器上开发完成,目前想部署到apache上去
已经做了:
httpd.conf
[Copy to clipboard] [ - ]
CODE:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
###### django
<Location "/">
SetHandler python-program
PythonPath "['/var/www']+sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE index.settings
PythonInterpreter mysite
PythonDebug On
</Location>
Alias /images /var/www/index/media
<Location "/images">
SetHandler None
</Location>
在apache上也已经正常工作.
我的问题是:
1: 是不是现在django和mod_python已经开始工作了, 还需不需要修改已经写好的python程序.
2: 我感觉mod_python好象没工作,我用ab测试了下:
ab -n 100 -c 100 http://192.168.1.254/web
结果
[Copy to clipboard] [ - ]
CODE:
....
Concurrency Level: 100
Time taken for tests: 63.250950 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 27900 bytes
HTML transferred: 0 bytes
Requests per second: 1.58 [#/sec] (mean)
Time per request: 63250.950 [ms] (mean)
Time per request: 632.509 [ms] (mean, across all concurrent requests)
Transfer rate: 0.43 [Kbytes/sec] received
onnection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 7.8 0 30
Processing: 1582 36427 18260.3 37694 62660
Waiting: 1572 36422 18260.1 37694 62660
Total: 1582 36431 18259.7 37694 62680
Percentage of the requests served within a certain time (ms)
50% 37694
66% 46847
75% 53176
80% 56090
90% 60286
95% 61738
98% 62590
99% 62680
100% 62680 (longest request)
感觉mod_python没起怎么作用, ab我不是很会看, 想问下我这结果是不是正常的. 我192.168.1.254那台服务器配置不高(OS:debian .C 1.3的CPU, 256内存)