Re: tmpfs
Erich Titl <[email protected]> Wed, 20 Nov 2024 01:09:40 +0100
| Newsgroups | gmane.linux.leaf.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Boris Am 19.11.2024 um 22:47 schrieb Boris: > Hej Erich, > ... > aproximately 25 MB while being rotated (kept) 4 days. > > So, if there are 36 MB logged (and compressed) in 4 days and the box ia > up for 10 days, we don't even reach the 121 MB from df . > > Funny, isn't it? > > With the uncompressed logs, df -h shows > tmpfs 800.0M 149.0M 651.0M 19% /var/log > > For me it smells like tmpfs does not release former occupied storage > after logrotating. I doubt this, in my case to clear the space a correct restart of the service was needed. If it was tmpfs which is widely used many people would have reported it and it would have been fixed in the code. To me it feels like the logging daemon dispatches a separate process per file and if this process is not terminated correctly the file descriptor is kept alive and the file space is not passed back to file management. > > And no - no SSD on my box. To be honest I forgot the details aof the > hardware. ;-) But I'm shure there is no SSD. > > My habit ist to reboot the box when finding it on 100%. Well right, this clears the memory storage. what you can do is play with the LOGSIZE parameter. It determines if a log gets rotated and if I am not mistaken it is in KB. Then to watch what logrotate does you can always start it like sh -x /usr/bin/logrotate You will see that savelog is used to compress and rename the file here is an excerpt from a testrun on my system for lighttpd + . /etc/logrotate.d/lighttpd + LOGS_DAILY='lighttpd/access.log lighttpd/error.log' + LOGS_WEEKLY= Here we set the minimum size for a file to be rotated + LOGSIZE=1024 + USER=sh-httpd + DAEMON=lighttpd + METHOD=restart + COMPRESS_ALL=1 + LOGFILES='lighttpd/access.log lighttpd/error.log' + date '+%u' + DAY_OF_WEEK=2 + date '+%d' + DAY_OF_MONTH=19 + '[' 19 -eq 1 ] + '[' 2 -eq 7 ] + USER=sh-httpd + GROUP=adm + MODE=640 + METHOD=restart + LOGDEPTH=4 + LOGDIR=/var/log + COMPRESS_ALL=1 + LOGSIZE=1024 + SAVELOG=/usr/bin/savelog + '[' 1 '!=' 0 ] + SAVELOG='/usr/bin/savelog -a' + '[' 'lighttpd/access.log lighttpd/error.log' '!=' ] + cd /var/log + '[' -f lighttpd/access.log ] looks like there is no access.log (which is true) + '[' -f lighttpd/error.log ] + du lighttpd/error.log + cut -f 1 + set 8 + '[' 1024 '==' ] + '[' 8 -gt 1024 ] Nothing happens because the error.log is too small + '[' lighttpd '!=' ] + /etc/init.d/lighttpd restart the lighttpd service is started nevertheless. + '[' '!=' ] Hope this helps ET -- „Wer von seinem Tag nicht zwei Drittel für sich hat, ist ein Sklave.“ ―Friedrich Nietzsche ------------------------------------------------------------------------ leaf-user mailing list: [email protected] https://lists.sourceforge.net/lists/listinfo/leaf-user Support Request -- http://leaf-project.org/