转至: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
相关推荐
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...
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...
1. **Parallelism**: Multiple threads can execute independently, allowing for more efficient use of processor cores and improved overall throughput. 2. ** Responsiveness**: Threads can be prioritized, ...
###################################################################### 下面的程序是一个基于IO::Poll和threads多线程的Echo服务程序,### 在这个程序中实现了对于Dos方式攻击的防御以及对连接超时的处理#######...
《Working with Ruby Threads》这本书深入探讨了Ruby语言中的线程机制,对于希望利用Ruby进行高效并发编程的开发者来说是一本不可多得的资源。 #### Ruby为什么值得关注? Ruby作为一种动态类型、解释型语言,在...
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 ...
操作系统中的线程(Threads)是计算机系统中执行的基本单元,它们是CPU利用率的基础,尤其在多线程计算系统中扮演着重要角色。本章主要涵盖了线程的概念、多线程模型、线程库、线程问题以及操作系统实例分析。 线程...
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....
通过阅读《Programming with POSIX Threads》,开发者不仅可以学习到多线程编程的基础知识,还能获得解决实际并发问题的经验,这对于开发高效、可靠的多线程应用至关重要。无论你是初学者还是经验丰富的开发者,这...
Linux安装oracle 11g R2详细步骤,每一步怎么操作,包括操作命令,完全罗列出来,傻瓜式安装,就算你不懂linux不动oracle,一样可以安装成功!还包含远程连接服务器上oracle的方法,内容详细
赠送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....
24)..Fixed: SSL port number for Bugzilla 25)..Fixed: Disabling "Activate Exception Filters" option was ignored 26)..Fixed: Missing FTP proxy settings 27)..Fixed: IntraWeb support is updated up to 14.0...
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 ...
Java™ Puzzlers: Traps, Pitfalls, and Corner Cases.chm,英文版本,chm 格式,大小 1 Mb,作者:Joshua Bloch、Neal Gafter。 内容预览: Chapter 1. Introduction Chapter 2. Expressive Puzzlers Puzzle 1: ...
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 ...
由本人制作 . 我在很多论坛上看到类似的主题:求书:Programming with POSIX Threads?而很多人的经历是 找了很久没找到.我也是如此. 显然,这是一本相当重要的书,当你在学习UNIX/LINUX下的多线程编程的时候....