-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement persistence #83
Conversation
Released in v2.1.0 |
Quick question about this, how does it behave if several instances of gatus are using the same file? Thanks for your work! |
@rissson Unfortunately, that won't do anything constructive. The only interactions with the file are:
Every save operations overwrites the previous data persisted, thus, multiple applications pointing to the same file would just independently persist their data over the other applications. Since Gatus only reads from the file once on application start, each application wouldn't be influenced by any changes made by other applications on the file. TL;DR: Persistence is really just to ensure that the data can be read on the next application start, once the data is read, the entire dataset is in memory and any changes made to the file is inconsequential, thus, the current persistence implementation cannot be used for synchronization between multiple Gatus instances, which I assume is why you're asking. |
Actually, my question wasn't exactly about syncing multiple Gatus instances. My main problem is that my Gatus pods restart quite frequently:
According to my logs, they get OOM killed by the kernel. So, the only thing I'm really looking for is whether they'll get some state after they're back up. Thus, it doesn't really matter if they don't sync their state. The only question left is what happens if two instances try to write to the file at the same time. |
@rissson If you care about persistence, you may want to use a StatefulSet instead, but before even worrying about that, I'd suggest that you use only a single pod for Gatus (unless you're using it for stress test purposes). Furthermore, you should give the deployment a bit more memory if it's getting OOMKilled that often. Would you mind showing me the output of For reference, I use a single pod for a Gatus instance that has 50+ services to monitor and it hasn't restarted a single time in the past 26 days. |
Here is |
@rissson Since Gatus keeps all of its data in memory, if you have enough monitored services to cause the instance to use more than 30M of memory, I suggest that you increase your memory request to i.e. Update the following: resources:
limits:
cpu: 200m
memory: 50M
requests:
cpu: 50m
memory: 20M to resources:
limits:
cpu: 200m
memory: 100M
requests:
cpu: 50m
memory: 40M As I've mentioned, I also suggest you decrease the number of replicas ( P.S. For |
I increased the limits as you suggested, no restart since. Again, thanks a lot for your wonderful work! |
@rissson Glad to hear it! 🥳 |
No description provided.