sfs2x websocket non-heap memory

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

zynbasil
Posts: 35
Joined: 23 May 2016, 03:59

sfs2x websocket non-heap memory

Postby zynbasil » 21 Nov 2018, 13:06

sfs2x: 2.13.4
ubuntu 18.04 with tcp bbr
online user: 3000

top check memory:
protocol compression threshold:1024000
10gb->50gb in 5 hours
protocol compression threshold:1024
10gb->50gb in 1 hours

jmap check memory:
always 10gb

Any suggest how to check non-heap memory?

Some error:
java.lang.NegativeArraySizeException at sfs2x.websocket.SFS2XWSService$WSChannelListener.onWebSocketBinary(SFS2XWSService.java:264) at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onBinaryMessage(JettyListenerEventDriver.java:82) at org.eclipse.jetty.websocket.common.message.SimpleBinaryMessage.messageComplete(SimpleBinaryMessage.java:68) at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:66) at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onBinaryFrame(JettyListenerEventDriver.java:68) at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:157) at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:376) at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:220) at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220) at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:679) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) at java.lang.Thread.run(Thread.java:745)

java.io.IOException: Cannot append to finished buffer at org.eclipse.jetty.websocket.common.message.SimpleBinaryMessage.appendFrame(SimpleBinaryMessage.java:48) at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:62) at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onBinaryFrame(JettyListenerEventDriver.java:68) at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:157) at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:376) at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:220) at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220) at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:679) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) at java.lang.Thread.run(Thread.java:745)
User avatar
Lapo
Site Admin
Posts: 21065
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: sfs2x websocket non-heap memory

Postby Lapo » 21 Nov 2018, 16:13

Hi,
I am not sure what you're asking here.
10gb->50gb in 5 hours

What is this supposed to mean?
50GB of RAM? If so what are the specs of your server and what settings are you using for the JVM running SFS2X?
Normally you don't need more than 4-8GB to run a heavily trafficked SFS2X. Using very large RAM settings might just worsen the performance (due to heavier GC work)

Also setting the protocol compression threshold to 1024000 seems to defeat the purpose of compression entirely, as I would not expect a multiplayer game to send updates of 1MB+.
The default value ensures a better network usage, but you're free to disable it via higher values if you have your good reasons.

Any suggest how to check non-heap memory?

The only non-heap space that comes to mind in SFS2X is metaspace, i.e. the area of memory where classes are loaded by class loaders.
You can monitor that with VisualVM, a free JVM monitor: https://visualvm.github.io/

As regards the other errors, can you gives some context? Are these errors reproducible? Do you know of any specific trigger? Are they particularly frequent? Do your clients lament specific issues related with those exceptions?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DerikFent and 15 guests