1

Our system has 3 components Agent side chat application, a server, and players chat. Agents and players connect to the server via a web-socket connection.

We have made a chat application for the agents that run on the browser. We have used plain javascript, html5, CSS to build this application. The UI has a few sections, for instance, a scrolling box where they can see all the players, a tab box that holds the players whom an agent is talking to, a chat box to text to players, etc.

When an agent clicks on any of the players from the list, the player moves to the tab box, where the agent can chat with the player.

At any given point in time, there are around 500 to 700 players online connecting from gaming websites and around 20 agents connecting from the agent chat application. And the agent can hold up to 32 players simultaneously.

After the agent logs into the chat application, a web-socket connection is established with the server and all the communication happens over it. Such as:

  • Receives the list of all the players online
  • A player going offline
  • A player coming online
  • Agent picking up player etc.

All the communication to the server happens on a single web-socket connection.

Now coming to the problem, the agents complain (usually when the players are a little more than usual) that the UI feels very sluggish, scrolling becomes slow, clicking on the player does not respond for more than 10-15 seconds, all the actions becomes very slow. In normal circumstances, it's very smooth.

My investigation so far:

  • I tried to monitor its memory consumption, When the agent chat application is launched on the browser it takes around 50MB, and over time I have seen it reach close to 1GB, that's when things were getting very slow. However, I have seen getting sluggish when the occupancy is around 500MB too.
  • I checked for RAM on the agent's machine, which was around 32, I felt it was sufficient, compared to what was needed for the application.
  • I am investigating why is the memory consumption getting so high, and how can I limit it.
  • I am trying to run the application with "disable cache" check to see if the performance gets better (still checking).
  • I have also tried to repeatedly pick and drop players without messaging, but that hardly caused any memory spike.

Can someone help me with any idea on to solve this problem?

0 Answers0