public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Syslog-ng using a spectacular amount of CPU time... (I'm using sshguard)
Date: Mon, 23 Mar 2009 21:43:43 +0200	[thread overview]
Message-ID: <200903232143.44117.alan.mckinnon@gmail.com> (raw)
In-Reply-To: <49C7E293.9040705@shic.co.uk>

On Monday 23 March 2009 21:27:15 Steve wrote:
> Steve wrote:
> >> destination sshguardproc {
> >>     program("/usr/local/sbin/sshguard"
> >>         template("$DATE $FULLHOST $MESSAGE\n"));
> >>     };
>
> The presence of the above line is definitely what triggers the excessive
> CPU usage - it is almost as-if syslog-ng is 'busy-waiting' for the
> sshguard process.  The sshguard process is running - but using zero CPU.
>
> I have this problem with syslog-ng versions 2.1.3 and 2.1.4 (the one
> with ~x86)...
>
> This is very frustrating... having played around, the syslog-ng tends
> towards using 100% CPU when my server is otherwise quiet - if, and only
> if, I have the program destination... even if the destination is not used.

One word:

blocking

I find this is usually the cause for higher than normal CPU load as reported 
by top and other tools. If the load is pegged at exactly 100%, it's almost a 
sure sign that some process is IO blocking on an idle system, and all the 
process is doing is checking if IO is available, see it isn't, goes to sleep, 
wakes up, rinse and repeat.

In short: top lies, and load does not mean what most people think it means. 
The correct definition is "average number of processes that are waiting for 
cpu time within the measurement period." 

-- 
alan dot mckinnon at gmail dot com



  parent reply	other threads:[~2009-03-23 19:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 15:38 [gentoo-user] Syslog-ng using a spectacular amount of CPU time... (I'm using sshguard) Steve
2009-03-23 19:27 ` Steve
2009-03-23 19:31   ` Steve
2009-03-23 19:49     ` Steve
2009-03-23 21:13       ` Paul Hartman
2009-03-23 19:43   ` Alan McKinnon [this message]
2009-03-23 19:55     ` Steve
2009-03-23 19:48   ` Sebastian Günther
2009-03-23 19:55     ` Steve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200903232143.44117.alan.mckinnon@gmail.com \
    --to=alan.mckinnon@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox