Hi, This is in reponse to the request for an alternative logger-- some of this code could probably be adapted for that job without too much fuss. This stuff is tested on Solaris7/8 and AIX4.3.3, but probably not too hard to get to work for other platforms. In any case.. In order to performance-test a syslog-ng installation and compare with vendor syslogd's, I wrote a simple set of three programs. One is the main log message generator (which uses the syslog.h API to log locally), one is a "master" synchronization control, and one gathers the results. These are each little single-sourcefile programs. They're pretty primitive, so don't expect the greatest in command line processing and user interface, but could be useful for setting up, testing, and performance profiling. The main log message generator "syslogtest.c" takes a facility and level, number of repetitions, a sleep interval, and a "server mode" flag on the command line. It locally logs the specified number of messages (like logger, but with with preset content) at the given priority with a sequence number, sleeping the given number of microseconds between each. After logging the battery of messages, the running time for the battery is also logged (and output to the terminal along with PID). In "server mode" it listens to a preset TCP port for a connection from the master synchronization control. The master control "master.c" reads "./servers" for a flat list of hostnames to connect with. Each host runs an instance of "syslogtest" in "server mode". Once connected, the user can give a simple "go" signal or "exit" signal. When the given the "go" signal, each server sends the volley of syslog messages specified on its command line, forks (just to change the reported PID), and waits for another signal. When given "stop" all servers exit. Consider when each host's syslog daemon is configured to send to a common loghost. This lets you recruit a number of synchronized remote hosts to either flood syslog-ng (or syslogd) and measure message loss, or (by using the microsecond sleeping) simulate the intended server load. The last program is a perl script, "results," which takes as arguments a logfile name, a PID, and a number of trials. It reads the logfile, scanning for lines by the given PID, and tracking the sequence numbers to determine which are missing, and reports the results. After running a test trial, this is run at each syslogtest host to determine how many were lost locally (e.g. in AIX's datagram /dev/log socket), and then on the common loghost to determine which ones never made it over the network or were dropped by syslog-ng. You can use this to help you tune output fifo sizes under particular loads, or to determine the maximum reasonable capacity of your loghost. Oh, yeah-- if you invoke the syslogtest.c program as "lasttest" then it omits the sequence numbers. This generates "last message repeated..." output from vendor syslogd's (and was used to develop the patch submitted previously). -- Jonathan Marks Systems Administrator, Production Systems Group Computing and Communication Services Office University of Illinois at Urbana-Champaign
This is in reponse to the request for an alternative logger-- some of this code could probably be adapted for that job without too much fuss. This stuff is tested on Solaris7/8 and AIX4.3.3, but probably not too hard to get to work for other platforms. In any case..
could you send us some numbers? (messages lost, etc?) -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
participants (2)
-
Balazs Scheidler
-
Jon Marks