Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Created November 20, 2010 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amcgregor/707936 to your computer and use it in GitHub Desktop.
Save amcgregor/707936 to your computer and use it in GitHub Desktop.
Logs from two terminals, the first running the marrow.server.http HTTP/1.1 server in pre-fork mode (no threading) and the second running AB and checking memory. The third is a partial snapshot of `top` checking CPU utilization. [benchmark, performance, http]
ecanus ~ # echo 32768 > /proc/sys/fs/file-max
ecanus ~ # ulimit -n 32768
ecanus ~ # cd ~amcgregor/personal; . bin/activate; cd src
(personal)ecanus src # python
Python 2.6.5 (release26-maint, Aug 8 2010, 20:35:07)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
(personal)ecanus src # python marrow.server.http/marrow/server/http/__init__.py
INFO:marrow.server.base:Starting up.
INFO:marrow.server.base:Pre-forking 4 processes from PID 11542.
DEBUG:marrow.server.base:Executing startup hooks.
DEBUG:marrow.server.base:Executing startup hooks.
INFO:marrow.server.base:Server running with PID 11543, serving on *:8080.
INFO:marrow.server.base:Server running with PID 11544, serving on *:8080.
DEBUG:marrow.server.base:Executing startup hooks.
INFO:marrow.server.base:Server running with PID 11545, serving on *:8080.
DEBUG:marrow.server.base:Executing startup hooks.
INFO:marrow.server.base:Server running with PID 11546, serving on *:8080.
ecanus ~ # ulimit -n 32768
ecanus ~ # ps aux | grep marrow
root 11542 0.5 1.2 9228 6548 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11543 0.0 0.9 9228 4932 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11544 0.0 0.9 9228 4932 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11545 0.0 0.9 9228 4932 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11546 0.0 0.9 9228 4932 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11550 0.0 0.1 1880 560 pts/3 S+ 08:21 0:00 grep --colour=auto marrow
ecanus ~ # ab -n 100000 -c 10000 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 12 bytes
Concurrency Level: 10000
Time taken for tests: 16.653 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 7968345 bytes
HTML transferred: 1241820 bytes
Requests per second: 6004.77 [#/sec] (mean)
Time per request: 1665.341 [ms] (mean)
Time per request: 0.167 [ms] (mean, across all concurrent requests)
Transfer rate: 467.27 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 28 828 1425.1 472 9567
Processing: 82 608 234.8 576 1362
Waiting: 57 461 202.6 423 1178
Total: 144 1436 1465.2 1127 10568
Percentage of the requests served within a certain time (ms)
50% 1127
66% 1253
75% 1372
80% 1509
90% 1812
95% 3971
98% 9893
99% 10073
100% 10568 (longest request)
ecanus ~ # ps aux | grep marrow
root 11542 0.1 1.2 9228 6548 pts/2 S+ 08:21 0:00 python marrow.server.http/marrow/server/http/__init__.py
root 11543 12.3 1.9 14536 10292 pts/2 S+ 08:21 0:05 python marrow.server.http/marrow/server/http/__init__.py
root 11544 13.1 2.1 15620 11380 pts/2 S+ 08:21 0:06 python marrow.server.http/marrow/server/http/__init__.py
root 11545 16.7 2.3 16312 12292 pts/2 S+ 08:21 0:07 python marrow.server.http/marrow/server/http/__init__.py
root 11546 19.5 2.6 18264 14088 pts/2 S+ 08:21 0:09 python marrow.server.http/marrow/server/http/__init__.py
root 11553 0.0 0.1 1884 564 pts/3 S+ 08:22 0:00 grep --colour=auto marrow
top - 08:26:29 up 187 days, 11:22, 4 users, load average: 0.45, 0.18, 0.07
11579 root 20 0 108m 69m 1472 R 77 13.4 0:10.91 ab
11578 root 20 0 20752 16m 1176 S 58 3.2 0:07.32 python
11576 root 20 0 15088 10m 1176 S 42 2.1 0:05.60 python
11577 root 20 0 15368 11m 1176 S 40 2.1 0:05.86 python
11575 root 20 0 15044 10m 1176 S 20 2.1 0:04.93 python
@amcgregor
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment