2
votes

I am testing ejabberd performance in a straightforward scenario: Connect/Auth to one ejabberd server with two clients, database is in another machine. Most of the Ejabberd modules are closed. My target for concorrent connections is 500k. When connection count is less than 10k, new created connections per second is 1000+; when connection count is between 100~160k, TPS is 400+; when the count is more than 400k, TPS drops down to 100-. See the chart.

The CPU usage is about 70~95% during the testing.

How can I improve the performance? Including increasing TPS when load is high and reducing CPU usage.

System: CPU: 6 cores, 12 threads Memory: 32GB Network: LAN

Ejabberd: Version: 14.05
Erlang: R16B03
build configure: ./configure --enable-nif --enable-odbc --enable-mysql --enable-pam --enable-zlib --enable-stun --enable-json --enable-iconv --enable-debug --enable-json --enable-smp-support

MAX_PROCESSESS: 15000000
MAX_PORTS: 5000000

TPS drops down quickly when load goes up

1

1 Answers

0
votes

Optimisation of XMPP servers performance, including ejabberd, is highly dependant on the use case. You really need to find your bottleneck by monitoring the process queues and finding out what is your limiting factor, and move to the next one.

I also recommend making sure you run the latest ejabberd. Each new release comes with a bunch of optimisation and a specific bottleneck you are facing may have gone away in the latest version.

To give you an idea ejabberd 15.07 is 2 to 3 times more efficient in memory, latency and CPU compared to ejabberd 2.1 that is only three years away.

You should also make sure that you are also using the latest Erlang version. Each release of Erlang comes with more optimisation regarding locks, especially on SMP server, and using the latest Erlang version can also help tremendously.