简体   繁体   中英

Delay in Browser Passing on Request to Server

My Application makes lots of http Requests to Server. Max Number of connections opened by Client are 2. Any more requests are queued on Client side until one of them is responded.

Problem: 99 % of my requests go fine. In exceptional cases, some of my requests spend time in being delivered by Browser. Hence they are not received by Server in the same order as sent by Client. For these requests, i checked Developer tools and found High Waiting Time(TTFB)(460ms in this case while other have 30-40 ms).

Not sure if it helps but my Server is a Java Http Server. Issue is prominent in IE 9/10/11. Lesser in Chrome out of my experience.

Finally figured out the issue. Might be helpful for someone else too. In the headers I had set connection- Keep-alive for all responses but timeOut was 5 seconds. This resulted in connections opened by browser to be closed. I increased this value to a larger value (30 secs) since my application uses long polling of timeout of 20 seconds. Hence the same connection is being reused now. I dont see the issue any more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM