Hi,

the problem is not only with a power outage. You should think that if kannel crashes and you commented fflush out you will probably loss backtrace in log file. For a access log it's even more critical because you will loss messages that you sent.

It's up to you whether you will loss log or access log entries...

I would vote -1 for disabling fflush in general and +0 for disabling it at compile time (patch welcome).

Thanks,
Alex

Mindaugas wrote:

Just to note about gwlib/log.c:output() and gwlib/accesslog.c:alog()
functions which IMHO is a base for the whole logging and both of them
uses platform's standard version of vfprintf implementation which
sometimes is buggy, slow and so on.

Shall Kannel implement it's own implementation or maybe one defined at
compile time?


  I doubt that it will matter. Maybe Apache uses *printf functions for
serving
web pages so it's critical for them.

  But I did very simple test. I wrote tiny C program which just writes into
file
and in one case it fflush() file handle after each fprintf() and does not do
that
in another case. Difference is huge:

$ time ./fflush ( without fflush() )

real    0m5.649s
user    0m1.635s
sys     0m3.836s

$ time ./fflush ( with fflush() )

real    1m32.389s
user    0m5.569s
sys     1m23.935s

  So Stipe, Alexander - can I safely comment out fflush() after vfprintf? Or
have
configure or configuration file setting for that? :)
  As I've already said - I do not care if I'll loose few lines of log in a
power outage.

  Mindaugas





Reply via email to