hplog - A High-Performance Logger
hplog - A High-Performance Logger
The hplog contains a high-performance logger interface.
Features:
- Separate logger process so no log lines get lost on application crash
- Buffered read and writes to increase performance
- Automatically rotating logs with configurable number of backlogs
- Configurable log size
- up-to-date logfile (in spite of buffering)
Other interesting things:
- Uses 6 systems calls in underload situations per log line
- 1 send() in the application
- 1 nonblocking recv() in the log process
- 1 select() in the log process
- 1 recv() in the log process
- 1 time() in the log process
- 1 write() (called from fflush()) in the log process
- Uses LESS systems calls in overload situations per log line
- 1 send in the application
- the kernel buffers several log lines into one chunk recevied by recv()
for each chunk:
- 1 recv()
(select() and second recv() is optimized away)
- 1 time()
- <1 write()
(is buffered into 32K chunks)
Compilation / use
Compile hplogd.cc as a separate application
Put it somewhere in your path
Include hplog.cc in your normal application. If it is multithreaded make sure that you compile hplog.cc with -D_REENTRANT
Download
-rw-r--r-- 1 8451 102 2961 Jul 22 2000 hplog-1.1.tar.gz
-rw-r--r-- 1 8451 102 2915 Aug 20 2000 hplog-1.2.tar.gz
-rw-r--r-- 1 8451 102 3094 Oct 29 2000 hplog-1.3.tar.gz
-rw-r--r-- 1 root root 3100 Apr 28 2001 hplog-1.4.tar.gz
-rw-r--r-- 1 8451 102 2766 Apr 5 2000 hplog.tar.gz
-rw-r--r-- 1 8451 102 1273 Aug 20 2000 readme.txt