GlassFish 线程池繁忙的 Apache mod_proxy_ajp
我使用 Apache 和 GlassFish 上的默认设置通过 mod_proxy_ajp 将 Apache 2.2.15 代理请求发送给 GlassFish 3.1.1。该设置似乎在很短的时间内工作正常,然后我会在 GlassFish 日志中收到线程池繁忙错误消息,然后在 Apache 日志中收到超时错误,并且应用程序无法再次工作,直到我重新启动 GlassFish。
我应该更改配置来防止此错误吗?
注意:系统负载并不重 - 我只是用一个浏览器通过浏览应用程序中的页面来访问它。这表明如果不是配置错误,问题可能是线程泄漏错误。我在浏览器中收到的错误是 500:内部服务器错误。
GlassFish 日志中的错误是:
SEVERE|glassfish3.1.1|org.apache.tomcat.util.threads.ThreadPool|_ThreadID=17;_ThreadName=Thread-2;|threadpool.busy
Apache 日志中的错误是:
[error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header
我在 Apache 中的代理配置是:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / ajp://mydomain:8009/
ProxyPassReverse / ajp://mydomain:8009/
在 GlassFish 中,我只是在安装后运行以下命令:
asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server apache-proxy
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.apache-proxy.jk-enabled=true
I've got Apache 2.2.15 proxying requests to GlassFish 3.1.1 via mod_proxy_ajp using the defaults on both Apache and GlassFish. The setup seems to work okay for a very short while then I'll get a thread pool busy error message in the GlassFish log followed by a timeout error in the Apache log and the application doesn't work again until I restart GlassFish.
Should I make configuration changes to prevent this error?
Note: the system is not under heavy load - it is just accessed by myself with one browser by navigating through pages in the application. This suggests the issue might be a thread leak bug if it isn't a misconfiguration. The error I get in the browser is 500: Internal Server Error.
The error in the GlassFish log is:
SEVERE|glassfish3.1.1|org.apache.tomcat.util.threads.ThreadPool|_ThreadID=17;_ThreadName=Thread-2;|threadpool.busy
The error in the Apache log is:
[error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header
My proxy configuration in Apache is:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / ajp://mydomain:8009/
ProxyPassReverse / ajp://mydomain:8009/
And in GlassFish I just run the following commands after the install:
asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server apache-proxy
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.apache-proxy.jk-enabled=true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在java.net的GlassFish论坛上问了这个问题,得到了效果的回复:
完整答案在这里:
http://www.java.net/forum /topic/glassfish/glassfish/jkenabled-thread-leak
这似乎是一个合理的答案,因此我将其发布在这里是为了其他人的利益。
注意:设置 Apache 上使用的线程的一种方法是使用 max 属性,如下所示:
I asked this question on the GlassFish forum on java.net and got a response of the effect:
Full Answer here:
http://www.java.net/forum/topic/glassfish/glassfish/jkenabled-thread-leak
This seems like a reasonable answer so I'm posting it here for the benefit of others.
Note: one way to set the threads used on Apache is to use the max attribute like so: