[rsyslog] high-performance, low-precision time API under linux?

Aaron Wiebe epiphani at gmail.com
Mon Jun 15 19:19:49 CEST 2009


Greetings David,

On Mon, Jun 15, 2009 at 1:12 PM, <david at lang.hm> wrote:

>> gettimeofday() is one of the fastest syscalls you can issue.
>> Obviously you don't want to beat on it, but I wouldn't worry about
>> calling it a few dozen times per second.
>
> Aaron,
>
> rsyslog is able to recieve (not fully process, but recieve into the queue)
> over 300,000 messages/second from UDP without dropping any packets (256
> byte messages over gig ethernet), without maxing out the CPU on the thread
> recieving the messages. In the next week or so I hope to be able to do
> some tests with 10G ethernet ;-)
>
> with 4 microseconds per gettimeofday() call, you can only do 250,000
> gettimeofday() calls per second. just doing a single call per message will
> take more time than you have.

I never meant to suggest that doing a gettimeofday() on every received
message made sense.  My point was that a gettimeofday() call is a very
lightweight system call - one of the lightest.  Using a light system
call is of course no replacement for proper application design, and
Rainers' question was a valid one.  Unfortunately, there isn't much in
the way of changes to the system calls being used that would improve
the execution.  (Though dropping in gettimeofday() instead of time()
would probably be a good idea, since time() is documented as being
obsolete to gettimeofday().)

-Aaron



More information about the rsyslog mailing list