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

Stefan Schmidt sst at sil.at
Sun Sep 5 16:52:36 CDT 2010


Am 05.09.2010 20:32, schrieb Stefan Schmidt:
> Hello list,
> 
> in my test scenario i have seen that astdb could be a problem in a heavy
> loaded system (for example 2000 sip peers). Atleast the real problem is
> the astdb->sync which is called on every astdb_put/delete or deltree call.
> 
> the problem is that syncing the astdb to the disk will needs minimum 2ms
> and up to 40 ms with an big amount of entries in the database. In this
> time no incoming package is read so this will cause some really bad
> things to the system like every peer get unreachable.
> 
> i have thought about 3 different solutions to make astdb perform better.
> this are just 3 ways which came to my mind, maybe there are much better
> ideas or solutions for this so please tell me.
> 

after reading some man pages and even more about fsync i see that my
understanding of fsync itself was not right. fsync doesnt write data to
the disk, it just make sure data has been out of the write buffer from
the system.
Data writing itself is allready very fast cause its just written in the
cache, only fsync waits until its on the disk.

there is still the question how to handle this situation?

atleast only solution 1 and 3 keeps as real solution to this problem.
the 2. wouldnt work cause astdb itself writes data to disk. fsync only
would wait for the data in cache but i dont think it could work over a
thread.

best regards

steve






More information about the asterisk-dev mailing list