Bug 48288 - ryslogd consumes plenty of memory
ryslogd consumes plenty of memory
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: General
UCS 4.2
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
https://bugs.debian.org/cgi-bin/bugre...
:
: 48522 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-12-06 10:29 CET by Nico Stöckigt
Modified: 2020-07-03 20:52 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.023
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018112921000568, 2019012221001088
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2018-12-06 10:29:00 CET
In a customer environment 'rsyslogd' consumes 55% of memory and raising.

Info about the environment:
  
UCS 4.2-3

rsyslogd 8.4.2, compiled with:
        FEATURE_REGEXP:                         Yes
        GSSAPI Kerberos 5 support:              Yes
        FEATURE_DEBUG (debug build, slow code): No
        32bit Atomic operations supported:      Yes
        64bit Atomic operations supported:      Yes
        memory allocator:                       system default
        Runtime Instrumentation (slow code):    No
        uuid support:                           Yes
        Number of Bits in RainerScript integers: 64


See Also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794848
Comment 1 Nico Stöckigt univentionstaff 2018-12-06 10:32:03 CET
Additional Infos:

root@ucs:~# free -m
             total       used       free     shared    buffers     cached
Mem:          4329       3879        450         19        281        420
-/+ buffers/cache:       3177       1152
Swap:         2048       2048          0

root@ucs:~# top
top - 08:59:53 up 135 days,  3:02,  1 user,  load average: 1.86, 1.81, 1.86
Tasks: 151 total,   5 running, 146 sleeping,   0 stopped,   0 zombie
%Cpu(s): 18.4 us, 29.3 sy,  0.0 ni, 52.2 id,  0.2 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   4433548 total,  3973876 used,   459672 free,   288140 buffers
KiB Swap:  2098172 total,  2098172 used,        0 free.   431088 cached Mem
 
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 5197 root      20   0 4650356 2.359g   1792 S   0.0 55.8 134:11.82 rsyslogd
  190 root      20   0  316036 149136 146768 S   0.0  3.4   1214:35 systemd-journal
20468 root      20   0  583328  89748  55192 S   0.0  2.0   2:26.88 apache2

=== syslog ===
Nov 29 09:17:20 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:23 ucs rsyslogd-2177: imuxsock[pid 5217]: 165 messages lost due to rate-limiting
Nov 29 09:17:27 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:29 ucs rsyslogd-2177: imuxsock[pid 5217]: 137 messages lost due to rate-limiting
Nov 29 09:17:32 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:35 ucs rsyslogd-2177: imuxsock[pid 5217]: 173 messages lost due to rate-limiting
Nov 29 09:17:38 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:41 ucs rsyslogd-2177: imuxsock[pid 5217]: 137 messages lost due to rate-limiting
Nov 29 09:17:45 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:47 ucs rsyslogd-2177: imuxsock[pid 5217]: 104 messages lost due to rate-limiting
Nov 29 09:17:50 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:53 ucs rsyslogd-2177: imuxsock[pid 5217]: 119 messages lost due to rate-limiting
Nov 29 09:17:57 ucs rsyslogd-2177: imuxsock[pid 5217]: begin to drop messages due to rate-limiting
Nov 29 09:17:59 ucs rsyslogd-2177: imuxsock[pid 5217]: 132 messages lost due to rate-limiting
Comment 2 Erik Damrose univentionstaff 2018-12-06 10:53:53 CET
The bug report you referenced states that the issue was that a remote server configured to receive logs was not available, so the messages were cached locally. Is that the case here?
Comment 4 Arvid Requate univentionstaff 2018-12-06 12:21:10 CET
Since I was reading into rsyslog config for another project, I'll leave some links here that might be useful to understand configuration of rsyslog queues, blocking, Memory- and Disk-Assisted queues:

https://www.rsyslog.com/doc/v8-stable/concepts/multi_ruleset.html
https://www.rsyslog.com/doc/v8-stable/concepts/queues.html
https://www.rsyslog.com/doc/v8-stable/rainerscript/queue_parameters.html
https://www.rsyslog.com/doc/master/whitepapers/queues_analogy.html
Comment 5 Nico Stöckigt univentionstaff 2019-01-16 14:54:35 CET
(In reply to Erik Damrose from comment #2)
> The bug report you referenced states that the issue was that a remote server
> configured to receive logs was not available, so the messages were cached
> locally. Is that the case here?

absolutely, every now and than the remote host is not reachable so I assume the message cache can't be entirely processed. That's probably why the cache consumes more and more memory until nothing is left.

A configurable Threshold would be nice.
Comment 6 Arvid Requate univentionstaff 2019-01-16 16:25:34 CET
Our UCR template includes /etc/rsyslog.d/*.conf before defining the actions for remote logging (UCR syslog/remote), so I guess you could set the MainMsgQueueSize and similar parameters there, see:

https://www.rsyslog.com/doc/master/configuration/global/options/rsconf1_mainmsgqueuesize.html

Other parameters may need adjustment, too, to tell rsyslog what to do with incoming messages once the queue is full.
Comment 7 Nico Stöckigt univentionstaff 2019-01-17 12:37:05 CET
So what 'more info' is needed?
Comment 8 Arvid Requate univentionstaff 2019-01-17 13:17:21 CET
E.g. if the customer reporting this issue had

* special UCR variables (I can only guess that syslog/remote was enabled, but we need to know for sure)

* special includes in /etc/rsyslog.d/*.conf
Comment 9 Arvid Requate univentionstaff 2019-01-23 14:48:12 CET
*** Bug 48522 has been marked as a duplicate of this bug. ***
Comment 10 Nico Stöckigt univentionstaff 2019-01-23 15:59:29 CET
(In reply to Arvid Requate from comment #8)
> E.g. if the customer reporting this issue had
> 
> * special UCR variables (I can only guess that syslog/remote was enabled,
> but we need to know for sure)

syslog/remote='@@192.168.1.2'

> 
> * special includes in /etc/rsyslog.d/*.conf

etc/rsyslog.d/postfix.conf:
# Create an additional socket in postfix's chroot in order not to break
# mail logging when rsyslog is restarted.  If the directory is missing,
# rsyslog will silently skip creating the socket.
$AddUnixListenSocket /var/spool/postfix/dev/log

---

Quite apart from that, wouldn't it be good to integrate a more recent version into UCS 4.2 (backport) that doesn't have the problem?
Comment 11 Ingo Steuwer univentionstaff 2019-05-14 13:55:32 CEST
My understanding is that this occures only if a remote syslog server is configured and the remote servers has been down for a while, and it's the intended behavioud or the default rsyslogd configuration found in any other distro as well, and workarounds are documented.

So this is a potential enhancement, not a bug.
Comment 12 Nico Stöckigt univentionstaff 2019-08-09 11:00:55 CEST
this is all about a backport of https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794848 because the handling has changed in a newer version of rsyslog.
Comment 13 Arvid Requate univentionstaff 2019-08-12 19:35:00 CEST
Hmm, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794848#29 says that's a configuration issue, and there is no patch to backport?
Comment 14 Ingo Steuwer univentionstaff 2020-07-03 20:52:55 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.