forget icon indicating copy to clipboard operation
forget copied to clipboard

High RAM usage

Open transkatgirl opened this issue 6 years ago • 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?

transkatgirl avatar Dec 31 '19 21:12 transkatgirl

do you mean over 1 gb including postgres and redis?

codl avatar Jan 01 '20 16:01 codl

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

transkatgirl avatar Jan 02 '20 00:01 transkatgirl

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 avatar Jan 03 '20 00:01 codl

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.

codl avatar Mar 03 '22 20:03 codl