<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Marcel Mitsuto Fucatu Sugano wrote:<br>
<blockquote cite="mid1128555158.11266.32.camel@localhost" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="GENERATOR" content="GtkHTML/3.6.2">
Hi nagios-user list,<br>
  <br>
I don't know how to begin this question, because i can't imagine how
much use of the nagios web-interface is made by the people who read
this list. But here we use nagios to actively check something around
10k services now, and up to 2300 hosts. Lately we upgrade our
monitoring pool of machines, setting up a distributed framework to
agregate all warnings at one unique webserver. So far, this new
framework is doing its job, but sometimes, we get around 15 people
connected to the nagios web-interface, and the status.cgi is taking too
much time to load. So here is my question: <br>
"Is there any ./configure options, or any set of CFLAGS to improve
performance of the cgis?" Here's a snipet from top:<br>
  <br>
</blockquote>
[snip]<br>
<br>
<blockquote cite="mid1128555158.11266.32.camel@localhost" type="cite">Finally,
the machine that's serving the interface is getting passive messages
from the active monitoring agents and is a Pentium4 HT-SMP processor,
with 2GB memory, SATA HDD, running SuSE9.3 with kernel 2.6.11-8-SMP.<br>
</blockquote>
<br>
Yeah, there are some CFLAGS you could be using to optmise your build..
I am assuming that you have a recent version of GCC, and that your P4
HT cpu is shown as having two logical CPU's<br>
<br>
Try rebuilding with the following command:<br>
<br>
cd  nagios-2.0b4<br>
CC=gcc CFLAGS="-mtune=i686 -O3 -pipe -march=i686 -funroll-loops
-ffast-math" \<br>
    ./configure --prefix=/usr/local/nagios ...... [rest of nagios
configure commands]<br>
<br>
The main problem is that you have thousands of hosts, and thousands of
services to read in every time you run status.cgi.   No matter how
efficient the program is, reading in and displaying that much data is
going to take a while, and running the same program 15 times
simultaneously is going to affect your performance as you see here. How
many lines is the status.dat file?  I only have a few hundred hosts and
services, and the file is 23,000 lines or so, half a meg on disk.. I
would imagine yours is closer to about 50mb and closer to a million
lines.<br>
<br>
Some alternatives might be updating the Nagios sidebar so that it
doesn't display ALL hosts by default, maybe just a smaller hostgroup..
(although i suspect the status.cgi needs to read in the whole file) Or
replacing the standard nagios CGI's with something that is more geared
towards handling hundreds of thousands of hosts/services... <br>
<br>
Or perhaps you could have a separate display server, a webserver
running the cgi's which reads in the nagios status.dat file over the
network from the nagios server, and does all the processing away from
the nagios collector.. This would move processing off of the nagios
collector.. You could use rsync to keep the two files in sync, keep a
duplicate on the display server on a local disk (or a tmpfs memory
based filesystem for extra speed)...<br>
<br>
Hope this helps<br>
rob.<br>
<br>
</body>
</html>