2012/4/19 Chris McCraw <[email protected]>:
> I am thrilled to do testing and can even do some in production, but
> I'm not sure how to be sure no messages are dropped.  Any suggestions
> for trackable high-load-generation?  I've been using logger and/or nc
> in a loop from the command line to log "# rather long message..."
> where # increases sequentially to be sure no messages were dropped,
> but the production log stream is just a bunch of http requests and I
> don't have any gauge of when one doesn't make it through, so
> real-world testing might not be informative.

I use a simple Python script for generating many log messages:

$ cat stresslogger.py
#!/usr/bin/env python
import syslog, sys
syslog.openlog()
for i in xrange(int(sys.argv[1])):
  syslog.syslog("This is a stress test log")

The C variant of if was my first C program :D. Here it goes:
$ cat stresslogger.c
#include <syslog.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
    openlog ("exampleprog", LOG_PID, LOG_LOCAL5);
    int max;
    max=atoi(argv[1]);
    int i;
    for (i = 0; i < max; i++)
    {
        syslog (LOG_INFO, "This is a stress test log");
    }
    closelog ();
    return 0;
}

Then I use "time" to have a rough check on the performance. And you
can check if you lost a log by just counting them. Send 1M messages,
and if you started with an empty log file, "wc -l" should return 1M.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards

Reply via email to