我有一個GWT Web應用兩個請求,在Tomcat下運行,具有下列遠程服務:的Tomcat只允許在同一時間
public class MyServiceImpl extends RemoteServiceServlet implements MyService {
@Override
public void doIt() {
System.out.println(Thread.currentThread() + " " + this);
try {
Thread.sleep(50 * 1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
}
System.out.println(Thread.currentThread() + " " + this + " I have done waiting ");
}
}
在我的網頁我有一個按鈕,單擊時調用服務。問題是,如果我從三個單獨的瀏覽器選項卡中按下按鈕兩次,則只有前兩個正在執行,第三個排隊,並在前兩個完成之後立即執行。我應該修改什麼以允許在同一時間發生任意數量的請求?
連接器在server.xml中是:
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="50" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="160000"
maxKeepAliveRequests="15"/>
哪個瀏覽器?你可以嘗試其他幾個人嗎?瀏覽器可以與服務器保持開放連接的數量有限制。 RFC表示「不應該超過2」,但我認爲它更像4-8新的。 – milan 2012-01-11 10:53:16
如果在打開這兩個文件的情況下嘗試連接另一個瀏覽器會發生什麼? – milan 2012-01-11 10:58:28
你也可以嘗試非阻塞連接器:protocol =「org.apache.coyote.http11.Http11NioProtocol」 – milan 2012-01-11 11:01:25