codl/forget

High RAM usage

transkatgirl opened this issue · 4 comments

Running forget locally uses over 1gb of RAM, which is very excessive for a relatively simple webapp. Is there any way to get this down to a reasonable amount, so that it can be run on a low-end device like a Raspberry Pi?

codl commented

do you mean over 1 gb including postgres and redis?

No, I started both postgres and redis before measuring the RAM usage.

codl commented

Interesting. I'll admit memory usage optimisation was never something I took into account. There are surely changes that can be made to lower memory usage, but I can't promise that I'll look into them anytime soon.

If this is only for one or two users you could edit the Procfile to run fewer processes, for example:

web: gunicorn -w 3 -t 3600 -b 127.0.0.1:42157 forget:app
worker: celery -A tasks worker --autoscale=64,3
beat: celery -A tasks beat

.. will lower the number of web processes from 9 to 3 and the number of worker processes at rest from 8 to 3.

codl commented

Looking into this more, I think, at least in my setup, most of the ram goes to celery, so getting rid of celery, which is something i'd like to do (#398), would help.