[Freeswitch-users] Socket Error [Too many open files]

Caio Assis caioebassis at hotmail.com
Thu Dec 8 15:58:02 MSK 2016


Actually, I solved my problem accessing the file /etc/systemd/system/multi-user.target.wants/freeswitch.service, adding this parameters:

TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/run/freeswitch
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007


Thanks.


________________________________
From: freeswitch-users-bounces at lists.freeswitch.org <freeswitch-users-bounces at lists.freeswitch.org> on behalf of Brian West <brian at freeswitch.org>
Sent: Tuesday, December 6, 2016 1:10 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Socket Error [Too many open files]

Depends on how your system is setup, Can you execute this at fs_cli:  system ulimit -a

On Tue, Dec 6, 2016 at 9:54 AM, Colin Morelli <colin.morelli at gmail.com<mailto:colin.morelli at gmail.com>> wrote:
When you say "I set the configuration below" - did you set this by executing the ulimit command or by editing /etc/security/limits.conf (or the equivalent for your distro)? IIRC the ulimit commands only change the limits for the current shell and its children. Depending on how FS is launched, it may very well not be a child of the current shell (or it's forking off as a different user), and as such those limits aren't applying.

You can run "cat /proc/FS_PID/limits" to see the actual limits imposed on the FS process(es)

Best,
Colin

On Tue, Dec 6, 2016 at 9:48 AM, Brian West <brian at freeswitch.org<mailto:brian at freeswitch.org>> wrote:
I can only guess you've done something or are using something that isn't closing the FD, Can you elaborate on what kinds of elements you have in your call flow?  Conference, files, lua or some other scripts that might access files?

/b


On Tue, Dec 6, 2016 at 9:44 AM, Caio Assis <caioebassis at hotmail.com<mailto:caioebassis at hotmail.com>> wrote:

Good afternoon.


Freeswitch info:

Freeswitch version: Version 1.6.12  64bit
O.S: Centos 7
Processor: Xeon Six Core
RAM: 8GB
Disk: SSD samsung 850 pro

I've been facing a problem with freeswitch.
When I generate many calls (around 300 calls), Freeswitch service stops receiving socket connection after this error:

[ERR] mod_event_socket.c:3017 Error initilizing connection
[CRIT] mod_event_socket.c:235 Stateful Listener 0 has expired
[ERR] mod_event_socket.c:2975 Socket Error [Too many open files]


I set the configuration below, but the problem persists and I have to restart the service to get it back up.

ulimit -c unlimited # The maximum size of core files created.
ulimit -d unlimited # The maximum size of a process's data segment.
ulimit -f unlimited # The maximum size of files created by the shell (default option)
ulimit -i unlimited # The maximum number of pending signals
ulimit -n 999999    # The maximum number of open file descriptors.
ulimit -q unlimited # The maximum POSIX message queue size
ulimit -u unlimited # The maximum number of processes available to a single user.
ulimit -v unlimited # The maximum amount of virtual memory available to the process.
ulimit -x unlimited # ???
ulimit -s 240         # The maximum stack size
ulimit -l unlimited # The maximum size that may be locked into memory.
ulimit -a           # All current limits are reported.


I can't execute any freeswitch command, fs_cli -x "show calls", fs_cli -r, they all return that socket error.


Thanks.

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Brian West
brian at freeswitch.org<mailto:brian at freeswitch.org>

[http://billing.freeswitch.org/templates/default/img/whmcslogo.png]

Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com (50% Discount using code FreeSwitch50)
http://www.freeswitchcookbook.com (50% Discount using code FreeSwitch50)
https://www.gofundme.com/freeswitch_ubuntu

Got Bugs? Report them here<https://freeswitch.org/jira>! | Reddit: /r/freeswitch<https://www.reddit.com/r/freeswitch>

T:+19184209001<tel:(918)%20420-9001> | F:+19184209002<tel:(918)%20420-9002> | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Brian West
brian at freeswitch.org<mailto:brian at freeswitch.org>

[http://billing.freeswitch.org/templates/default/img/whmcslogo.png]

Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com (50% Discount using code FreeSwitch50)
http://www.freeswitchcookbook.com (50% Discount using code FreeSwitch50)
https://www.gofundme.com/freeswitch_ubuntu

Got Bugs? Report them here<https://freeswitch.org/jira>! | Reddit: /r/freeswitch<https://www.reddit.com/r/freeswitch>

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20161208/51e20e62/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list