aptible / supercronic

Cron for containers
MIT License
1.84k stars 112 forks source link

High memory usage #151

Closed dercoder closed 6 months ago

dercoder commented 6 months ago

I am using supercronic in my docker containers and saw that it consumes a lot of memory.

cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.15.1
PRETTY_NAME="Alpine Linux v3.15"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
apk info supercronic
supercronic-0.1.12-r5 description:
Cron for containers

supercronic-0.1.12-r5 webpage:
https://github.com/aptible/supercronic

supercronic-0.1.12-r5 installed size:
8772 KiB
   17    16 root     S     698m   2%   3   0% /usr/bin/supercronic -split-logs /etc/cron.d/app

This pretty old version use about 700MB of memory which is a lot. So I tried a newer version:

53897 53339 root     S    1206m   4%   3   0% /usr/local/bin/supercronic -debug /etc/cron.d/app

but this newer version (v0.2.29) consumes even more memory (1.2GB).

Did I miss something here? I can't beleive that supercronic requires more memory than my application itself.

UserNotFound commented 6 months ago

Hi Alexander,

Assuming you're sharing a line from the output of top in Alpine, you're looking at the VSZ (virtual set size) stat, which does show about 1.2gb: image

You can press s to switch to the next view, which shows the RSS size of supercronic is actually just 14mb: image

You can also confirm the memory usage directly from /proc:

/ # cat /proc/1/status | egrep -i 'name|rss'
Name:   supercronic
VmRSS:     14316 kB
RssAnon:        7148 kB
RssFile:        7168 kB
RssShmem:          0 kB
dercoder commented 6 months ago

Hi Alex,

Assuming you're sharing a line from the output of top in Alpine, you're looking at the VSZ (virtual set size) stat, which does show about 1.2gb:

Yes correct.

You can press s to switch to the next view, which shows the RSS size of supercronic is actually just 14mb:

You are right.

Thank you for clearification. I also checked then the usage with docker stats and you are right. My mistake and thank you for clearification.

UserNotFound commented 6 months ago

No problem!