Optimisation fix
Loiseleur Michel
mloiseleur at linagora.com
Fri Jun 23 18:48:55 CEST 2006
Hello,
My company has deployed for a French company a nagios system for
supervising over 600 computers. It was definetely too slow for an
acceptable use (~5 minutes for displaying cgis).
I have profiled the c code of nagios using gprof and find the guilty :
xdata/xodtemplate.c : xodtemplate_service *xodtemplate_find_service(char
*name) {...}
I have corrected the guilty and found a factor 5 in speed of nagios
cgis' (ie : 5 times faster for about 5 lines changed in the code).
Please feel free to use the patch, test it and correct it to your
convenience. You can see the profiling before and after the patch in the
attached files. It was originally made against nagios 1.2, but I have
ported it against your cvs version of this day.
I use a ghashmap of the "glib", but any other well-implemented
hashmap can be convenient. In order to test it easily and see the speed
improvements, you have to modify the Makefile in xdata subdirectory,
after the ./configure execution.
Add `pkg-config --cflags glib-2.0` to $CFLAGS and `pkg-config --libs
glib-2.0` to $LDFLAGS. You'll need to install the glib-devel package too.
After that, try to display any of the cgis... it 's amazing !
--
Loiseleur Michel - TM2L (08000LINUX)
Open Source Software Assurance
LINAGORA
27, rue de Berri
1er étage
75008 PARIS
Tél : 01 58 18 68 28
Fax : 01 58 18 68 29
"Si hoc legere scis nimium eruditionis habes"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-2.4-optimization.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060623/53d8b9ec/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gprof_after.log
Type: text/x-log
Size: 17186 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060623/53d8b9ec/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gprof_before.log
Type: text/x-log
Size: 17194 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060623/53d8b9ec/attachment-0002.bin>
-------------- next part --------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel
More information about the Developers
mailing list