Skip to content
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

Dkron using gigs of memory #1566

Open
PraedictixIT opened this issue Aug 26, 2024 · 2 comments
Open

Dkron using gigs of memory #1566

PraedictixIT opened this issue Aug 26, 2024 · 2 comments

Comments

@PraedictixIT
Copy link

I've been testing Dkron and over time the memory footprint has grown to 4.1G. And the snapshot files have grown to 3.2G

I do have a lot of jobs running that have debug mode turned on and are outputting a lot of text. I swear I read somewhere the database trims itself automatically but overall the memory print continues to grow (but I can't seem to find that now). Is this growth expected?

Are there options for clearing out the history of the jobs and hopefully reducing the memory footprint?

ps -C dkron -o rss
RSS
4371128

/dkron.data/raft/snapshots/4-3258718-1724670422297:
total 3.2G
-rw-r--r-- 1 root root 3.2G Aug 26 06:07 state.bin
-rw-r--r-- 1 root root 426 Aug 26 06:07 meta.json

/dkron.data/raft/snapshots/4-3267159-1724676311715:
total 3.2G
-rw-r--r-- 1 root root 3.2G Aug 26 07:45 state.bin
-rw-r--r-- 1 root root 426 Aug 26 07:45 meta.json

/dkron.data/raft/snapshots/4-3275537-1724682015330:
total 3.2G
-rw-r--r-- 1 root root 3.2G Aug 26 09:20 state.bin
-rw-r--r-- 1 root root 426 Aug 26 09:20 meta.json

Ubuntu 22.04
Dkron 3.2.6 (I reviewed the change log for 3.2.7 and I didn't see any changes that would resolve this)

@vcastellm
Copy link
Member

No the growth in memory usa is not expected, and yes the disk space only contains last 100 execution logs. The test environment remains pretty stable along time http://test.dkron.io:8080/ui/

Can you elaborate on what "debug mode" means?

@PraedictixIT
Copy link
Author

Debug mode for my scripts Dkron is executing. This means there are large amounts of text to standard out. It appears by default Dkron keeps this text in memory (key value store) for every execution (https://dkron.io/docs/usage/processors/#built-in-processors).

To resolve this issue I performed a backup, shutdown all the servers, deleted all the dkron data, bootstrapped and reconfigured the cluster, edited my backup file of the jobs send standard out to /dev/null, and then restored the backup file. Since performing this config change Dkron hasn't taken up more than 100MBs of memory and the state.bin file is no more than 16MBs.

This issue should maybe be switched over to a feature request. As I don't really want to use any logging processor but there is the rare need for me to review logs within the web interface for debugging. I would love that the system would have a periodical purge of this key value store based on a config option. Or just an API call that would allow me to purge key value stores.

Also may I suggest the information about the default use of the key value store be mentioned in the Install or Config documentation. With this kind of default behavior I would expect others to hit this pitfall.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@vcastellm @PraedictixIT and others