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

Russell Bryant russell at digium.com
Tue Sep 7 14:09:17 CDT 2010



> On 2010-09-07 14:03:45, schmidts wrote:
> > i had allready test this yesterday but i think you havent read it then ;)
> > 
> > i have written a plain app for db testing (is there a place i can post this?). just put 1000 different entries into astdb and save the usec how long every put takes and also the sum of this 1000 calls.
> > plain 1.6.2:
> > Writing Entry to Astdb tooks 39966 usec
> > Writing Entry to Astdb tooks 19832 usec
> > ....
> > Writing Entry to Astdb tooks 5905 usec
> > Writing Entry to Astdb tooks 5927 usec
> > Writing 1000 Entries to Astdb tooks 10796565 usec (yes thats 10 sec)
> > 
> > as expacted russels patch has one fast cycle and the next would take long time:
> > russellb patch:
> > .....
> > Writing Entry to Astdb tooks 19 usec
> > Writing Entry to Astdb tooks 5766 usec
> > Writing Entry to Astdb tooks 20 usec
> > Writing Entry to Astdb tooks 5814 usec
> > Writing 1000 Entries to Astdb tooks 3754780 usec (3,7 sec)
> > 
> > 
> > using the appleraisin patch olle johansson has written with a mysql db brings this result:
> > 
> > ...
> > Writing Entry to Astdb tooks 2077 usec
> > Writing 1000 Entries to Astdb tooks 2067042 usec (2,0 sec and every write cycle tooks around 2ms)
> > 
> > and thats my target :D
> > 
> > without syncing at all
> > Writing Entry to Astdb tooks 19 usec
> > Writing Entry to Astdb tooks 18 usec
> > Writing 1000 Entries to Astdb tooks 21925 usec (0,021 sec)
> > 
> > i think if its possible to split up the db functions into a frontend (put,del,deltree ...) handle a linklist or something to a second threat which will do the real astdb writting, syncing and so or atleast write it to a realtime db like oej patch we could bring it to a value of lower than 1 sec for 1k entries.

Sorry, I didn't see your comments about this testing if you posted them earlier.  Also, note that this patch is different than the one we were discussing on IRC yesterday.  It sounds like your results are for the patch I did yesterday?


- Russell


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


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