I’m trying to stress test a XMPP server using smack. Two questions:
I need to have more than 20k concurrent users on the server but my testing infra-structure only goes up to 4k before it stops logging in the users. I was monitoring memory usage and noticed that in this case the memory usage was a little over 80% so I’m guessing smack might be using too much memory.
Every time I need to login with a new user what I do is:
ConnectionConfiguration config = new ConnectionConfiguration(SERVER);
this.connection = new XMPPTCPConnection(config);
Presence presence = new Presence(Presence.Type.available);
this.chatManager = ChatManager.getInstanceFor(connection);
All of these ‘users’ are stored in a Java Map. I can’t discard them because I need these users to be concurrent users so if I delete them the connection will be closed and the user disconnected. My worry is that this might be using too much memory (not sure yet but I decided to tackle this first). My questions are, is there any way to keep a user logged-in using smack without having to use all this overhead? Has anyone been able to get concurrent users to a really high number (e.g. 20k+)? Is it possible to optimize the memory usage in any way here?
One more unrelated question, has anyone gotten this error:
WARNING: Connection closed with error
stream:error (conflict) text: Replaced by new connection
I realize this happens because I want to re-login with a subscriber without making him log-out (i.e. I don’t .disconnect() before calling .login() again on the same subscriber - this is to simulate a network outage). The problem is that this exception is cluttering my output so I have to redirect stderr. I haven’t been able to override the exception as well. Anyone have any ideas on how to stop this exception?