> Hi,
>
> My models are relatively big in file size (> 200 kb in total).
>
> Is ALL this code being loaded into memory for each web request over and
> over
> again, and without reusing the same files (that do not change)?.
>
> I'm noticing a consistent increase in memory % in each of the uwsgi-python
> processes/workers for simple web requests.
>
> This makes me think that web2py (or uwsgi-python) is loading the code for
> all models into memory for each web request without any caching / reusing,
> and without releasing any memory from previous requests, but only
> consuming
> more and more memory each time.
>
> This means that I run out of memory after a very few requests !
>
> Am I not correct above?, am I doing something wrong?, is this actually
> expected?, does this occur regardless of the web server or wsgi
> interface?.
>
> On a related note, should I move everything to modules (instead of
> models)?,
> will this fix the memory issues?.
>
> How can I solve this show-stopper problem?.
>
>

Honestly, (without knowing your app) i do no think this is a problem
related to web2py (and for sure it is not a uWSGI as its policy is: NO
LEAK).

Probably something in your app is leaking memory, but in the mean time you
can "patch" the problem with something like

--reload-on-rss <n>

where n is the number of megs after which a worker is restarted (freeing
its memory). I think 200 (megs) should be enough to maintain your
webserver healthy.

--
Roberto De Ioris
http://unbit.it

Reply via email to