HI. This works like a keepalive timeout on other servers (apache, nginx, etc).
"specifies the maximum number of seconds before a socket receives a timeout for subsequent requests over the same connection" So, when a request is made to the server, the socket will remain open for the specified amount of time *after servicing the current request*. In otherwords, rather than hanging up the phone, the server hangs around in case there are any more questions. It's like when I talk to my mom.. Just when I think I'm hanging up, there is one more last minute comment or question.. It is much more efficient for me to give a brief pause before hanging up in case she has one more earth-shattering thing to tell me. If I hung up too soon, She would call back, I would have to answer it, have a little greeting and then get the other information.. The 1.5 seconds I stayed on to hear the last bit of gossip is much more efficient than a second call.. This has benefit in that if a client has to request multiple resources, there will not be an overhead of connecting each time (the socket is still open). Yes, this ties up the thread for that amount of time. There is no specific one-size-fits-all for this. It needs to be tuned for how your clients use your service. Too high and idle threads sit around un-used. Too low and performance can be degraded because of multiple requests to open a socket that could otherwise be avoided. If you load a web page and you know that the standard page *plus all additional resources in subsequent requests* takes 3 seconds to load, then you would want a keepalive time that is at least that long. This way, all of the items are served up a bit quicker (less overhead for connections). On the flip-side, if you have some app that is an API that is consumed in such a way that clients fire a single request and walk away (maybe some sort of lookup service) and additional subsequent requests from the same client are unlikely in the coming seconds, then a much lower (or even zero in some cases) keepalive setting is best. Kind Regards, David Ennis David Ennis *Content Engineer* [image: HintTech] <http://www.hinttech.com/> Mastering the value of content creative | technology | content Delftechpark 37i 2628 XJ Delft The Netherlands T: +31 88 268 25 00 M: +31 63 091 72 80 [image: http://www.hinttech.com] <http://www.hinttech.com> <https://twitter.com/HintTech> <http://www.facebook.com/HintTech> <http://www.linkedin.com/company/HintTech> On 21 August 2015 at 20:56, Tiao, Amos <[email protected]> wrote: > Hi, > > > > What does keep alive timeout mean for http server? What would be the > impact of decrease and increase the time for the setting? > > > > Does one request here spawn one thread in Marklogic? > > > > Thanks. > > > > Amos > > _______________________________________________ > General mailing list > [email protected] > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
