Home > Back-end >  Remote Websocket server performance
Remote Websocket server performance

Time:05-20

I have created a php websocket server, and a php websocket client, the websocket client communicate with the server using JSON format, each message means an operation to handle by the websocket server. when running both the client and the server in localhost I can reach about 35 operations/sconds, and the same results when running both client and websocket server on the production server, but running client in locahost (my machine) with production websocket server (remote) that only results in 5 operations/seconds.

What could be the reason behind that bad performance when using remote websocket server?

CodePudding user response:

Solved by changing websocket client app logic (sending messages asynchronously instead of synchronously), by using that approach we have increased the score to more than 100 operations/s. Credits to Jérôme Richard (See the question comments)

  • Related