I know keepalives are great for eliminating the penalty for a TCP connection when we have a lot of fast sequence requests from a client browser, but what about the case with something like a JSONP web service? This has different characteristics than loading a web page:
A client (browser) usually executes 1 request at a time. Not enough for any auxiliary quick access requests for files with links, for example, in HTML.
Requests will sometimes be executed sequentially, but most often a few seconds or even minutes from each other. The keepalive setting is very low, as many tips are not always a smart setting. The current default value for Apache is 5 seconds ( http://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout ), which is below 1.3 15 seconds ( http://httpd.apache.org /docs/1.3/mod/core.html#keepalivetimeout ). Both of them are much lower than a minute. This may be due to the fact that 15 were too high, or broadband softened latency - or both. The current 5s will probably not bring anything good for this scenario.
We can assume that we do not run a Linux task for each connection - a thread or a process - while the socket remains open in standby mode / WAIT / is blocked by keepalive, but would it be nice to just leave the sockets, which hangs out for several minutes? Possible options are: Nginx, Apache Event MPM, etc., which use the basic functions based on events in nix, for example, kqueue or epoll. Suppose that dynamic content runs in a different task pool and after its completion the keepalive'd socket will be just an open file descriptor.
"" ? linux, , . , - FD - ? TCP- .
http://gabenell.blogspot.com/2010/11/connection-keep-alive-timeouts-for.html http://blog.fastmail.fm/2011/06/28/http-keep-alive-connection-timeouts/ , , Safari, >= 1 . http://www.semicomplete.com/blog/geekery/ssl-latency.html TCP HTTP HTTPS.
, . , ; . . (, , , ). - NAT-. NAT, . , ( ). : ( HTTPS ) ( ) 3 ( ). keep-alive: (, Wi-Fi); "", (, , ). , : ) keep-alive , [ , ), b ) [ RTT , , 3 4].
Facebook 55 . Apache .
, . . , firefox 2 60- , . , , . . Websockets .
, .
https://www.facebook.com/note.php?note_id=14218138919
Source: https://habr.com/ru/post/1536717/More articles:Algorithm: how to calculate the INVERSION of bilinear interpolation? - algorithmIncreasing tomcat memory using a puppet - tomcatFocus problems make tests fail - javascriptWhy is my EventSource not registering? - bootstrappingКак использовать gulp -if, чтобы условно скомпилировать меньше файлов? - gulpHow to scroll the selected item in the list in the phone window 7 - c #Websites and Unique Peer Identification [PHP] - phpTyphoeus Issue при получении запроса от сервера тестирования - httpIOS: выберите пункт назначения с поддерживаемой архитектурой для запуска на этом устройстве - iosNSPopUpButton of type Pull Down, when I click on any menu item, the title of the popup does not change - objective-cAll Articles