Erlang Mailing Lists

Author Message

<  Erlang  ~  MAX TCP connections

narcissus
Posted: Wed Nov 28, 2007 6:40 am Reply with quote
Joined: 28 Nov 2007 Posts: 2
Hi All,
I am running an erlang program to connect to an ejabberd server on a local IP using a gen_tcp behaviour. Both the machines run on Linux Debian. The problem is that upon exceeding 1000 odd connections to the ejabberd server I get the following error:-
***************************
=ERROR REPORT==== 27-Nov-2007::16:52:53 ===
E(<0.7232.0>:ltc:319): Connection error [emfile]

** Reason for termination =
** emfile
** exited: emfile **

=INFO REPORT==== 27-Nov-2007::16:52:53 ===
I(<0.5209.0>:ltc:694): *****SOCKET CLOSED*****
***************************

I have set all the relevant parameters in the configuration script for ejabberd server as below:-
*************************
# To use more than 1024 connections, you will need to set environment variable ERL_M$
export ERL_MAX_PORTS=50000

# Maximum Number of Erlang Processes
export P=25000

# Kernel Polling: +K true
export K=true
*************************
Also I have started the erlang emulator (from where) the connections are being made to the ejabberd server with parameters like "erl -s ejabberd -env ERL_MAX_PORTS 5000 +P 250000"
Q1) How can I get around this limitation ?
Q2) Is this a limitiation of the OS / erlang / ejabberd?


Any help in this regard will be appreciated..
cheers!
View user's profile Send private message
nem
Posted: Thu Nov 29, 2007 12:25 pm Reply with quote
User Joined: 29 Nov 2007 Posts: 25
Hi there - I recently ran into this one while doing load testing with tsung.

Under recent debian distros there's a per process limit of 1024 file handles (and you need a file handle to open a tcp socket). (ulimit -n # the nofile limit).

I'm guessing ejabberd is running as some non-root user. You need to edit /etc/security/limits.conf and add a line like:

Code:

ejabberduser    -    nofile    65535


Which is roughly "Set the hard and soft nofile limits to 65535 descriptors for processes run by 'ejabberduser'".

The limits.conf file should have a number of comments describing how to tune the example above.

Cheers,
--nem
View user's profile Send private message
narcissus
Posted: Fri Nov 30, 2007 12:03 pm Reply with quote
Joined: 28 Nov 2007 Posts: 2
hi there,
I am running the ejabberd as root. so is it still required to set the limit in "/etc/security/limits.conf" ??
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum