Closed YouveGotMeowxy closed 5 months ago
That's interesting, I've not seen that before. It's just a Django website at the end of the day. There isn't even a database backend (very light weight)
That's interesting, I've not seen that before. It's just a Django website at the end of the day. There isn't even a database backend (very light weight)
Just to see what would happen I opened up the floodgate and allowed apprise to use up to 2GB of ram, and it's "idling at around 750MB
I added some improvements (i think) based on googling around as this error you're getting isn't uncommon at all.
Most results point to the issue being the system's resources that is hosting the service.
The new changes add some jitter
control to help clean up the memory for workers a bit better and restart them in such a way that they're staggered to avoid causing any issues. I got this from a reported bug with another program here.
I also added the APPRISE_WORKER_TIMEOUT
environment variable for you to play with if you want. I increased the default value i had (90s to 300s) which should give workers plenty of time to action their requests before timing out (especially if they've been tasked to notify a lot of end points).
I'd also let you know that you can control the number of workers that load by leveraging APPRISE_WORKER_COUNT
. The default is dynamically calculated based on the server it's ran on (and as suggested by the Gunicorn website) (no cpus) *2 + 1
. But feel free to over-ride this if you wish and fix it to a lower value such as 4
or 3
.
The final change done with this commit is change how the workers operate. Previously they used sync
(the default mode). But gevent
has been documented to be so much faster and light weight; so it's introduced here as well.
I'll be curious on your thoughts or if you did any troubleshooting of your own that was successful?
Thanks, happy to see that you're still on it! :)
TBH I haven't really messed with it much since this, as I have so many other things going on, I was just hoping that leaving the issue would be enough on my end, lol.
I will see how things go and report back after coming to some sort of conclusion!
Sounds good; i haven't made a new version so you'll need to use :edge
release to pull the latest changes.
ok, grabbing it now!
Haven't updated yet, but just looked ad what it's doing at the moment; look at the memory, lol:
Almost a gig!
ok, I just loaded up:
www-data@apprise:/opt/apprise$ apprise --version
Apprise v1.4.5
Copyright (C) 2023 Chris Caron <lead2gold@gmail.com>
This code is licensed under the BSD License.
and still using a lot of mem:
:/
One small request; would it also be possible to add the Apprise version number at the beginning of the log? It would be easier in cases like this for example, to be able to just copy it for pasting rather than having to ssh in and do a apprise --version
each time. :)
I lowered the worker count to 3 as a test, as my apprise doesnt get used too much, so I'll see hwo it goes. Memory is a bit more reasonable now:
One question; and I overshooting my memory expectations? To me it seems like an idle thread should take "virtually" no memory if it's doing nothing at all. Perhaps only a MB or 2 per process (like an individual worker)? So for example, if I have 3 workers, only maybe 6MB for them all?
I'm really a loss here as as you said, it's just a django website with an nginx server in front of it. There is no other configuration. Hopefully someone will see this thread and possibly offer insight.
I know you can start your docker containers up with constricted resources. You could try doing this in your environment.
Seeing same thing here, about 700 mb memory usage
Seeing same thing here, about 700 mb memory usage
Managed to get it down by setting workers to 3 as above
Glad to hear. Perhaps the outcome of this is to not automatically generate the worker count based on the number of cpu cores (as documented by gunicorn), but fix it to a lower default value. It's set to a production setting now.
Apprise grants you the ability to override this which you're all leveraging here. So perhaps leaving it the way it is ideal, but instead just better document this memory issue you're having (and others too). The app consumes a small amount of memory, but your systems have a high core count(my guess) which makes it seem unreasonable? Is it fair to say that?
Thoughts?
Imho, this is about the expectation of usage vs resources
. Let's assume I use 1000 requests per day. Do I need 6x (my PC only had 6 cores) CPU resources and memories? Even one is more than enough. That's my credit.
Glad to hear. Perhaps the outcome of this is to not automatically generate the worker count based on the number of cpu cores (as documented by gunicorn), but fix it to a lower default value. It's set to a production setting now.
Apprise grants you the ability to override this which you're all leveraging here. So perhaps leaving it the way it is ideal, but instead just better document this memory issue you're having (and others too). The app consumes a small amount of memory, but your systems have a high core count(my guess) which makes it seem unreasonable? Is it fair to say that?
Thoughts?
Yeah, seems reasonable
I took @rasmusson agreement and @martadinata666's opinion and updated the README.md documentation accordingly.
I think this should cover off this ticket unless there is any disagreement?
Thoughts?
Closing off issue! Thanks for your input everyone!
:question: Question
Seems like 400mb is a lot for the type of app Apprise is(?) and when I keep bumping up it's mem allowance 100mb at a time it just eats all of that up as well. I'm not even sending messages, it's basically just idle, and it looks like this (for example):
In this sample screenshot, it's eating 53% cpu, and almost all of it's 400mb memory allowance.
Also, there are a lot of warnings, terminations, timeouts, etc. in my log; is this how it's supposed to normally look (this is just a small section of the log. it's pretty much all like this though)?