[ejabberd] postgres + testing

Matthew Nourse matthew_nourse at hotmail.com
Fri Feb 25 04:36:21 MSK 2005

Mickael Remond wrote:
>Your behaviour is very strange.

Yes ;-).

>What is your erlang/otp version ?

I'm using the Debian package from the Sarge (testing) distribution.  The 
Debian version number is 1:9.2.2-6 but I don't know how this relates to 
erlang/otp releases.  The output from erl -version is

p4test:~# erl -version
Erlang (THREADS,HIPE) (BEAM) emulator version

>What is your OS ? I suppose it is freeBSD as your are using the +K flag.

It's Debian Linux (Sarge/testing distribution) with a 2.6 kernel...

p4test:~# uname -a
Linux p4test 2.6.8-1-386 #1 Thu Nov 11 12:18:43 EST 2004 i686 GNU/Linux

>By default the number of process is 32768 and your are not likely to reach 
>it with the number of connected users your are using.
>We did some benchmarking with Jonathan Bresler with Tsunami. We did not 
>change the default number of process. We only increased the number of port 
>to 32000 as this is a ressource you can exaust quickly during a benchmark.
>We manage to reach 7000 simultaneous users exchanging messages without any 
>We did not push the test any further because we run out of time and I had 
>to present the result during my talk at the Erlang User Conference.
>So your problem is strange. Did you had the same behaviour without the +K 
>parameter (We did not use it) ?

I agree that the problem is strange :-).  Unfortunately it's just got a bit 
stranger ;-)...I wrote a small test program to try to test this out further 
but I can't get more than 1000 simultaneous connections with this test 
program.  I tried the test program with a variety of ERL_OPTIONS settings, 
including with and without the +K option.

Now, when ejabberd stops accepting connections I get this message in the 
ejabberd.log (I wasn't getting this message before):

=INFO REPORT==== 2005-02-25 08:45:05 ===
I(<0.6683.0>:ejabberd_c2s:295): (#Port<0.4879>) Accepted legacy 
authentification for testuser1005 at p4test/Smack

=INFO REPORT==== 2005-02-25 08:45:05 ===
I(<0.3599.0>:ejabberd_listener:103): (#Port<0.2796>) Failed TCP accept: 

=ERROR REPORT==== 2005-02-25 08:45:43 ===
Mnesia(ejabberd at localhost): ** ERROR ** (could not write core file: emfile)
** FATAL ** Cannot open log file "/var/lib/ejabberd/PREVIOUS.LOG": 

=INFO REPORT==== 2005-02-25 08:45:43 ===
    application: mnesia
    exited: shutdown
    type: temporary

There is plenty of disk space available on that machine.

In all cases, ejabberd stops accepting connections to port 5222 when the 
maximum number of users is reached....even telnet localhost 5222 fails to 
open a connection.

When the maximum number of users is reached, netstat -a reports that there 
are about 1040 sockets in ESTABLISHED or TIME_WAIT mode.

Sometimes (but not always) I can't open a connection with telnet localhost 
5222 even after the test program has finished, all connections are closed 
and netstat -a reports that there are <50 sockets in use.  When this happens 
I must restart ejabberd before I can log in.

Should I try using LDAP to store the roster?

If anyone is interested in trying out the test program, get it from
[It's a _very_ basic program with no luxuries ;-)]

To run it, I recommend this command line:
java -Xmx512m -Xss128k -cp smack.jar;smackx.jar;. JabberMultiUserTest 
[jabberserver] 5222 2000

>You will find some information on our benchmark in the following document:

Thanks, this looks great!

>It contains data regarding the machine and some graph on the server 
>As a side note, regarding your benchmark tool: Are you sure you can 
>simulate this number of simultaneous connections with smack ? I have 
>previous experience with Java benchmark HTTP tool and threading limitation 
>make it almost unless as long as we were reaching 200 simultaneous 
>connections. With Java-based injection tool our problem obviously came from 
>the injection tool.

I agree that smack is not built for scalability...apparently the developers 
are working on that now.  I couldn't find a scalable reliable client library 
in C, C++ or Java with documentation I could understand...what do others 
use?  I like smack because it seems to work well (except for scalability) 
and is well documented.

My application does not require much stack space so I use java's -Xss 
argument to set the stack size to only 128k.

I have tried running my test program on the same machine and on different 
machines to eliminate the possibility that smack was interfering with 
ejabberd.  I think that smack is successfully creating the connections 
because these messages appear in ejabberd.log:

=INFO REPORT==== 2005-02-25 08:45:05 ===
I(<0.6683.0>:ejabberd_c2s:295): (#Port<0.4879>) Accepted legacy 
authentification for testuser1005 at user.bluepulse.com/Smack

>Your problem is different as the behaviour you describe is different with 
>the same injection tool however.
>Thank you for your feedback !

You're most welcome, thanks very much for your fast response to my post.


More information about the ejabberd mailing list