Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 772 of 806  Not logged in ELOG logo
ID Date Icon Author Author Email Categorydown OS ELOG Version Subject
  427   Fri Sep 5 17:19:11 2003 Reply Stefan Rittstefan.ritt@psi.chBug fixLinux2.3.9.Re: problem with boolean attributes
> Boolean attributes were not displayed correctly in version 2.3.9.
> Patch is attached.

Yes, implemented, thank you.
  450   Wed Nov 12 12:25:44 2003 Warning Heiko Scheith.scheit@mpi-hd.mpg.deBug fixLinux2.3.9speed 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.
  451   Wed Nov 12 12:34:02 2003 Reply Stefan Rittstefan.ritt@psi.chBug fixLinux2.3.9Re: speed is very slow if logbook contains many entries
This is a very nice measurement you made and helps me a lot. I will 
incorporte your suggestions into the next version. Under Windows however, 
there is no -HUP signal, so that won't work for them. But what I can easily 
do is to check for new configuration/language file once every access, not 
once every loc() or getcfg(). I till think about.

Thanks again,

  Stefan
  455   Thu Nov 20 17:55:57 2003 Reply Stefan Rittstefan.ritt@psi.chBug fixLinux2.3.9Re: speed is very slow if logbook contains many entries
I implemented the new scheme where 

- under Windows, the configuration is only checked once every access

- under Unix, the configuration is read initially, and on every -HUP signal

This should speed up the server considerably. The next bottleneck is the 
rsputs2() function, which requires quite some computing power in order to find 
any "http://", "//", etc. strings in every output. If anybody knows a 
more clever way of coding that, please let me know.

The new version is under CVS.
  457   Mon Nov 24 10:25:10 2003 Entry Etienne Van Caillieetienne.vancaillie@mba.beBug fixLinux2.3.9Re: speed is very slow if logbook contains many entries
> I implemented the new scheme where 
> 
> - under Windows, the configuration is only checked once every access
> 
> - under Unix, the configuration is read initially, and on every -HUP signal
> 
> This should speed up the server considerably. The next bottleneck is the 
> rsputs2() function, which requires quite some computing power in order to find 
> any "http://", "//", etc. strings in every output. If anybody knows a 
> more clever way of coding that, please let me know.
> 
> The new version is under CVS.

may be use the logic in the 'format' attribute
like 'email', http, ftp 
so elog will test only on these attributes
  619   Tue Jul 27 18:33:52 2004 Warning Fred Hooperfhooper@sushisoft.comBug fixLinux2.5.3speeding up elog : gcc compile optimizations
Elog is a great program, but it can be slow.

I noticed that the gcc compiler options in the tarball Makefile were not
conducive to speed.  There, I tried changing the gcc options to:

CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -W -Wall

for version 2.5.3, the compile worked, and the program appears to work as
normal, but a bit faster.   I have not benchmarked it, but I think it should
offer a nominal increase in speed.

In particular, I removed the "-g" profiling option, which is not needed for
production code, and can be safely removed. In addition, I put in slightly
aggressive optimization settings, so if this doesn't work for you, you can
first try removing the -f setting, and then backing off the optimization to -O2.

Other may want to post other settings that work for them.
  622   Wed Jul 28 15:03:17 2004 Warning Stefan Rittstefan.ritt@psi.chBug fixLinux2.5.3Re: speeding up elog : gcc compile optimizations
> I noticed that the gcc compiler options in the tarball Makefile were not
> conducive to speed.  There, I tried changing the gcc options to:
> 
> CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -W -Wall

Thank your for this hint, I changed my Makefile for the production code. However, I
could not feel any difference between the two options. The real problem is the
function getcfg(), which gets called many thousand times internally and has to parse
elogd.cfg each time. Once I implement a hash table for that function, elogd should
become faster by at least a factor of two.
  640   Sat Jul 31 16:55:21 2004 Warning Fred Hooperfhooper@sushisoft.comBug fixLinux2.5.3Re: speeding up elog : gcc compile optimizations
> > I noticed that the gcc compiler options in the tarball Makefile were not
> > conducive to speed.  There, I tried changing the gcc options to:
> > 
> > CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -W -Wall
> 
> Thank your for this hint, I changed my Makefile for the production code. However, I
> could not feel any difference between the two options. The real problem is the
> function getcfg(), which gets called many thousand times internally and has to parse
> elogd.cfg each time. Once I implement a hash table for that function, elogd should
> become faster by at least a factor of two.

Yeah - What's up with that?

I have seen this discussed before - Seems like it should be a priority to get this
fixed, as doing a hash table is straightforward, and the speed increase should be pretty
health - there are several c libraries available - check out "man 3 hsearch" for the
POSIX hash table management that already available.  Other c library searches that you
could use include bsearch (binary tree), tsearch (tree searching), btree (b+ tree). 
However, the easiest and most obvious one to use for elog appears to be a simple hash
table search (hsearch).

Is there something else  which is making this difficult to do?
ELOG V3.1.5-3fb85fa6