转至:http://xy123110.iteye.com/blog/1551544
1、INFO: Maximum number of threads (200) created for connector with address null and port 8091
说明:最大线程数错误
解决方案:
使用线程池,用较少的线程处理较多的访问,可以提高tomcat处理请求的能力。使用方式:
首先。打开/conf/server.xml,增加
- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
- maxThreads="500" minSpareThreads="20" maxIdleTime="60000" />
最大线程500(一般服务器足以),最小空闲线程数20,线程最大空闲时间60秒。
然后,修改<Connector ...>节点,增加executor属性,如:
- <Connector executor="tomcatThreadPool"
- port="80" protocol="HTTP/1.1"
- connectionTimeout="60000"
- keepAliveTimeout="15000"
- maxKeepAliveRequests="1"
- redirectPort="443"
- ....../>
2、java.net.SocketException: Too many open files
当tomcat并发用户量大的时候,单个jvm进程确实可能打开过多的文件句柄。
使用 #lsof -p 10001|wc -l 查看文件操作数
如下操作:
- (1).ps -ef |grep tomcat 查看tomcat的进程ID,记录ID号,假设进程ID为10001
- (2).lsof -p 10001|wc -l 查看当前进程id为10001的 文件操作数
- (3).使用命令:ulimit -a 查看每个用户允许打开的最大文件数
- 默认是1024.
- (4).然后执行:ulimit -n 65536 将允许的最大文件数调整为65536
相关推荐
操作系统英文课件:ch2 Processes and Threads a.ppt
操作系统英文课件:ch2 Processes and Threads b.ppt
操作系统英文课件:ch2 Processes and Threads c.ppt
Maximum number of threads per multiprocessor: 2048 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z...
操作系统概念英文课件:Chapter 04-threads[13].pptx
It describes in particular the mechanisms of synchronization (cooperative and competitive) and sharing of data (internal class, static variables) between threads in Java. He then discusses the use of...
Maximum number of threads per multiprocessor: 2048 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (1024, 1024, 64) Max dimension size of a grid size (x,y,z...
###################################################################### 下面的程序是一个基于IO::Poll和threads多线程的Echo服务程序,### 在这个程序中实现了对于Dos方式攻击的防御以及对连接超时的处理#######...
This concise book empowers all Java developers to master the complexity of the Java thread APIs and concurrency utilities. This knowledge aids the Java developer in writing correct and complex ...
This fully updated UNIX classic covers everything students need to know to master UNIX threads, TCP/IP, and RPC programming—with reusable code examples that explain syntax every step of the way....
The fixed association of threads to tasks also makes it impossible to migrate a thread to another address spaces---an important operation for, e.g., NUMA systems. The original Version 2 API is very ...
Linux安装oracle 11g R2详细步骤,每一步怎么操作,包括操作命令,完全罗列出来,傻瓜式安装,就算你不懂linux不动oracle,一样可以安装成功!还包含远程连接服务器上oracle的方法,内容详细
Now, you can write code that scales as the number of available cores increases, without having to work with complex managed threads. You are able to write code that runs tasks, and the Common ...
赠送jar包:jboss-threads-3.1.0.Final.jar; 赠送原API文档:jboss-threads-3.1.0.Final-javadoc.jar; 赠送源代码:jboss-threads-3.1.0.Final-sources.jar; 赠送Maven依赖信息文件:jboss-threads-3.1.0.Final....
学习 Ruby Thread 开发技术,深度解析
Java™ Puzzlers: Traps, Pitfalls, and Corner Cases.chm,英文版本,chm 格式,大小 1 Mb,作者:Joshua Bloch、Neal Gafter。 内容预览: Chapter 1. Introduction Chapter 2. Expressive Puzzlers Puzzle 1: ...
Of course all threads inside a given process will share the same address space, the same set of open files, etc. The pthread library also provide thread synchronization primitives: mutexes and ...
Programming with POSIX Threads
The boot.ini option /3GB was created for those cases where systems actually support greater than 2 GB of physical memory and an application can make use of it This capability allows memory intensive ...
The number of threads dynamically changes according to the workload on the threads in the pool. Work items can return a value. A work item can be cancelled if it hasn't been executed yet. The ...