GlassFish 3.1.2一段时间后HTTP连接速度变慢

时间:2016-03-04 01:55:13

标签: glassfish threadpool glassfish-3

我正面临一个关键问题。 GlassFish 3.1.2(Oracle GlassFish final)服务器HTTP post方法仅适用于GlassFish服务器重启的前几分钟。经过一段时间后,HTTP连接需要2分钟才能启动对POST URL的请求。

EDIT(来自评论):Java:jdk1.7操作系统:Cent OS 7 64位

启动GlassFish服务器后,我可以使用HttpUrlConnection访问任何URL。但几分钟后,发起请求并得到回复需要2分钟

例如:

String msgURL = "someurl";
URL url = new URL(MsgURL); 
HttpsURLConnection httpConnection = (HttpsURLConnection) url.openConnection(); 
if(null != httpsConn) { 
  System.out.println(httpsConn.getResponseCode()); } 

如果我再次重启GlassFish服务器,我可以快速得到响应。面对同样缓慢的几分钟后再次发送请求

任何人都能帮助我吗?

1 个答案:

答案 0 :(得分:0)

I am not sure if you create always new connections. It may happen that all connections from the connection pool of the glassfish are in use, and you get a new connection after some of the connections times out. The timeout can explain the delay you are facing.