[asterisk-dev] astdb->sync called too often slowing down the system

Stefan Schmidt sst at sil.at
Tue Aug 24 02:35:11 CDT 2010


Hello,

After some problems with my system i´ve done some investigation about 
the scheduler heap structure and also some ofter parts of the sip 
communication including registering peers.

In my investigation i´ve seen that on a slow system registering a peer 
(in handle_incoming in chan_sip.c) needs up to 40ms which is just a very 
long time.
after some time compares i´ve seen that calling astdb_put itself tooks 
this long.
In this function its the astdb->sync call which writes the astdb to the 
harddisk cause this time loss.

i´ve tried to just deactivite the astdb->sync in astdb_put and the 
system speeds up in many ways. Without this patch i couldn´t register 
2500 peers from another asterisk server at once, without loosing some of 
them (the get unreachable and retransmit are scheduled).

When i dont do the astdb->sync all 2500 peers register without loss, and 
also the qualify timeout is around 1 ms (without its around 5 ms or even 
worser). These 2 servers are connected directly on a single switch, so 
there is no network delay in between.

On a faster system there is no problem when i try to register more than 
2500 peers at once, but i think calling astdb->sync everytime slow down 
the system more than needed/usefull.

Is there a need why astdb_put allways calls astdb->sync or why the whole 
writing process isnt done in a own thread? astdb_put also do a mutex 
lock of the db so there couldnt be a locking problem.



best regards.

Steve Smith

-- 
Für weitere Fragen stehen wir gerne unter voip at sil.at oder
059944 - 2440 zur Verfügung.

Mit freundlichen Grüssen
-- 
Stefan Schmidt
Sysadmin/VOIP // voip at sil.at // Tel 059944-2440//
-------------------------------------------------
SILVER SERVER GmbH // Lorenz-Mandl-Gasse 33/1 //
A-1160 Wien // Fax 059944-9000 // www.sil.at  //
------------------------------------------------- 




More information about the asterisk-dev mailing list