开发者

HTTP Keep-Alive for <1KB calls every 1 second

开发者 https://www.devze.com 2023-03-13 12:34 出处:网络
I am optimizing my web server settings to handle large number of concurrent users and one of the problems I\'m running into is deciding whether or not to disable HTTP Keep-Alive.

I am optimizing my web server settings to handle large number of concurrent users and one of the problems I'm running into is deciding whether or not to disable HTTP Keep-Alive.

I am using CDN for all the images on the site so when my HTML page is requested I am downloading approximately 5 files (js, css, etc) on first load... and then only HTML on each successive load.

Other then that, the only thing I have is HTTP POST update invoke on every second (resulting JSON is typically less than 1KB).

So, with these constrains - would you think that disabling HTTP Keep-Alive on the se开发者_开发百科rver would be a good idea? Would that improve the number of concurrent users server can handle?

(By the way, I've reduced KeepAliveTimeout/ConnectionTimeout to 15 seconds in the IIS 7.5 settings)


From what you are describing, you are making a call per client per second. So all boils down to how much it takes to serve the request. If let's say, it takes 100ms to serve the request. So what that means is Http Keep-Alive of 15 seconds will be have 15 calls accommodated w/o re-establishing connection but connection was actual active (or being used) only for 1.5 seconds - rest of the time, you are actually blocking some client/connection (assuming there is any client). W/o keep alive, you can probably accommodate 8-9 times more concurrent clients.

However all said, you have to look at actual parameters to make decision. How many concurrent clients you are likely to have and what is the response time etc. The best way is to do simulation/load testing to measure the performance. Because if your server is going to handle the anticipated max concurrent user load with keep-alive, you can very well keep keep alive.

BTW, also see this related question on SO: http keep-alive in the modern age

0

精彩评论

暂无评论...
验证码 换一张
取 消