I am planning on writing a small browser game.

The webserver is a shared server, with no root / install possible.

I want to use AJAX for client/server communication. There will be 12 players.

So each player would be polling the server for the current game status every X milliseconds (let's say 200ms). So that would be 200ms x 12 players x 5 = 60 requests per second

Can Apache handle those requests?

What might be the bottlenecks when using this attempt?

  • \$\begingroup\$ Thanks. This question helped me a lot understanding about Websockets. \$\endgroup\$ Commented Apr 8, 2013 at 12:50

1 Answer 1


Apache can certainly handle the requests, but you will want to do some careful planning to ensure that things work as expected.

In order to handle such a high rate of requests with minimal latency, clients MUST be using HTTP keepalives. Keepalives are sometimes disabled in web servers.

You will also want to be very careful on the client-side to not issue a new request if the previous one is still pending. You might also want to disregard a response if it took too long.

If your game requires this request rate, it may be a good idea to limit it to players with low latency to your server (say < 50ms) which will prevent players outside your geographical region (you could always set up new servers for those players elsewhere).

Personally I would always recommend using a FastCGI backend for Apache (or maybe Nginx or some other web server). Then you will need a pool of processes / threads to run your FastCGI. This does not need to run as root (and indeed, should not).

In the longer term though, if the client browsers support it, it might be a good idea to use Websockets.

  • \$\begingroup\$ Thanks I will research about your suggestions. Have never used FastCGI or Websockets. Do you have a introductive tutorial you would recommend? \$\endgroup\$
    – Shlomo
    Commented Oct 12, 2012 at 7:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .