『
Django Ver.1 + mod_wsgi で "Hello, world!" 』で用意したもので確認します。
ApacheのConfファイル
WSGIScriptAlias / "/home/httpd/vhost/django/django_with_wsgi/apache/django.wsgi"
<Directory /home/httpd/vhost/django/django_with_wsgi/apache>
Order allow,deny
Allow from all
</Directory>
$ cat django_with_wsgi/hello/views.py
# Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. Django with mod_wsgi")
$ curl "http://localhost/hello/"
Hello, world. Django with mod_wsgi
Apache Bench
$ ab -n 10000 -c 100 "http://localhost/hello/"
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: Apache/2.2.9
Server Hostname: localhost
Server Port: 80
Document Path: /hello/
Document Length: 35 bytes
Concurrency Level: 100
Time taken for tests: 11.700486 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 2560000 bytes
HTML transferred: 350000 bytes
Requests per second: 854.67 [#/sec] (mean)
Time per request: 117.005 [ms] (mean)
Time per request: 1.170 [ms] (mean, across all concurrent requests)
Transfer rate: 213.67 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.9 0 30
Processing: 0 116 179.9 100 4920
Waiting: 0 109 105.1 100 4290
Total: 30 116 179.9 100 4920
Percentage of the requests served within a certain time (ms)
50% 100
66% 100
75% 100
80% 100
90% 110
95% 120
98% 450
99% 670
100% 4920 (longest request)
メモリ使用状況
top - 15:22:43 up 2:16, 2 users, load average: 7.01, 3.76, 2.02
Tasks: 65 total, 4 running, 61 sleeping, 0 stopped, 0 zombie
Cpu(s): 81.4%us, 12.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 6.6%si, 0.0%st
Mem: 256400k total, 253468k used, 2932k free, 6644k buffers
Swap: 524280k total, 0k used, 524280k free, 79956k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3019 apache 15 0 18072 10m 2284 S 7.0 4.0 0:05.13 httpd
3058 apache 15 0 18072 10m 2284 S 6.3 4.0 0:01.54 httpd
3006 apache 15 0 18072 10m 2284 S 5.3 4.0 0:05.14 httpd
3054 apache 15 0 18072 10m 2284 S 5.3 4.0 0:02.11 httpd
3055 apache 15 0 18072 10m 2284 S 5.3 4.0 0:01.66 httpd
3060 apache 15 0 18072 10m 2284 S 5.3 4.0 0:00.64 httpd
3031 apache 15 0 18072 10m 2284 S 5.0 4.0 0:02.85 httpd
3026 apache 15 0 18072 10m 2284 S 4.7 4.0 0:03.48 httpd
3050 apache 15 0 18072 10m 2284 S 4.7 4.0 0:01.85 httpd
3023 apache 15 0 18072 10m 2284 S 4.3 4.0 0:05.07 httpd
3033 apache 15 0 18072 10m 2284 S 4.3 4.0 0:02.89 httpd
3041 apache 15 0 18072 10m 2284 S 4.3 4.0 0:01.95 httpd
3044 apache 15 0 18072 10m 2284 S 4.3 4.0 0:01.98 httpd
3056 apache 15 0 18072 10m 2284 S 4.0 4.0 0:01.67 httpd
3038 apache 15 0 18072 10m 2284 S 3.3 4.0 0:01.89 httpd
3048 apache 15 0 18072 10m 2284 S 3.3 4.0 0:01.73 httpd
3052 apache 15 0 18072 10m 2284 S 3.3 4.0 0:01.88 httpd
3049 apache 15 0 18072 10m 2284 S 3.0 4.0 0:01.85 httpd
3053 apache 15 0 18072 10m 2284 S 3.0 4.0 0:02.03 httpd
3047 apache 15 0 18072 10m 2284 S 2.7 4.0 0:01.75 httpd