Project

General

Profile

PubSub: Poor performance with lots of offline users.

Bill Hoo
Added almost 4 years ago

Hi there,

I'm new to PubSub stuff, and get poor performance on one of my test case with tigase-server-7.0.1-b3810.

  1. 10K users subscribed 'test-node-1'

  2. Only two users('user1' 'user2') are online, all of the rest are offline.

  3. 'user1' publish a message to 'test-node-1'.

What I expected is that 'user2' receives this msg almost in realtime,

but actually it takes too long, almost 15~25 seconds.

And when I check the database(MySQL), the content of table 'msg_history' is

incremented a lot, and its speed is about 100records/sec, does it slow down the whole server?

BTW, --debug mode was commented out.


init.propertise:


config-type=--gen-config-def

--admins=admin@192.168.1.100

--virt-hosts = 192.168.1.100

#--debug=server,xmpp.impl,c2s,db

--comp-name-3 = pubsub

--comp-class-3 = tigase.pubsub.PubSubComponent

#--comp-class-3 =tigase.pubsub.cluster.PubSubComponentClustered

#--comp-name-4 = message-archive

#--comp-class-4 = tigase.archive.MessageArchiveComponent

--user-db = mysql

--user-db-uri = jdbc:mysql://localhost:3306/tigasedb?user=username&password=pwd

--new-connections-throttling = 5222:8192

--cm-traffic-throttling = xmpp:0:0:disc,bin:0:0:disc

--user-repo-pool-size = 25

--max-queue-size = 1000000


tigase.conf:


OSGI=${osgiEnabled}

ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"

DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"

#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks"

#EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA"

#JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0"

JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

CLASSPATH=""

JAVA_OPTIONS="${GC} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -XX:+UseLargePages -XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=4 -server -d64 -Xms10G -Xmx10G -XX:PermSize=64m -XX:MaxPermSize=512m "

TIGASE_CONFIG="etc/tigase.xml"

TIGASE_OPTIONS=" --property-file etc/init.properties "


Replies (2)

Added by Bill Hoo almost 4 years ago

After searching in Tigase docs, I find this optimization on MySQL database [[http://docs.tigase.org/tigase-server/7.0.0/Administration_Guide/html/#_other_mysql_setting_worth_considering]].

And it really worked, the performance is good now, same test case, there's just 1~2 seconds delay before 'user2' receives the msg.

Later I'll increments the test users to 100K~500K, see if the poor performance back again.

Thanks the Tigase team.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 4 years ago

This is generally expected.

If you send thousands of messages to offline users and you have offline message archive enabled, then all messages go to the database to wait until users are back online. In such a case only the database is the bottleneck. If your database can store 10k records in 1 second than delays will be minimal.

Another way to avoid performance problems in such a case is to either make the PubSub to send notifications only to online subscribers or disable offline storage for messages. This way you avoid any database traffic and message delivery would be instant to online users.

    (1-2/2)