On Nov 28, 8:31 pm, Graham Dumpleton <[email protected]> wrote: > On 29 November 2011 03:12, Nick Murdoch <[email protected]> wrote: > > Hi all, > > > I'm having a bit of trouble with a Pylons application that I'm > > attempting to deploy. Using paster's server (paster serve config.ini) > > I'm able to read in a 2.4MB JSON request just fine, but when the > > application is deployed with mod_wsgi, the read() causes a > > MemoryError. > > > In an ideal world I'd read the contents incrementally (and I'm doing > > this for XML processing), but unfortunately the json library insists > > on reading in the whole content first. However, I wouldn't have > > expected something as small as a couple of megs to start causing > > MemoryErrors anyway. > > > I noticed that paster starts swapping on the target server in order to > > hold that much data, perhaps that is related? > > > The apache site config looks like this: > > > WSGIDaemonProcess pylonsproject processes=1 threads=25 > > WSGIScriptAlias / /.../dispatch.wsgi > > > And my dispatch.wsgi: > > > # Add the virtual Python environment site-packages directory to > > the path > > import site > > site.addsitedir('/...[virtual environment]../site-packages') > > > from paste.script.util.logging_config import fileConfig > > fileConfig('/.../config.ini') > > > # Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` > > messages > > import os > > os.environ['PYTHON_EGG_CACHE'] = '/tmp/egg-cache' > > > # Load the Pylons application > > from paste.deploy import loadapp > > application = loadapp('config:/.../config.ini') > > > I'm running Ubuntu 8.04 with apache 2.2.8-1ubuntu0.21 and libapache2- > > mod-wsgi 2.0-1~hardy1. Any help getting rid of this MemoryError would > > be very much appreciated. > > Are you running on your own hardware, or on a virtualised system? > > You should as first step upgrade to newest mod_wsgi. Version 2.0 is > very old and has a number of known problems.
Thanks for the pointers. I backported libapache2-mod-wsgi 3.3-4 to Ubuntu 8.04 and that fixes the problem. For reference, Ubuntu was running directly on the hardware, no virtualisation. Cheers, Nick -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
