So recently I was playing around with Django on the Jython platform and wanted to see its performance in "production". The site I tested with was just a simple return HttpResponse("Time %.2f" % time.time())
view, so no database involved.
I tried the following two combinations (measurements done with ab -c15 -n500 -k <url>
, everything in Ubuntu Server 10.10 on VirtualBox):
J2EE application server (Tomcat/Glassfish), deployed WAR file
I get results like
Requests per second: 143.50 [#/sec] (mean) [...] Percentage of the requests served within a certain time (ms) 50% 16 66% 16 75% 16 80% 16 90% 31 95% 31 98% 641 99% 3219 100% 3219 (longest request)
Obviously, the server hangs for a few seconds once in a while, which is not acceptable. I assume it has something to do with reloading Jython because starting the
jython
shell takes about 3 seconds, too.AJP serving using patched flup package (+ Apache as frontend)
Note: flup is the package used by
manage.py runfcgi
, I had to patch it because flup's threading/forking support doesn't seem to work on Jython (-> AJP was the only working method).Almost the same results here, but sometimes the last 100 requests don't even get answered at all (but server process still alive).
I'm asking this on SO (instead of serverfault) because it's very Django/Jython-specific. Does anyone have experience with deploying Django sites on Jython? Is there maybe another (faster) way to serve the site? Or is it just too early to use Django on the Java platform?