Hi all,
using sipsak in usrloc mode to test the SER sip REGISTRAR with the following process : loop: ./sipsak -U -p host.foo.com -x 3600 -a passwd -s sip:user@foo.com goto loop
I get the following mesg in LOG file after 2 mins : build_contact(): No memory left ... and after a while : ERROR: build_res_buf_from_sip_req: out of memory ; needs 28132 send_reply(): Error while sending 200 OK ... CRITICAL ERROR : Can't save Contact to MySQL Location DB (this is a log mesg in my ser.cfg in case : if (!save("location")) ) ERROR: sl_reply_error used: I'm terribly sorry, server error occurred (1/SL)
although it seems that SER keeps going (?) to write in Location DB both SER's & MySQL (this seems strange).
I have IBM eServer 336 x 2 : - 2 dual core Intel Xeon 3.6 GHz with 2MB Cache, EMT64 - 4 GB RAM - 2x72GB Ultra 320 Scsi disks
# ser.cfg children=5
Could this be a memory leak problem in SER ? Is there any conf fine-tuning I can do in order to avoid that ? When I increase the 'children' up to 20, the problem happens again but within 5 mins.
thanks for any help, Kostas
Hi!
Kostas Marneris wrote:
I get the following mesg in LOG file after 2 mins : build_contact(): No memory left ...
How many users do you have in the in-memory database at that point? serctl moni should show that.
This might be just related to lack of (shared) memory SER is allowed to use. Check sip_router/config.h and increase the shared memory size (if you are using shared memory at all; default) if possible. Remember to set ulimit to allow the memory to be allocated.
SER can also debug memory allocations but before enabling debugging check serctl fifo meminfo (probably graph it) and see if it decreases when your registrations expire.
CRITICAL ERROR : Can't save Contact to MySQL Location DB
I cannot find that string inside the source. Could it be a message raised using xlog() from inside ser.cfg?
Cheers, Hendrik
P.S. removed CC to the sipsak list.
Hendrik Scholz wrote:
Hi!
Kostas Marneris wrote:
I get the following mesg in LOG file after 2 mins : build_contact(): No memory left ...
How many users do you have in the in-memory database at that point? serctl moni should show that.
At that point in memory DB I have ~282 User Location entries. Although in serctl moni I have only : UsrLoc Stats Domain Registered Expired 'location' 19 1
This is probably because I use the following command in a loop: ./sipsak -U -p host.foo.com -x 3600 -a passwd -s sip:user@foo.com so SER keeps registering the same user 'user' and creates a different entry (different Contact) for each REGISTER request.
./serctl ul show | grep ^Contact ... Contact : 'sip:user@127.0.0.1:40630' Contact : 'sip:user@127.0.0.1:40629' Contact : 'sip:user@127.0.0.1:40628' Contact : 'sip:user@127.0.0.1:40627' ...
MySQL DB shows 282 rows in 'select * from location' at that time.
This might be just related to lack of (shared) memory SER is allowed to use. Check sip_router/config.h and increase the shared memory size (if you are using shared memory at all; default) if possible. Remember to set ulimit to allow the memory to be allocated.
My sip_router/config.h file :
/*used if SH_MEM is defined*/ #define SHM_MEM_SIZE 32
SER can also debug memory allocations but before enabling debugging check serctl fifo meminfo (probably graph it) and see if it decreases when your registrations expire.
CRITICAL ERROR : Can't save Contact to MySQL Location DB
I cannot find that string inside the source. Could it be a message raised using xlog() from inside ser.cfg?
Yes, this is a xlog() mesg from ser.cfg.
Cheers, Hendrik
I suspect that the "problem" comes from the fact that while SER receives REGISTER requests from the same user 'user@foo.com' but from different port (actually different Contact), then in '200 Ok' Reply it tries to maintain the 'Contact' header which keeps growing in each '200 Ok' reply mesg. At some point SER seems that cannot build the 'Contact' header field..
Although this seems not to be a 'real-word' situation, I try to understand how can I prevent it .
thanks Kostas