Subscribers offline and publish interval

shir Hu
Added almost 4 years ago


Try to get the subscribers and publish interval on linux , hardware configuration is 2 cpu and 4G memeroy, tigase.conf set jvm mem to be min 1G and max 3G, and have config tigase for linux high load system, then test case follow:

1>Node with 1000 offline subscribers and publish interval 10s, No publish time out

2>Node with 2000 offline subscribers and publish interval 10s, About 90 items sended ,occur publish time out

I think 1000 subscribers is to small, At running time ,the usage percent of cpu and mem are not high, So may be it is not hardware configuration cause this , Can you tell me if there is other config for pubsub or upgrade hardware or add interval?

Replies (5)


Added by Wojciech Kapcia TigaseTeam almost 4 years ago

If there is not high memory usage on CPU or memory then please check Tigase server statistics for metrics, mostly average processing time and so forth. If the usage of the Tigase is low, then most likely database may be a bottleneck.

Added by shir Hu almost 4 years ago

I checked tigase server statistics, found that The pressure comes from session manager queues tigase.xmpp.impl.OfflineMessages.savePacketForOffLineUser(), then I try to upgrade mysql config:

        1. add repo-pool-size to 50
        2. upgrade mysql server config params

the result comes a little better, but still can't handle 10,000 offline users success. If I comment savePacketForOffLineUser(), it worked well. So get the conclusion: the write speed for mysql is too slow. Can you tell me if there is a way to solve the problem or add cache(such as redis, datagrid) between application to mysql ?

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

As you rightfully concluded the Database is the bottleneck. Your first test failed at 2000 subscribers and message every 10s, which generates roughly 200 packets per second (and that many saved messages being saved to database).

What is your database configuration? Is it on the same machine? Have you tried tuning MySQL, e.g.: MySQL settings ?


Added by shir Hu almost 4 years ago

My database configuration is :

key_buffer = 64M
max_allowed_packet = 32M
sort_buffer_size = 64M
net_buffer_length = 64K
read_buffer_size = 16M
read_rnd_buffer_size = 16M
thread_stack = 192K
thread_cache_size = 8
query_cache_limit = 10M
query_cache_size = 64M
innodb_file_per_table = 1
innodb_buffer_pool_size = 2000M
innodb_additional_mem_pool_size = 100M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_file_size = 52M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 0
innodb_lock_wait_timeout = 50
innodb_thread_concurrency = 16

Tigase and mysql on the same machine, and repo-pool-size is:

--user-repo-pool-size = 50
--data-repo-pool-size = 50

It doesn't work well with 10,000 offline subscribers ,Is there any problem about this configuration?


Added by Artur Hefczyc TigaseTeam almost 4 years ago

In this use-case scenario the database will always be a problem and a bottleneck. You can optimize and adjust settings but there will always be a hard limit on how much you can push to the DB, especially that what you do is essentially a lot of write requests, so this is simply a matter of an I/O bottleneck.

I suggest you configure your system to avoid storing PubSub notifications for offline users. You can do this by either disabling offline messages plugin or configure PubSub to send notifications only to online users.