开发者

Increase Grails/Tomcat active HTTP connection limit

开发者 https://www.devze.com 2023-03-22 14:34 出处:网络
I am developing an AJAX application that utilizes a connecti开发者_开发知识库on that is kept-alive until an event occurs. For each window, a HTTP connection will be open at all times listening for eve

I am developing an AJAX application that utilizes a connecti开发者_开发知识库on that is kept-alive until an event occurs. For each window, a HTTP connection will be open at all times listening for events from the server. On the server side, the thread dealing with the request will simply be frozen until it is thaw by another event. While being frozen, the monitor threads are disconnected from the database.

The number of active connections seems to be limited at about 6. How can I increase this? Do the HTTP request header or whether I use GET or POST have any effect on the limit?


As @fabus mentioned, the restriction is in your browser. You can only have so many open connections to a particular address. Google overcomes the problem in their apps by hosting the imagery on multiple different servers with different names. If you go to Google Maps and watch the status bar, you'll see "Loading from..." messages flashing by with different host names. Once you overcome that, however, you still have to consider the server-side impact. It's pretty well agreed, I think, that a few thousand threads is about the max you should expect from a JVM. You might want to look into an non-blocking implementation if you really want to hold long-lived persistent connections open.

0

精彩评论

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