--
Artiom Diomin, Development Dep, "Comunicatii Libere" S.R.L.
http://www.asterisksupport.ru
http://www.asterisk-support.com
> Vance Dubberly wrote:
> > On the plus side it is faster than a similar PHP app ( with APC ) and
> > faster than serving static files.
Afaik, dynamic things _can't be_ faster than static things.
Kai
Have you done any profiling? I haven't compared such a port, but I'd
be surprised if performance is significantly (i.e. one order)
different without some optimization being missed.
If you have, can you point to any parts of Django that we could improve?
As presented, there's not much actionable. "Java is faster than
Python" is not news, but I doubt the language is the problem here.
Thanks!
Congrats :)
> Also thought you might want to know the site was running on Tomcat/Mysql and
> the performance difference is mind blowing. Unfortunately the actual
> server specs and benchmarks can't be released without going through a nasty
> ball of red tape but let's just say django is ALOT more resource intensive
> and ALOT slower.
I (and many others, I'm sure) would love to help, but without details
it's basically impossible. Tuning hardware for Java is a great deal
different than tuning it for LAMPish stuff like Django.
Like Jeremy, though, I'd suspect a software problem: most code ported
from one language to another suffers the idioms of the old language.
Python isn't Java, but if you've coding like it is you're gonna have
issues.
If you can/want to share any additional details, we can try to help you out.
Jacob
- Jacques Derrida
- Jacques Derrida
Thanks for clearing up the issue.
It's true that the process-per-request model is heavier in terms of
RAM than alternatives, but it's generally fast. Maybe your available
processes are bottlenecking on something that could be addressed.
See here for an example of what you should expect:
http://www.davidcramer.net/curse/44/what-powers-curse.html
http://www.davidcramer.net/other/43/rapid-development-serving-500000-pageshour.html
They did make some changes to django for their specific need, but
they're not too exotic, and I doubt you're pushing that hard.
For more common performance tuning, have a look here:
http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/
In particular, make sure KeepAlive is off for the django domain and
serve media with something lighter than apache.
...
> Frankly I think a generic python application server similar to tomcat
> would do a world of good for python apps in general. Something similar to
> cherrypy... but this is beyond the responsibilities of the django community
> which have plenty great work left.
Similar to CherryPy but not it? How come? In any case, if you're
thinking this way, consider Aspen/Stephane:
http://www.zetadev.com/software/aspen/
It appears to be thread-per-request. I haven't used it, but Chad's
been specifically trying to gain acceptance w/ the Django community;
I'm sure your interest would be appreciated.
> I really wish I could talk more about this provide actual benchmarks
At least you've described, roughly, your beef. I still think you
should be in the same ballpark, but I'm not even sure what you're
measuring.
Cheers,
Jeremy
Are you running Django behind a load balancer like Perlbal or nginx?
One side-effect of propper LB is that you can drastically lower
MaxClients (because each backend client spends less time serving a
request). Look up "spoonfeeding" for more about this problem.
Even if you've only got a single web server you should always use
Perlbal or friends.
Jacob
so all the usual issues (and non-issues) with the python GIL apply...
btw. i never understood what's so nice about those pure-python (or
pure-ruby (mongrel etc.)) web-servers..
for example regarding performance/memory-consumption/whatever,
why should apache+mod_python be worse than a pure-python-web-server?
let's say with the single-process multi-threaded apache-mode...?
gabor
It may be of interest for you to read my recent blog post at:
http://blog.dscpl.com.au/2007/07/web-hosting-landscape-and-modwsgi.html
This talks about mod_wsgi, but various of the issues discussed there
with running mod_wsgi in embedded mode apply equally to mod_python.
Some of the things discussed are the balance between performance vs
security, memory usage, scaling ability of Apache and what impacts the
GIL has on performance when using multiple processors. Also ensure you
read comments as some discussion on trade offs between mod_wsgi and
mod_fastcgi or proxy like solutions.
Graham