I noticed that freeswitch seems to be using a very large amount of CPU on my system. Doesn't seem to be hurting anything (other than wasting system resources), but some of it's threads are probably stuck in a loop or something.

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14738 sipxchan  15   0 54960  39m 4596 S 189.2  2.0  16691:17 freeswitch

In threads mode (H), top shows multiple ones using much CPU

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 764 sipxchan  25   0 54864  39m 4596 R 49.3  2.0   4045:07 freeswitch
1172 sipxchan  25   0 54864  39m 4596 R 49.0  2.0   4023:10 freeswitch
23876 sipxchan  25   0 54864  39m 4596 R 34.2  2.0   2839:47 freeswitch
22365 sipxchan  25   0 54864  39m 4596 R 32.9  2.0   2924:20 freeswitch
23720 sipxchan  25   0 54864  39m 4596 R 32.9  2.0   2860:36 freeswitch
27115 root      15   0  2588 1364  804 R  1.3  0.1   0:00.29 top
26906 cstdenis  15   0 10144 1596 1040 S  0.3  0.1   0:00.30 sshd
   1 root      15   0  2064  636  548 S  0.0  0.0   0:00.52 init

Here is the back trace of one of them using a lot of CPU (pid 23720 above)
----
# gdb /usr/local/freeswitch/bin/freeswitch 23720

/<snip copyright, etc.>/

Attaching to program: /usr/local/freeswitch/bin/freeswitch, process 23720

warning: process 23720 is a cloned process

/<snip symbol loading>/

Reading symbols from /lib/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb7f85710 (LWP 14738)]
[New Thread 0xb712ab90 (LWP 23878)]
[New Thread 0xb722db90 (LWP 23876)]
[New Thread 0xb6d39b90 (LWP 23721)]
[New Thread 0xb6f4ab90 (LWP 23720)]
[New Thread 0xb6536b90 (LWP 22367)]
[New Thread 0xb6639b90 (LWP 22365)]
[New Thread 0xb63f6b90 (LWP 1173)]
[New Thread 0xb64f9b90 (LWP 1172)]
[New Thread 0xb6f87b90 (LWP 766)]
[New Thread 0xb708ab90 (LWP 764)]
[New Thread 0xb726ab90 (LWP 15336)]
[New Thread 0xb72a7b90 (LWP 15335)]
[New Thread 0xb72e4b90 (LWP 15334)]
[New Thread 0xb7321b90 (LWP 15333)]
[New Thread 0xb784db90 (LWP 15313)]
[New Thread 0xb78f9b90 (LWP 14769)]
[New Thread 0xb78bcb90 (LWP 14768)]
[New Thread 0xb7936b90 (LWP 14764)]
[New Thread 0xb79d7b90 (LWP 14763)]
[New Thread 0xb7a14b90 (LWP 14761)]
[New Thread 0xb7b17b90 (LWP 14756)]
[New Thread 0xb7b54b90 (LWP 14755)]
[New Thread 0xb7b91b90 (LWP 14754)]
[New Thread 0xb7bceb90 (LWP 14753)]
[New Thread 0xb7f20b90 (LWP 14747)]
Loaded symbols for /lib/libpthread.so.0
/
<snip symbol loading>/

0x00b84519 in __pthread_mutex_unlock_usercnt () from /lib/libpthread.so.0
(gdb) bt
#0 0x00b84519 in __pthread_mutex_unlock_usercnt () from /lib/libpthread.so.0
#1  0x00b848c0 in pthread_mutex_unlock () from /lib/libpthread.so.0
#2 0x00de0c80 in apr_thread_mutex_unlock (mutex=0xb6b14628) at locks/unix/thread_mutex.c:121 #3 0x00d640bd in switch_mutex_unlock (lock=0xb6b14628) at src/switch_apr.c:294 #4 0x00d816dd in switch_core_session_read_frame (session=0xb6b0e020, frame=0xb6f48ef4, flags=0, stream_id=0) at src/switch_core_io.c:159 #5 0x00dbba26 in switch_ivr_park (session=0xb6b0e020, args=0x0) at src/switch_ivr.c:697 #6 0x009657ed in socket_function (session=0xb6b0e020, data=0xb6b146d8 "69.31.174.100:8084 async") at mod_event_socket.c:427 #7 0x00d7c544 in switch_core_session_exec (session=0xb6b0e020, application_interface=0x87fb230, arg=0xb6b146d8 "69.31.174.100:8084 async") at src/switch_core_session.c:1342 #8 0x00d7ca1e in switch_core_session_execute_application (session=0xb6b0e020, app=0xb6b146d0 "socket", arg=0xb6b146d8 "69.31.174.100:8084 async") at src/switch_core_session.c:1264 #9 0x00d7ec92 in switch_core_session_run (session=0xb6b0e020) at src/switch_core_state_machine.c:155 #10 0x00d7c005 in switch_core_session_thread (thread=0xb6b144d0, obj=0xb6b0e020) at src/switch_core_session.c:950 #11 0x00de7006 in dummy_worker (opaque=0xb6b144d0) at threadproc/unix/thread.c:138
#12 0x00b8149b in start_thread () from /lib/libpthread.so.0
#13 0x00ad842e in clone () from /lib/libc.so.6


A backtrace of another process (22365) is similar

#0  0x00b83303 in pthread_mutex_lock () from /lib/libpthread.so.0
#1 0x00de0cf0 in apr_thread_mutex_lock (mutex=0xb6a39dd0) at locks/unix/thread_mutex.c:92 #2 0x00d640ed in switch_mutex_lock (lock=0xb6a39dd0) at src/switch_apr.c:289 #3 0x00d81654 in switch_core_session_read_frame (session=0xb6a337f8, frame=0xb6637ef4, flags=0, stream_id=0) at src/switch_core_io.c:122 #4 0x00dbba26 in switch_ivr_park (session=0xb6a337f8, args=0x0) at src/switch_ivr.c:697 #5 0x009657ed in socket_function (session=0xb6a337f8, data=0xb6a39e80 "69.31.174.100:8084 async") at mod_event_socket.c:427 #6 0x00d7c544 in switch_core_session_exec (session=0xb6a337f8, application_interface=0x87fb230, arg=0xb6a39e80 "69.31.174.100:8084 async") at src/switch_core_session.c:1342 #7 0x00d7ca1e in switch_core_session_execute_application (session=0xb6a337f8, app=0xb6a39e78 "socket", arg=0xb6a39e80 "69.31.174.100:8084 async") at src/switch_core_session.c:1264 #8 0x00d7ec92 in switch_core_session_run (session=0xb6a337f8) at src/switch_core_state_machine.c:155 #9 0x00d7c005 in switch_core_session_thread (thread=0xb6a39c78, obj=0xb6a337f8) at src/switch_core_session.c:950 #10 0x00de7006 in dummy_worker (opaque=0xb6a39c78) at threadproc/unix/thread.c:138
#11 0x00b8149b in start_thread () from /lib/libpthread.so.0
#12 0x00ad842e in clone () from /lib/libc.so.6

_______________________________________________
sipx-dev mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
sipXecs IP PBX -- http://www.sipfoundry.org/

Reply via email to