Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 529828 - app-admin/syslog-ng 3.6.1 consumes CPU
Summary: app-admin/syslog-ng 3.6.1 consumes CPU
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Mr. Bones. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 08:05 UTC by Ron OHara
Modified: 2014-12-18 22:29 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
syslog-ng.conf (syslog-ng.conf,4.96 KB, text/plain)
2014-11-20 16:25 UTC, Ron OHara
Details
Screenshot of syslog-ng-3.6.1 strace output.png (syslog-ng-strace.png,98.40 KB, image/png)
2014-11-22 22:16 UTC, Jaak Ristioja
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron OHara 2014-11-19 08:05:44 UTC
for syslog-ng-3.6.1 (on a long installed stable (not ~x86) system)
After noting this message in the log:

Nov 19 07:00:01 miner6 syslog-ng[13137]: Number of allowed concurrent connections reached, rejecting connection; client='AF_UNIX(anonymous)', local='AF_UNIX(/dev/log)', max='256'

the syslog-ng task uses the maximum CPU available (CPU loop)



Reproducible: Always

Steps to Reproduce:
1.allow messages (eg from postfix) flood the syslog
2.receive 'rejecting connections' message
3.see CPU usage max out


Expected Results:  
CPU usage should remain low.

This is probably an upstream bug ....

My workaround was to add:

>=app-admin/syslog-ng-3.4.99

to /etc/portage/package.mask  and force a downgrade to the previous stable release
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-19 09:44:36 UTC
Confirmed. I downgraded immediately and didn't investigate, but yeah. :)
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2014-11-19 17:58:43 UTC
attach your emerge --info and /etc/syslog-ng/syslog-ng.conf file.
Comment 3 Ron OHara 2014-11-20 16:25:48 UTC
Created attachment 389904 [details]
syslog-ng.conf

As per earlier request.
Comment 4 Ron OHara 2014-11-20 16:26:38 UTC
Portage 2.2.14 (python 2.7.8-final-0, default/linux/x86/13.0, gcc-4.7.2-vanilla, glibc-2.20, 3.12.32-gentoo i686)
=================================================================
System uname: Linux-3.12.32-gentoo-i686-Intel-R-_Core-TM-_i5-3470_CPU_@_3.20GHz-with-gentoo-2.2
KiB Mem:     8198292 total,   4682676 free
KiB Swap:    8388604 total,   8388592 free
Timestamp of tree: Tue, 11 Nov 2014 00:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p30-r1
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r2
dev-lang/python:          2.7.8, 3.2.5-r2, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.6.3, 4.7.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.3-r2
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20
Repositories: gentoo bitcoin zugaina webapp-experimental x-portage
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/bitcoin /var/lib/layman/zugaina /usr/portage/local/layman/webapps-experimental /usr/local/portage"
SYNC="rsync://uk.sentuny.com/gentoo-portage"
USE="X accessibility arts bash-completion berkdb bzip2 cli consolekit cracklib crypt cups cxx dbus device-mapper dri examples extras fam fontconfig fortran gdbm git gnome gudev iconv idea imap ipv6 java jpeg keymap lm_sensors maildir modperl modules mysql ncurses nls nptl nsplugin odbc ogg opengl openmp pam pcre pdf php png pnp policykit postgres ptpax qt3support readline samba sasl session source ssl subversion tcpd udev unicode vhosts vorbis wmf x86 xattr xpm xtpaxsqlite zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fglrx fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2014-11-21 19:34:11 UTC
Try changing unix-stream("/dev/log" max-connections(256)); to system(); and see if that makes a difference.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-22 11:54:59 UTC
(In reply to Mr. Bones. from comment #5)
> Try changing unix-stream("/dev/log" max-connections(256)); to system(); and
> see if that makes a difference.

That seems to work (so far). Oddly enough syslog-ng then reads from the very same file </dev/log>.
Comment 7 Jaak Ristioja 2014-11-22 22:12:28 UTC
After upgrading to syslog-ng-3.6.1 it also consumed CPU, so I also had to downgrade. The strace for 3.6.1 showed something what appears to be a loop trying to open files from the non-existing /proc/0/ directory. In addition to system() and internal() also have lines similar to

    unix-dgram("/chroot/a/dev/log")
    unix-stream("/chroot/a/dev/log")

in my configuration.
Comment 8 Jaak Ristioja 2014-11-22 22:16:47 UTC
Created attachment 390082 [details]
Screenshot of syslog-ng-3.6.1 strace output.png
Comment 9 Marc Duponcheel 2014-11-29 14:58:40 UTC
(In reply to Mr. Bones. from comment #5)
> Try changing unix-stream("/dev/log" max-connections(256)); to system(); and
> see if that makes a difference.

system() is not accepted as I do not use systemd.
Comment 10 Jaak Ristioja 2014-11-29 16:03:32 UTC
(In reply to Marc Duponcheel from comment #9)
> (In reply to Mr. Bones. from comment #5)
> > Try changing unix-stream("/dev/log" max-connections(256)); to system(); and
> > see if that makes a difference.
> 
> system() is not accepted as I do not use systemd.

What do you mean? The system() driver is not systemd specific according to The syslog-ng Open Source Edition 3.6 Administrator Guide Section 6.11.
Comment 11 Mr. Bones. (RETIRED) gentoo-dev 2014-12-18 19:39:19 UTC
should be fixed in 3.6.2
Comment 12 Jaak Ristioja 2014-12-18 22:11:03 UTC
(In reply to Mr. Bones. from comment #11)
> should be fixed in 3.6.2

Can you also give a us a reference to what exactly fixed this in 3.6.2, please? Thanks!
Comment 13 Mr. Bones. (RETIRED) gentoo-dev 2014-12-18 22:29:50 UTC
from the NEWS.md file:

 * Fix spinning on EOF for `unix-stream()` sockets. Root cause of the spinning
   was that a unix-dgram socket was created even in case of unix-stream.