We are experiencing a serious problem. Sometimes our game freezes for 10-20 seconds, sometimes for minutes, and sometimes SmartFox Server completely freezes and we need to restart our server. This issue started to happen like a week ago, so we don't think the reason is our server side extension, it was working fine till then. Also our concurrent user count didn't increase that much.
We are suspecting someone sends so many extension requests to our server, but we are not sure why is this happening. Is it possible to detect someone sending so many extension requests?
We are having a lot of threads like this in our thread dump when this issue occurs:
Code: Select all
"SocketWriter::TCP-2" Id=50 WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@44984796
at sun.misc.Unsafe.park(Native Method)
- waiting on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@44984796
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at com.smartfoxserver.bitswarm.core.SocketWriterV3$TCPWriteRunner.run(SocketWriterV3.java:818)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
For example, we had 44 threads like this in our thread dump, and VisualVM showed an error message saying there are deadlocks in our threads. But when we checked our thread dump, we didn't see anything odd except a lot of these AbstractQueuedSynchronizer threads.
We have a lot of game rooms with 5 players each. In our Java extension which players send request when they make a move (let's call it move.java), we are using synchronized(room). We are suspecting that's the reason of so many AbstractQueuedSynchronizer threads, but we still couldn't figure out why a deadlock happens.
Could increasing extension thread count help us on this issue (we know you don't encourage it)? We don't want to get rid of synchronized(room) here because we want to make sure every player makes their move one by one, in order.
Is there anything else to figure out the reason of these delays/freezes on our SmartFox Server?