My web2py application is running on Webfaction's servers over uwsgi/nginx. 
When the servers are started, four instances of nginx and four instances of 
uwsgi are spawned, with each nginx instance taking up ~18M of RAM, and each 
nginx instance taking up a couple of M. Accessing any part of the page 
(i.e. clicking a menu item) adds about 30M to one of the uwsgi instances. 
Clicking a menu item again can add between 2 and 30 M to any of the uwsgi 
instances (it will be 30 M if nothing has yet been added to the RAM usage 
of that particular instance). This happens until my memory limit (256 M) is 
exceeded. I think I've mitigated the behavior somewhat by moving some 
things from models to modules, and by serving static content separately, 
but I think my memory usage is still quite excessive. Is this normal 
behavior?

Should I try to move all databases from models to modules? Is it ok to have 
globals (i.e. settings = Storage()) declared in models? Is it alright to 
have import statements in models? In the controllers, is it better to have 
import statements inside or outside of functions?

As far as uwsgi goes, would it make sense to use the 'reload-on-rss' 
directive to restart when excessive memory is used? Are there any major 
downsides to this? Any other tips for optimizing uwsgi?

Any other tips for diagnosing the sources of excessive memory consumption, 
and diminishing this consumption? Thank you.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to