Apache, Django with mod_wsgi, and large request buffering

Posted by Mukul on Server Fault See other posts from Server Fault or by Mukul
Published on 2011-06-29T22:52:02Z Indexed on 2011/06/30 0:23 UTC
Read the original article Hit count: 414

Filed under:
|
|

In my setup of Apache 2.2 MPM worker and Django 1.3 with mod_wsgi 2.8, I need to support large POST request payloads. The problem is that when there are many such simultaneous requests, Apache uses up all the memory in the system and then crashes. It seems that Apache is buffering the requests completely in memory before executing the WSGI handler and passing it the request. Is there any way to control request buffering in Apache? The log shows the following error whenever the crash happens:

[Wed Jun 29 18:35:27 2011] [error] cgid daemon process died, restarting

Here's my virtual host's configuration:

<VirtualHost *:8080>
    ServerName example.com
    ErrorLog /var/log/apache2/error.log

    WSGIScriptAlias / <path to django.wsgi>
    WSGIPassAuthorization on

    WSGIDaemonProcess example.com
    WSGIProcessGroup example.com

    XSendFileAllowAbove on
    XSendFile on 
</VirtualHost>

© Server Fault or respective owner

Related posts about apache

Related posts about django