On Mon, 15 Jun 2009, Aaron Wiebe wrote:

> I went over your post...
>
> You shouldn't be seeing a 4ms response time on a gettimeofday() call -
> this is my test:
>
> gettimeofday({1245079355, 445434}, NULL) = 0 <0.000004>
> gettimeofday({1245079355, 445503}, NULL) = 0 <0.000004>
> gettimeofday({1245079355, 445560}, NULL) = 0 <0.000003>
> gettimeofday({1245079355, 445629}, NULL) = 0 <0.000004>
>
> That's 3-4 microseconds.
>
> For the sake of argument, I checked time() as well, which is obsoleted
> by gettimeofday()...
>
> ime(NULL)                              = 1245079501 <0.000008>
> time(NULL)                              = 1245079501 <0.000007>
> time(NULL)                              = 1245079501 <0.000004>
> time(NULL)                              = 1245079501 <0.000008>
> time(NULL)                              = 1245079501 <0.000004>
>
> About half the speed, but still in the microsecond range.
>
> 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.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to