Project

General

Profile

Too many elements in the user roster.. Warning

Hamid Alimohammadi
Added almost 4 years ago

Hi,

Could you please help to find what may cause a repetitive Warning that I get in tigase-console.log file?

The Tigase test server's version is "7.0.0-SNAPSHOT-b3699" and the following Warning in console.log file occurs 315 times:


2015-04-13 16:12:52.462 [presence Queue Worker 3] Presence.process() WARNING: Error accessing database for presence data: {0}

tigase.db.TigaseDBException: Too many elements in the user roster.

    at tigase.xmpp.impl.roster.RosterFlat.addBuddy(RosterFlat.java:186)

    at tigase.xmpp.impl.Presence.processOutSubscribe(Presence.java:1731)

    at tigase.xmpp.impl.Presence.process(Presence.java:529)

    at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2864)

    at tigase.util.WorkerThread.run(WorkerThread.java:132)

The init.properties file is:

config-type=--gen-config-def

--admins=admin@test.com

--virt-hosts=test.com

--vhost-anonymous-enabled = false

--user-db-uri=jdbc:mysql://10.10.10.75/tigasedb?user=tigase&password=tigase12

--user-db=mysql

--cluster-mode=false

--debug=server,db,archive

--monitoring=jmx:9050,http:9080,snmp:9060

--sm-plugins=+message-archive-xep-0136,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,-jabber:iq:register,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+amp,-msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,-zlib,+jabber:iq:last

--amp-security-level=NONE

--comp-class-6=tigase.archive.MessageArchiveComponent

message-archive/archive-repo-uri=jdbc:mysql://10.10.10.75/tigasedb?user=tigase&password=tigase12

--message-archive/auto=true

c2s/watchdog_delay[L]=60000

c2s/watchdog_timeout[L]=40000

c2s/watchdog_ping_type=xmpp

c2s/max-inactivity-time[L]=100

sess-man/plugins-conf/message-archive-xep-0136/required-store-method=body

sess-man/plugins-conf/message-archive-xep-0136/component-jid=message-archive@test.com

c2s/processors[s]=urn:xmpp:sm:3

muc/default_room_config/muc#roomconfig_persistentroom=true

muc/default_room_config/muc#roomconfig_publicroom=false

muc/default_room_config/muc#roomconfig_membersonly=true

muc/default_room_config/muc#roomconfig_changesubject=true

muc/default_room_config/muc#maxhistoryfetch=500

muc/default_room_config/muc#roomconfig_roomname=Group

muc/muc-allow-chat-states[B]=true

--comp-class-1=tigase.muc.MUCComponent

--comp-name-6=message-archive

--comp-name-1=muc

Thank you in advance


Replies (4)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 4 years ago

Apparently user's roster exceeded the maximum allowed size on your installation. The exception is thrown when there is an attempt to add a new contact to a roster when the roster is already at maximum size.

The roster maximum size is a dynamic value which depends on the memory available to the Tigase XMPP Server software. Here is the algorithm we use to calculate the maximum roster size:

private static int maxRosterSize = new Long(Runtime.getRuntime().maxMemory() / 250000L).intValue();

A solution to you would be to calculate the maximum size on your installation and ensure that you really require rosters with a bigger size. (maybe it is kind of a DOS attack on your service?)

If you really require large rosters on your system then you can increase amount of memory available to the Tigase server on your installation.

Added by Hamid Alimohammadi almost 4 years ago

Thank you Artur for the reply.

After reading your comment, I adjusted the memory in tigase.conf and the Warnings disappeared.

I used the following Linux command to get Heap memory parameters in the test server:

java -XX:+PrintFlagsFinal -version | grep HeapSize

I looked for the options MaxHeapSize (for -Xmx) and InitialHeapSize for -Xms

Added by Igor Khomenko about 3 years ago

Artur, is it possible to limit the max size of roster, for example via init.properties?

I just run the following code on my local machine with 8GB RAM onboard:

int maxRosterSize         = new Long(Runtime.getRuntime().maxMemory() /250000L).intValue();
System.out.println("maxRosterSize: " + maxRosterSize);

and got 7635.

It's too big for one user and potentially a possible vulnerability for the server.

I see the following problems:

1) It will be hard to serialise/deserialize such a big roster for server

2) load for DB.

3) it's hard for client to load such a big roster - traffic issue

would be great to have a possibility to limit it via config. For example set it to 100 or something like that

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Thank you for suggestion - I've created #3849 and added you as a watcher.

    (1-4/4)