REST Web Service and Keep-Alive

Naoufel picture Naoufel · Nov 11, 2012 · Viewed 13.1k times · Source

I'm setting up a web application, service oriented. The UI part (a web app) is consuming REST web services I'm coding too. So I have hand on both server and client side.

I was just wondering if it makes sense to set up HTTP keep-alive in such context. If it is, I'm curious as to why.

thanks in advance.

Answer

thedayofcondor picture thedayofcondor · Nov 11, 2012

Yes, it does! From my testing on my server I can get 300 calls per seconds to my REST web service without keepalive, over 2000 with the keepalive on.

You will have to do some analysis on the usage patterns - often user-driven usage comes in bursts so it makes sense to keep the keepalive timeout quite short, just to handle a single burst.