Klaus Darilion 写道:
(fixed subject)

Hi!

I have configured openser 1.2 to only listen to udp:

Starting Open SIP Router:
Listening on
             udp: 1.2.3.4 [1.2.3.4]:5060
Aliases:
             *: mydomain.at:*


$ openser-1.2-SVN/scripts/openserctl ps
Process::  ID=0 PID=29582 Type=attendant
Process::  ID=1 PID=29583 Type=receiver child=0 sock= 1.2.3.4:5060
Process::  ID=2 PID=29585 Type=receiver child=1 sock= 1.2.3.4:5060
Process::  ID=3 PID=29586 Type=receiver child=2 sock= 1.2.3.4:5060
Process::  ID=4 PID=29587 Type=receiver child=3 sock= 1.2.3.4:5060
Process::  ID=5 PID=29588 Type=receiver child=4 sock= 1.2.3.4:5060
Process::  ID=6 PID=29589 Type=receiver child=5 sock= 1.2.3.4:5060
Process::  ID=7 PID=29590 Type=receiver child=6 sock= 1.2.3.4:5060
Process::  ID=8 PID=29591 Type=receiver child=7 sock= 1.2.3.4:5060
Process::  ID=9 PID=29592 Type=timer
Process::  ID=10 PID=29593 Type=tcp receiver
Process::  ID=11 PID=29594 Type=tcp receiver
Process::  ID=12 PID=29595 Type=tcp receiver
Process::  ID=13 PID=29596 Type=tcp receiver
Process::  ID=14 PID=29597 Type=tcp receiver
Process::  ID=15 PID=29598 Type=tcp receiver
Process::  ID=16 PID=29599 Type=tcp receiver
Process::  ID=17 PID=29600 Type=tcp receiver
Process::  ID=18 PID=29601 Type=tcp main process

So, where does all the "tcp receiver" come from? If they are DB related maybe we should change the "Type".

>From output of "openserctl ps", I know your openser server is configure in mode
      * fork=yes
      * children=8

Both udp and tcp receiver process is forked to handle SIP messge. You can disable TCP using flag "tcp_disable=yes". Because openser default support tcp link. So you can see tcp receiver though you config "listen=udp: 1.2.3.4:5060".  For detailed information
  1. read source code  main.c  main_loop routine and other source files
  2. refer http://www.openser.org/dokuwiki/doku.php/core-cookbook:1.2.x

This proxy uses mysql for presence - this I guess all the TCP connections are for presence. But why do I have 19 mysql connections?

$ netstat -anp|grep openser
tcp   0 0 1.2.3.4:48896    1.2.3.68:3306     ESTABLISHED 29598/openser
tcp   0 0 1.2.3.4:48897    1.2.3.68:3306     ESTABLISHED 29599/openser
tcp   0 0 1.2.3.4:48898    1.2.3.68:3306     ESTABLISHED 29600/openser
tcp   0 0 1.2.3.4:48899    1.2.3.68:3306     ESTABLISHED 29601/openser
tcp   0 0 1.2.3.4:48900    1.2.3.68:3306     ESTABLISHED 29582/openser
tcp   0 0 1.2.3.4:48889    1.2.3.68:3306     ESTABLISHED 29591/openser
tcp   0 0 1.2.3.4:48888    1.2.3.68:3306     ESTABLISHED 29590/openser
tcp   0 0 1.2.3.4:48891    1.2.3.68:3306     ESTABLISHED 29593/openser
tcp   0 0 1.2.3.4:48890    1.2.3.68:3306     ESTABLISHED 29592/openser
tcp   0 0 1.2.3.4:48893    1.2.3.68:3306     ESTABLISHED 29595/openser
tcp   0 0 1.2.3.4:48892    1.2.3.68:3306     ESTABLISHED 29594/openser
tcp   0 0 1.2.3.4:48895    1.2.3.68:3306     ESTABLISHED 29597/openser
tcp   0 0 1.2.3.4:48894    1.2.3.68:3306     ESTABLISHED 29596/openser
tcp   0 0 1.2.3.4:48883    1.2.3.68:3306     ESTABLISHED 29585/openser
tcp   0 0 1.2.3.4:48882    1.2.3.68:3306     ESTABLISHED 29583/openser
tcp   0 0 1.2.3.4:48885    1.2.3.68:3306     ESTABLISHED 29587/openser
tcp   0 0 1.2.3.4:48884    1.2.3.68:3306     ESTABLISHED 29586/openser
tcp   0 0 1.2.3.4:48887    1.2.3.68:3306     ESTABLISHED 29589/openser
tcp   0 0 1.2.3.4:48886    1.2.3.68:3306     ESTABLISHED 29588/openser
udp   0 0 1.2.3.4:5060     0.0.0.0:*                     29582/openser


Thus, why 19 DB connections for 8 UDP childrens?
I guest one  mysql connection for each process. Here you have  8+1 udp process, 8+1 tcp process, 1 timer process, sum them up,you get 19 connection. Am I right?

Regards,
Chen Xueqin