We have been using Twisted Python TCP socket server with the mysql db for more that 6 months now.We are facing the issue that our chat module is lagging when 4-5 clients are connecting to the server and tried to use the app for chatting. and sometimes our chat server stops responding completely. I mean no requests are sent and nobody can see the posts which they have posted. After sometime it's like all the responses just send at once and the client got 6-7 or more posts at a time.We have a logic also behind the every posts.
How to handle this lag?..