Apache 我的网站在tomcat';内存不足异常

Apache 我的网站在tomcat';内存不足异常,apache,tomcat,Apache,Tomcat,我在Redhat上安装了Apache2+mod_jk+tomcat。最近刚开始有java.lang.OutOfMemoryError:无法创建新的本机线程异常,导致tomcat挂起 catalina.sh: JAVA_OPTS="-Xms1256m -Xmx2000m" export JAVA_OPTS CATALINA_OPTS="-Xms1024m -Xmx2000m" export CATALINA_OPTS JAVA_HOME=/data/app/jdk/jdk1.5.0_11 JRE_

我在Redhat上安装了Apache2+mod_jk+tomcat。最近刚开始有java.lang.OutOfMemoryError:无法创建新的本机线程异常,导致tomcat挂起

catalina.sh:

JAVA_OPTS="-Xms1256m -Xmx2000m" export JAVA_OPTS CATALINA_OPTS="-Xms1024m -Xmx2000m" export CATALINA_OPTS JAVA_HOME=/data/app/jdk/jdk1.5.0_11 JRE_HOME=/data/app/jdk/jdk1.5.0_11 export JAVA_HOME export JRE_HOME JAVA_OPTS=“-Xms1256m-Xmx2000m” 导出JAVA_选项 CATALINA_OPTS=“-Xms1024m-Xmx2000m” 出口卡特琳娜 JAVA_HOME=/data/app/jdk/jdk1.5.0_11 JRE_HOME=/data/app/jdk/jdk1.5.0_11 导出JAVA_主页 导出JRE_主页 内存设置是否正确?我有4GM可用内存

Tomcat错误日志:

2010-11-14 00:40:13,726 ERROR org.apache.catalina.core.StandardWrapperValve [invoke] - Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:574) 2010-11-14 00:40:13726 Servlet操作的错误org.apache.catalina.core.StandardWrapperValve[invoke]-Servlet.service()引发异常 java.lang.OutOfMemoryError:无法创建新的本机线程 位于java.lang.Thread.start0(本机方法) 在java.lang.Thread.start(Thread.java:574)处 tomcat关机时的Mod_jk日志项:

[Sun Nov 14 00:59:52 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 00:59:52 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:01 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:01 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:01 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:01 2010] worker1 mydomain.com 271.622400 [Sun Nov 14 01:00:01 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:01 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:06 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:06 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:06 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:06 2010] worker1 mydomain.com 86.999946 [Sun Nov 14 01:00:06 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:06 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:10 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:10 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:10 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:10 2010] worker1 mydomain.com 39.000187 Nov 14 00:59:40 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:00:47 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:01:49 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:02:54 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:04:03 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:05:06 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:06:13 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:07:14 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:08:15 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:09:19 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:10:23 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:11:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:12:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:13:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:14:56 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:16:04 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:17:19 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:18:22 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:19:26 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:20:26 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:21:36 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:22:37 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:23:48 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:24:50 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:25:54 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:26:57 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:29:08 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:30:10 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "getattr" to /var/lib/mysql/mysql.sock (var_lib_t). For complete SELinux messages. run sea$ Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "getattr" to /var/lib/mysql/nemo.me-tech.com.my.err (var_lib_t). For complete SELinux mess$ Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "read" to ./time_zone_name.frm (var_lib_t). For complete SELinux messages. run sealert -l $ # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves ‹IfModule prefork.c› StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 256 MaxRequestsPerChild 0 ‹/IfModule› # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves ‹IfModule worker.c› StartServers 2 MaxClients 256 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 ‹/IfModule› worker.list=worker1 worker.worker1.type=ajp13 worker.worker1.host=127.0.0.1 worker.worker1.port=8009 worker.worker1.lbfactor=1 worker.worker1.socket_keepalive=1 worker.worker1.recycle_timeout=180 worker.worker1.sticky_session=False ‹Connector className="org.apache.coyote.tomcat5.CoyoteConnector" port="8009" protocol="AJP/1.3" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="5000" useURIValidationHack="false" maxPostSize="10000000" maxThreads="256" maxSpareThreads="10" URIEncoding="UTF-8" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/› [Sun Nov 14 00:59:52 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 00:59:52 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat已关闭或连接被拒绝。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:01 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat已关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 01:00:01 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat已关闭或连接被拒绝。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:01 2010][错误]ajp_服务::jk_ajp_common.c(1758):连接到tomcat时出错。Tomcat可能未启动或正在侦听错误的端口。worker=worker1失败 [Sun Nov 14 01:00:01 2010]worker1 mydomain.com 271.622400 [Sun Nov 14 01:00:01 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat已关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 01:00:01 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat已关闭或连接被拒绝。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:06 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat已关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 01:00:06 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat关闭或拒绝连接。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:06 2010][错误]ajp_服务::jk_ajp_common.c(1758):连接到tomcat时出错。Tomcat可能未启动或正在侦听错误的端口。worker=worker1失败 [Sun Nov 14 01:00:06 2010]worker1 mydomain.com 86.999946 [Sun Nov 14 01:00:06 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat已关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 01:00:06 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat关闭或拒绝连接。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:10 2010][错误]ajp_连接\u tcp_获取_消息::jk_ajp_common.c(961):无法接收来自tomcat的响应消息,网络问题或tomcat已关闭(127.0.0.1:8009),错误=-104 [Sun Nov 14 01:00:10 2010][错误]ajp_获取_回复::jk_ajp_common.c(1503):Tomcat已关闭或连接被拒绝。尚未向客户端发送响应(尚未) [Sun Nov 14 01:00:10 2010][错误]ajp_服务::jk_ajp_common.c(1758):连接到tomcat时出错。Tomcat可能未启动或正在侦听错误的端口。worker=worker1失败 [Sun Nov 14 01:00:10 2010]worker1 mydomain.com 39.000187 在/var/log/messages中会面:

[Sun Nov 14 00:59:52 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 00:59:52 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:01 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:01 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:01 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:01 2010] worker1 mydomain.com 271.622400 [Sun Nov 14 01:00:01 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:01 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:06 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:06 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:06 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:06 2010] worker1 mydomain.com 86.999946 [Sun Nov 14 01:00:06 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:06 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:10 2010] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Sun Nov 14 01:00:10 2010] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Sun Nov 14 01:00:10 2010] [error] ajp_service::jk_ajp_common.c (1758): Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=worker1 failed [Sun Nov 14 01:00:10 2010] worker1 mydomain.com 39.000187 Nov 14 00:59:40 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:00:47 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:01:49 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:02:54 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:04:03 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:05:06 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:06:13 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:07:14 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:08:15 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:09:19 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:10:23 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:11:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:12:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:13:29 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:14:56 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:16:04 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:17:19 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:18:22 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:19:26 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:20:26 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:21:36 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:22:37 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:23:48 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:24:50 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:25:54 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:26:57 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:29:08 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 01:30:10 nemo kernel: possible SYN flooding on port 8009. Sending cookies. Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "getattr" to /var/lib/mysql/mysql.sock (var_lib_t). For complete SELinux messages. run sea$ Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "getattr" to /var/lib/mysql/nemo.me-tech.com.my.err (var_lib_t). For complete SELinux mess$ Nov 14 03:00:01 nemo setroubleshoot: SELinux is preventing mysqld (mysqld_t) "read" to ./time_zone_name.frm (var_lib_t). For complete SELinux messages. run sealert -l $ # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves ‹IfModule prefork.c› StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 256 MaxRequestsPerChild 0 ‹/IfModule› # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves ‹IfModule worker.c› StartServers 2 MaxClients 256 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 ‹/IfModule› worker.list=worker1 worker.worker1.type=ajp13 worker.worker1.host=127.0.0.1 worker.worker1.port=8009 worker.worker1.lbfactor=1 worker.worker1.socket_keepalive=1 worker.worker1.recycle_timeout=180 worker.worker1.sticky_session=False ‹Connector className="org.apache.coyote.tomcat5.CoyoteConnector" port="8009" protocol="AJP/1.3" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="5000" useURIValidationHack="false" maxPostSize="10000000" maxThreads="256" maxSpareThreads="10" URIEncoding="UTF-8" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/› 11月14日00:59:40 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:00:47 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:01:49 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:02:54 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:04:03 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:05:06 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:06:13 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:07:14 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:08:15 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:09:19 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:10:23 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:11:29 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:12:29 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:13:29 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:14:56 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:16:04 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:17:19 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:18:22 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:19:26 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:20:26 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:21:36 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:22:37 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:23:48 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:24:50 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:25:54 nemo内核:端口8009上可能存在SYN溢出。发送饼干。 11月14日01:26:57 nemo内核:可能的SYN洪泛