We occasionally got an Apache error so the page didn't get displayed. So I decided to stress test using Apache Bench (ab). It seems the site suffered failure up to 50-100 concurrent connection.
Apache error log showed this error: >>>>>>Premature end of script headers: wsgihandler.py After digging around, I found similar discussions and change apache2.conf like this: # prefork MPM StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 256 MaxRequestsPerChild 500 ServerLimit 256 Didn't seem to help. ==== A few notes: + It appears when I switched to sqlite instead of posgres, I didn't have the problem. (Sqlite had other problems, such as occasional database locking, which is more serious) + I am on a VPS with 768MB with 1GB burstable. While I'm doing the stress test with Apache Bench (ab), using free on the server revealed memory usage was about 450MB. (Which is a lot, but is still under limit). ===== In summary, memory was available. But we got this wsgi error in Apache with multiple requests. Any idea please? Thanks.

