Stress test on Django makes it slow while there are free system resources
How many workers of django you are running? Maybe server can't load to 100% because you are running small amount of workers, but there are many database connections, so most of the time workers are waiting database, and blocking new connections.
Today I was doing a stress test to a new Django (1.5.4) running on an Ubuntu Server 12.04 site before going into production and I've found some unexpected results:
Doing 50 requests per second, htop showed a CPU usage of ~50% and RAM also ~50%. I'm not currently using Django cache and doing a normal browser request while doing the stress test it took ~30s to load each page (without any load it takes <= 2s). The server didn't crash during the test, but I dont understad why if there are almost 50% of the resources free it lasts so much... I expected to see a higher CPU and memory usage!
So, my question is: Is there any Django default setting that limits the number of requests per second? Or does Apache or mod_wsgi have any kind of limit? Do I have to change some MySQL config?
(Note: I'm a software engineer, not sysadmin).