[ejabberd] Performances issues with ejabberd+LDAP+PostgreSQL

Holger Weiß holger at zedat.fu-berlin.de
Mon May 13 12:40:11 MSK 2019


* pitchum <pitchum at gramaton.org> [2019-05-13 10:06]:
> Le 10/05/2019 à 11:58, pitchum a écrit :
> > my ejabberd 18.12 from Debian stretch-backports server has performances
> > issues since yesterday, when the amount of connected users went from 10
> > to 250+
> > We will migrate the VM from 2 VCPUs to 4 VCPUs at lunch time but I'm not
> > sure that it will solve the issues with PostgreSQL and LDAP.
> > Attached here is an extract of error messages found in ejabberd.log
> > showing SQL timeouts.
> > 
> > I have a lot of questions but I'll start with this simple one: would you
> > recommend using PostgreSQL as default_db on a production server or would
> > you use mnesia as default_db and sql only for some modules (like MAM)?
> 
> I've reverted to "default_db=mnesia" and only mod_mam has db_type=sql.
> The VM now has 8 VCPUs and it's not enough. All CPUs reached 100% load.

250+ users sounds like a very harmless number, you shouldn't usually
need much CPU power to handle those.  Even with (way) more users, the
available RAM and the I/O performance will be more interesting.  As both
PostgreSQL (in your previous log snippets) and Mnesia (in your new logs)
are reported to be overloaded, I'd assume some issue with your I/O
performance and/or something triggering heavy load on the database.

As a start, I'd suggest switching everything back to PostgreSQL and
tuning the SQL performance (PostgreSQL's default settings are very
conservative); see, for example:

https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server

Holger


More information about the ejabberd mailing list