Cannot allocate memory on Popen commands

2024/10/12 4:32:58

I have a VPS server with Ubuntu 11.10 64bit and sometimes when I execute a subprocess.Popen command I get am getting too much this error:

OSError: [Errno 12] Cannot allocate memory

Config details: For each site I have an apache site like this: http://pastebin.com/mcew79sH And also a settings and a wsgi file (both on same folder than project) like this: http://pastebin.com/hrrV4WTM

I am passing the arguments to Popen constructor as a list and using close_fds=True, I am also using and stdin/stdout to communicate with PIPE for the ones which I need reading the response.

Finally this is the traceback I get when the error appears http://pastebin.com/FqXPHwhq

The server is serving about 25 sites with small traffic (probably 5 of them has a considerable daily use) my VPS RAM size is 1024MB all of them execute PostgreSQL databases.

All this started when we migrated the sites from a VPS running Ubuntu Server 10.10 32 Bit to 11.10 64Bit.

Any idea how to solve this?

---- EDIT ----

ps aux --> http://synsa.synsa.com/site_media/process.txt

Answer

Some VPS providers calculate memory limits in strange ways. See if what is described in:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Memory_Constrained_VPS_Systems

helps at all.

https://en.xdnf.cn/q/118242.html

Related Q&A

Python - find where the plot crosses the axhline on python plot

I am doing some analysis on some simple data, and I am trying to plot auto-correlation and partial auto-correlation. Using these plots, I am trying to find the P and Q value to plot in my ARIMA model.I…

remove tick labels in Python but keep gridlines

I have a Python script which is producing a plot consisting of 3 subplots all in 1 column.In the middle subplot, I currently have gridlines, but I want to remove the x axis tick labels.I have triedax2.…

Signal in PySide not emitted when called by a timer

I need to emit a signal periodically. A timer executes certain function, which emits the signal that I want. For some reason this function is not being emitted. I was able to reproduce the error on min…

pybuilder and pytest: cannot import source code when running tests

so i have a project:<root> |- src|-main|-python|-data_merger|- common|- constans|- controller|- resources|- rest|-tests|-unittest|-integrationtestdata_merger is marked as root (I am using Pycharm…

HTTPS proxy server python

I have a problem with my ssl server (in Python). I set the SSL proxy connection in my browser, and try to connect to my ssl server.This is the server:import BaseHTTPServer, SimpleHTTPServer import sslh…

Python 2.7.6 + unicode_literals - UnicodeDecodeError: ascii codec cant decode byte

Im trying to print the following unicode string but Im receiving a UnicodeDecodeError: ascii codec cant decode byte error. Can you please help form this query so it can print the unicode string properl…

Retrieving data from Quandl with Python

How can I get the latest prices from a Quandl dataset with the Python API (https://www.quandl.com/help/python)? On https://www.quandl.com/help/api, it says "You can use rows=n to get only the fir…

Django: Using same object how to show 2 different results in django template?

Using the same object how to SHOW 2 different results using django template ?In one page there are two divs, it should show different information using the same object.INPUTobject data has follows[{&q…

Override attribute access precedence having a data descriptor

I have a bunch of instances of a MongoEngine model. And the profiler shows that a lot of time is spent in __get__ method of MongoEngine model fields:ncalls tottime percall cumtime percall filename:…

Understanding pythons reverse slice ( [::-1] )

I always thought that omitting arguments in the python slice operation would result into:start = 0 end = len(lst) step = 1That holds true if the step is positive, but as soon as the step is negative, l…