Jump to content

Starting service slow


s.degtyarev

Recommended Posts

# ls -l ./snomONE-ctrl 
lrwxrwxrwx 1 root root 37 Jul 17  2012 ./snomONE-ctrl -> /usr/local/snomONE/pbxctrl.4.5.0.1090
#cat /etc/debian_version 
6.0.5
# uname -a
Linux snomeone 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux
# free
             total       used       free     shared    buffers     cached
Mem:       3924424    3813168     111256          0     255524    2595500
-/+ buffers/cache:     962144    2962280
Swap:      7910392        672    7909720
# cat /proc/cpuinfo |egrep 'processor|model name'
processor       : 0
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 1
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 2
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 3
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 4
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 5
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 6
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
processor       : 7
model name      : Intel(R) Xeon(R) CPU E31240 @ 3.30GHz
# ls /usr/local/snomONE/users|wc -l
279
Starting time between /etc/init.d/snomeone start and service accepting connection about 30 minutes.
During this time
- no logs created
- ioactivity of "snomONE-ctrl --dir /usr/local/snomONE/ --config /usr/local/snomONE/pbx.xml" is about 500 KB/s.
- CPU load low.
What should you recommend to check?

 

Link to comment
Share on other sites

That is indeed very long. Is there any other process on port 80? In Linux it can take a long time until the ports are available for exclusive binding. The PBX then can get into a try again and again cycle to get the ports. Workaround is to stop the process, wait for 60 seconds and then start the service again. The duration is in the Linux network configuration (tcp wait linger timeout or so).

 

We have solved that problem in 5.1 where the PBX tries to grab only the ports that have not been allocated successfully yet.

Link to comment
Share on other sites

I'm not sure if http port is free before starting. Will check next time when it's possible.

snomONE (with its web interface ) stopped with snomONE stop and it takes about 30-50 sec. Earlier it was enough to free http port.

Anyway no stop process, no restart process, even no server restart helps. The only solution is to wait.

I will try to strace process when it's possible.

Link to comment
Share on other sites

Yes you are right. That was ports state TIME_WAIT problem. If you try to start snomeone before ports free you will wait for a long time. You should wat for ports to close before snomeone starts. It take 1-2 minutes. Then snomone starts as usual.

 

Fast hack to init script for snomone 4 users:

1c1
< #! /bin/sh
---
> #! /bin/bash
97a98
> 
111a113,119
>       echo "Waiting for port to close"
>           while `nc -zv -w3 127.0.0.1 80 <<< ” &> /dev/null`
>               do
>               echo -ne "."
>               sleep 1
>               done
>               echo 'closed'
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...