You don't need to resend the email. I know it was there. It has been a very 
busy week. :-)

On 13/02/2015, at 8:55 PM, Paul Royik <[email protected]> wrote:

> The issue is with memory.
> I noticed, that memory is increasing on every Django request.
> I found similar question here: 
> http://stackoverflow.com/questions/2293333/django-memory-usage-going-up-with-every-request
> Is there any way to avoid it?

Work out why your code is doing.

Is your code runnable on your own computer system? To work this out on 
Webfaction is going to be too hard. By being able to run it on your own system 
in a development environment will make it a lot easier for you to isolate the 
problem as you can request one URL at a time repeatable and what the memory 
usage for each to see if a particular URL causes the problem.

> And perhaps last question, is I upgrade memory to 1 GB (I have 512 MB), what 
> will be, when traffic increases? I mean for how many visits will it suffice?
> If I now have 3000 uniques per day and not enough 512 MB, will this mean that 
> 1 GB is not enough for 6000 uniques? Or relationship is completely another?

Impossible for me to tell. You really need proper monitoring for your web 
application to be able to answer those questions, but you have enough issues 
now that telling you how to add more stuff, which will use more memory, is not 
the best idea.

> Is it also possible to limit memory? Like using resources.setrlimit or 
> something similar?

When limiting memory you can set a hard limit, but if you reach the limit what 
your application will do is unpredictable. You aren't usually going to get a 
nice exception saying you are out of memory, instead it will just crash usually.

> Just raise exception if process takes too long or takes too much memory?

Not sure what you mean by 'process' takes too long. For memory, sure you could 
add a background thread which monitors memory and when it exceeds some level to 
send a signal to itself to shutdown, causing Apache/mod_wsgi to restart it 
automatically.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to