I am having issues when first loading the webpage of an embedded webserver. I think it is due to the amount of TCP connections Chrome is requesting when I first try to load the page. Please read through my perceived description of the cause/problem and let me know your suggestions. Thanks.
I used wireshark to view the packets. When I type the webpage into the Chrome, and before hitting enter, Chrome already sends out 6 TCP SYN packets. I see that the embedded webserver responds to each of the 6 SYN packets with a SYN, ACK.
When I view the task states, there are two "HTTP Server Session" tasks present.
Lets lets say the client uses ports 60001 - 60006 to connect to port 80 of the server.
The webserver, I believe, only keeps the 2 most recent sessions (60005 and 60006). When I press enter on the address bar, wireshark shows the port of the 1st request from the client is the one requesting the HTTP page (60001).
Since this connection is not established anymore, the webserver waits up to 20 seconds (HTTPSRVCFG_SES_TO) to close 60005/60006 connections due to inactivity. Once it is closed, then it responds to the 60001 port request.
How should I go about getting the webserver to work faster on the initial load of the page? Should I re-compile with changing the HTTPSRVCFG_SES_TO to something like 1 second? I don't really want to set the max number of sessions to 6 because of the limited amount of RAM on the controller.