MyBB Community Forums

Full Version: Ajax Chat eats server resources
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hei!

As many of you know Ajax chat plugin (i have 0.8.6) uses lot of server CPU.
Is there anything I can do in config or similar files that makes its bit more tolerable for chat users. 
Perhaps I can make it send some queries or something less ofthen to server.
I used to have an integrated MyBB ajax chat. It uses a lot of CPU because it's including global.php in every single request. If you aren't aware, ajax chats basically work by having the client (your web browser) send requests to the server periodically (2 seconds by default), checking for new messages. A standalone ajax chat requires only a single small query during that request. As a result, PHP/MySQL isn't really much of a drag as far as performance in a standalone configuration. (Apache, on the other hand, can be more of a drag. I've found more success not using apache for the server software. On my little ajax chat host, I use nginx instead of Apache for that reason. However, my little chat room host has to be able to handle hundreds of chat rooms. One standalone chat should not pose those kinds of issues. Toungue )

Anyway, as you can imagine, the difference between one small single query for ajax chat, and 10+ MyBB related queries has a bit of a gap in the performance. I never figured out a way around it that wasn't complicated, but to be honest, I never really gave it a whole lot of effort. My forum doesn't really have an active chat room, so I never bothered too much with it. Either way, if you really like ajax chat specifically, going standalone instead of using integrated versions will be the easiest way to really solve the performance issues without getting complicated about it.
It makes no difference if i use it with pagemanager or not. It shouldn use global.php, if I direct people to forum/chat page or what?
Resource deficiency appears as sudden spikes wher I/O and entry processes are higher. In any other time resource usage is far from critical. And when chat is disabled, then there no problems.