This is not really a bug, but elogd was getting really slow with our
logbook. It took about 4 1/2 seconds just to get the default page in
threaded mode with 15 entries. The logbook has in total about 2000
entries, though.
After playing around with the compiler option '-gp' and gprof the
problem was found: loc() is called about 18000 times per logbook
access! (Attached you can find the gprof output. There might be
other places where to save time: e.g. getcfg().) The function loc()
calls stat every time to check if the language file was updated and
this takes a long time especially over NFS.
The quick solution for me was to just replace loc() with 'char
*loc(char *orig) {return orig;}'. Therefore, I cannot use the
localization that I used anymore, which is not a big problem at the
moment. After that the time to download the default page was only
0.16 s; almost a factor of 30 faster!
I would suggest to only read the language file (AND also the config
file!) once upon startup. After changing things one has to restart
elogd, which is not so nice, but the long delay is not acceptable.
Another option not to restart elogd is to make elogd respond to a
signal (e.g. kill -HUP) to reread the config and language files. |