Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   speed is very slow if logbook contains many entries, posted by Heiko Scheit on Wed Nov 12 12:25:44 2003 gmon.txt
    icon2.gif   Re: speed is very slow if logbook contains many entries, posted by Stefan Ritt on Wed Nov 12 12:34:02 2003 
       icon2.gif   Re: speed is very slow if logbook contains many entries, posted by Stefan Ritt on Thu Nov 20 17:55:57 2003 
          icon1.gif   Re: speed is very slow if logbook contains many entries, posted by Etienne Van Caillie on Mon Nov 24 10:25:10 2003 
Message ID: 450     Entry time: Wed Nov 12 12:25:44 2003     Reply to this: 451
Icon: Warning  Author: Heiko Scheit  Author Email: h.scheit@mpi-hd.mpg.de 
Category: Bug fix  OS: Linux  ELOG Version: 2.3.9 
Subject: speed is very slow if logbook contains many entries 
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.
Attachment 1: gmon.txt  36 kB  | Show | Show all
ELOG V3.1.5-fe60aaf