Ajax加载Socket.io服务器

Now Im using AJAX requests - 10 requests / second, everyone includes at least one connection to MySQL. So if there is ~100 people using my site - 1000 requests / second. Im thinking to use Socket.io. Ill use Setinterval every second to look for updates from MySQL and then send it to users. Is that better idea than using AJAX? I dont know if Im thinking correctly, but Socket.io should take much less server resources in that way I stated? Or there is better opinions?

You don't need to hit the database every N seconds to check for updates.

What you need is to have the client listen to the server and wait for updates to be sent.

I gave a presentation about this (I was using CakePHP and Node.js but I think the code will give you and idea). You can check my slides

And the repos are here and here