???????????????
?????????????Connection: Close
????##connection:close????kept alive???????0
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection request: [route: {}->http://bizdomain:80][total kept alive: 0; route allocated: 0 of 32; total allocated: 0 of 200]
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection leased: [id: 0][route: {}->http://bizdomain:80][total kept alive: 0; route allocated: 1 of 32; total allocated: 1 of 200]
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.execchain.MainClientExec:?) - Opening connection {}->http://bizdomain:80
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.DefaultHttpClientConnectionOperator:?) - Connecting to bizdomain/127.0.0.195:80
????## ??????????
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.DefaultHttpClientConnectionOperator:?) - Connection established 127.0.0.191:49239<->127.0.0.195:80
????## ??????????????
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Connection: Close[ ][ ]"
????## ?????????????????
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Connection: close[ ][ ]"
????##????????????????
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.DefaultManagedHttpClientConnection:?) - http-outgoing-0: Close connection
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.execchain.MainClientExec:?) - Connection discarded
????[2017-04-26 13:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection released: [id: 0][route: {}->http://bizdomain:80][total kept alive: 0; route allocated: 0 of 32; total allocated: 0 of 200]
???????????????????Connection: Close????????????????????????????
?????????????60s??????????????5s???
????##Keep-Alive: timeout=60 ???????????connection:close????
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection request: [route: {}->http://bizdomain:80][total kept alive: 0; route allocated: 0 of 32; total allocated: 0 of 200]
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection leased: [id: 0][route: {}->http://bizdomain:80][total kept alive: 0; route allocated: 1 of 32; total allocated: 1 of 200]
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.execchain.MainClientExec:?) - Opening connection {}->http://bizdomain:80
????## ????????ó?????60s
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Connection: keep-alive[ ][ ]"
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Keep-Alive: timeout=60[ ][ ]"
????## ????????ó?????5s
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Keep-Alive: timeout=5?? max=100[ ][ ]"
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Connection: Keep-Alive[ ][ ]"
????## ???????????Ч????????????5s
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.execchain.MainClientExec:?) - Connection can be kept alive for 5000 MILLISECONDS
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection [id: 0][route: {}->http://bizdomain:80] can be kept alive for 5.0 seconds
????[2017-04-26 10:57:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection released: [id: 0][route: {}->http://bizdomain:80][total kept alive: 1; route allocated: 1 of 32; total allocated: 1 of 200]
????##Keep-Alive: timeout=60 ??????????
????[2017-04-26 14:11:00 DEBUG]  (org.apache.http.impl.conn.PoolingHttpClientConnectionManager:?) - Connection request: [route: {}->http://bizdomain:80][total kept alive: 1; route allocated: 1 of 32; total allocated: 1 of 200]
????## ????????????????????5s?Ч
????[2017-04-26 14:11:00 DEBUG]  (org.apache.http.impl.conn.CPool:?) - Connection [id:2][route:{}->http://bizdomain:80][state:null] expired @ Wed Apr 26 14:10:05 GMT+08:00 2017
??????????????Ч???????????ò??Ч
????## ?????????30s???
????[2017-04-26 17:45:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Connection: keep-alive[ ][ ]"
????[2017-04-26 17:45:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 >> "Keep-Alive: timeout=30[ ][ ]"
????## ?????????????
????[2017-04-26 17:45:00 DEBUG]  (org.apache.http.wire:?) - http-outgoing-0 << "Connection: keep-alive[ ][ ]"
????## ???????????
????[2017-04-26 17:45:00 DEBUG]  (org.apache.http.impl.execchain.MainClientExec:?) - Connection can be kept alive indefinitely
?????????http???????????????????????connection??κ?keep-alive??ζ????
????????????????????????????????????????????????????????????????????????????????????? ??????μ?????
????????request????response??header?а???????close??connection???????????????????tcp????????????????????????client??????μ?????????????μ?tcp??????? HTTP Connection?? close?????????????????????κ??????????????????????????????????????????TCP?????
????????
????· TCP????????
???????????????????????????“HTTPЭ??????????????????????TCPЭ??????????????”?? HTTP??TCP?????????????????????????????????HTTP??????/?????????????????????????????????????????????????????????ò??????????????? ??TCP??????????????????????????socket??????IM????A??B?????к??????????????B??????????????????
????· TCP keep-alive
??????????HTTPЭ???keep-alive??TCP??keep-alive???????в????HTTP??keep-alive?????????????????????????????keep-alive????????????tcp????????????????ζ????????TIME_WAIT?????????????????????httpd??????????????(?????tcp??????ζ???????????????socket??accept()??close()????)?????????????tcp??????????????????Ч??á????ò?????keep-alive????????????????????????????????
??????tcp keep-alive??TCP???????TCP??????????????漰??????????tcp_keepalive_time?? tcp_keepalive_intvl?? tcp_keepalive_probes??
???????????????????TCP???????????????????κ???????????????tcp_keepalive_time????????????????????????????????ж?TCP???????(?п?????????????????????á????????????)??????????????????(ack??)??????? tcp_keepalive_intvl????γ???????????????????????ack??????????????????ack????????? tcp_keepalive_probes?Ρ????????tcp_keepalive_probes????????????????ack???????????TCP?????TCP????????????????2С???????????30?????????