[asterisk-dev] How to improve astdb? Any ideas?

Russell Bryant russell at digium.com
Tue Sep 7 13:37:34 CDT 2010


On Mon, 2010-09-06 at 09:10 -0400, Mark Murawski wrote:
> Spawn an astdb put worker thread. (Same goes for using any database 
> backend) Writers will dump their changes to a linked list and return 
> immediately.  The writer will write whenever it gets a chance.  if there 
> are big or small slowdowns in fsync it wont affect any running threads.  
> And if you lose power, well... you would have lost the unwritten data 
> anyway because you would have been waiting on it anyway.

That would work if the vast majority of operations were writes.
However, there are probably more of an even number of reads and writes
to astdb.  Even if you queue up the writes, the readers are going to
have to wait until all of the writes that came before are done before
the read operation can be executed, resulting in an even worse slowdown
on reads, even though the writes are (probably) faster.

-- 
Russell Bryant
Digium, Inc.  |  Engineering Manager, Open Source Software
445 Jan Davis Drive NW   -    Huntsville, AL 35806  -  USA
jabber: rbryant at digium.com    -=-    skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org





More information about the asterisk-dev mailing list