We're acually using Cherrypy, so it would be quite easy to test and
check the performance. We'll post any issues we found.
Thank you!
--
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net
ab -c 10 -t 60 http://localhost:8088/
Executing Django with Cherrypy with 3 threads on a PPC Computer 2 CPU 2 GHz
With Tornado WSGI:
ab -c 10 -t 60 http://localhost:8888/
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 localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Finished 25022 requests
Server Software: TornadoServer/0.1
Server Hostname: localhost
Server Port: 8888
Document Path: /
Document Length: 266 bytes
Concurrency Level: 10
Time taken for tests: 60.019 seconds
Complete requests: 25022
Failed requests: 0
Write errors: 0
Total transferred: 9333206 bytes
HTML transferred: 6655852 bytes
Requests per second: 416.90 [#/sec] (mean)
Time per request: 23.987 [ms] (mean)
Time per request: 2.399 [ms] (mean, across all concurrent requests)
Transfer rate: 151.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 6
Processing: 3 24 1.9 24 68
Waiting: 0 24 1.9 23 68
Total: 7 24 1.9 24 68
Percentage of the requests served within a certain time (ms)
50% 24
66% 24
75% 24
80% 24
90% 25
95% 26
98% 27
99% 28
100% 68 (longest request)
Using CherryPy with 3 threads (the best configuration for my computer
in my tests)
ab -c 10 -t 60 http://localhost:8088/
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 localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Finished 21500 requests
Server Software: CherryPy/3.0.3
Server Hostname: localhost
Server Port: 8088
Document Path: /
Document Length: 266 bytes
Concurrency Level: 10
Time taken for tests: 60.001 seconds
Complete requests: 21500
Failed requests: 0
Write errors: 0
Total transferred: 8299000 bytes
HTML transferred: 5719000 bytes
Requests per second: 358.33 [#/sec] (mean)
Time per request: 27.907 [ms] (mean)
Time per request: 2.791 [ms] (mean, across all concurrent requests)
Transfer rate: 135.07 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 20.5 0 2999
Processing: 3 28 10.7 26 413
Waiting: 3 26 10.3 24 412
Total: 3 28 23.1 26 3031
Percentage of the requests served within a certain time (ms)
50% 26
66% 28
75% 30
80% 31
90% 34
95% 38
98% 43
99% 48
100% 3031 (longest request)
To sumarize:
416.90 req/s for Tornado WSGI
358.33 req/s for CherryPy
Tornado makes one CPU up to 100% nearly at the same time of the ab
execution, Cherrypy takes longer. Perhaps some CherryPy guru could
configure it better.
The code is at
http://appfusedjango.googlecode.com/svn/trunk/hello_world for the
CherryPy (django-cerise) version
http://appfusedjango.googlecode.com/svn/trunk/hello_tornado for the
tornado version (includes tornado wsgi)
This is a sample helloword project with just the essential to run.
It's the same code I used to compare with PHP frameworks
http://trespams.com/2009/05/10/django-vs-php-framewors/
cool - this worked out of the box - but no css and js - can I serve media from
tornado, and if so, a pointer as to how?
--
regards
kg
http://lawgon.livejournal.com
Have you properly configured your MEDIA_URL to point to your Tornado
server instead of localhost:8000. I haven't made any test about
Tornado performance on serving statig files, but on production our
actual configuration with CherryPy in WSGI mode involves a nginx
server acting as a reverse proxy and serving the media files.
I use the configuration without nginx pointing directly to the WSGI
server just to make sure that all the media points to right server.
That is, that I have write all my media files as
{{MEDIA_URL}}/img/xxxx.jpg and so on.
Hope it helps!
solved - managed to run several django sites of an nginx instance using
virtual hosts and individual tornado servers for each virtual host. Coolness.
.
will document after trying it in production - a zillion times faster.
faster than......... ? flup?
--
Javier
faster than apache/mod_wsgi
have put my code in djangosnippets:
http://www.djangosnippets.org/snippets/1748/, the site in question is here:
http://demo.ilugc.org.in