[asterisk-dev] [Code Review] Rate limit astdb->sync() calls

Russell Bryant russell at digium.com
Wed Sep 8 10:30:06 CDT 2010



> On 2010-09-08 01:33:58, schmidts wrote:
> > my testdb app runned for atleast 220 mins cause a normal int to overflow several times with that big amount of usecs.
> > this would mean with russels patch writing and deleting 1mio entries into astdb tooks 26 sec. without the patch it tooks around 13200 sec :D
> > 
> > to really compare we could use this values but that was only 10k not 1000k entries:
> > TESTDB RESULT: Overall Time: 134782000 us
> > Writing 10000 Entries to Astdb tooks 66881569 usec
> > Deleting 10000 Entries from Astdb tooks 67882280 usec
> > WRITE: 	 avg time: 6688.000000 usec	 max time: 135060 usec	 min time: 10 usec 	 longer than min+10us: 0 	 min+100us: 10000
> > DEL: 	 avg time: 6788.000000 usec	 max time: 342044 usec	 min time: 10 usec 	 longer than min+10us: 0 	 min+100us: 10000
> > 
> > even with only 10k entries its much slower than with the patch writing 1mio of entries.
> > 
> > i would say very good work! Thank you much russell!

Thanks for the feedback.

So what do others think?  Rate limiting fsync() calls to twice a second gives a half second window of operations that will be lost in the case of a system crash.  Is that acceptable for the sake of a significant performance gain?  I think it is.  I just want to make sure others agree.


- Russell


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/825/#review2697
-----------------------------------------------------------


On 2010-09-07 13:43:48, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/825/
> -----------------------------------------------------------
> 
> (Updated 2010-09-07 13:43:48)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> There has been a discussion going on about astdb performance on the -dev list.  This patch implements rate limiting on astdb->sync() executions.  It will ensure that it will not get called any more often than twice a second.  It is being posted here so that it can be tested to see if it makes a difference in the test scenario.
> 
> 
> Diffs
> -----
> 
>   /branches/1.6.2/main/db.c 285234 
> 
> Diff: https://reviewboard.asterisk.org/r/825/diff
> 
> 
> Testing
> -------
> 
> I have not tested this.  I'm posting it here in hopes that Stefan Schmidt will be able to test this and compare it against the results he got before.
> 
> 
> Thanks,
> 
> Russell
> 
>




More information about the asterisk-dev mailing list