Hello!
On Sat, May 14, 2016 at 2:08 AM, AL wrote:
> So in the first example, every single request will go through a 3-way tcp
> handshake to send the request and through a 2-way tcp close after receiving
> the response, correct?
Yes.
> Meaning that this approached should be avoided if
> possible?
>
Yes.
> For the 2nd example, how long are these keepalives cached/preserved?
As long as it can. Usually up to the remote keepalive timeout settings
and keepalive max requests settings.
> Also, just to make sure I fully understand what's going on (having read
> https://www.nginx.com/blog/load-balancing-with-nginx-plus-part2/#keepalive),
> let's pretend for a second the above keepalive limit was 5 and there are 7
> simultaneous requests coming in . Here is what I currently believe happens:
> #req randomly chosen IP keepalive pool id
> #1 93.184.216.34 --, but gets cached afterwards with id 1
> #2 93.184.216.35 --, but gets cached afterwards with id 2
> #3 93.184.216.36 --, but gets cached afterwards with id 3
> #4 93.184.216.34 --, but gets cached afterwards with id 4
> #5 93.184.216.35 --, but gets cached afterwards with id 5
> #6 93.184.216.36 --, connection gets closed afterwards
> #7 93.184.216.34 --, connection gets closed afterwards
>
> Then, after all of those requests are done, another set of 7 simultaneous
> requests come in. Again, here is what I currently believe happens:
> #req randomly chosen IP keepalive pool id
> #1 93.184.216.34 Reuses id 1 (or 4)
> #2 93.184.216.35 Reuses id 2 (or 5)
> #3 93.184.216.36 Reuses id 3
> #4 93.184.216.34 Reuses id 4 (or 1)
> #5 93.184.216.35 Reuses id 5 (or 2)
> #6 93.184.216.36 --, connection gets closed afterwards
> #7 93.184.216.34 --, connection gets closed afterwards
>
> Is that about right?
Yeah, something like that.
Regards,
-agentzh