Maximum number of threads (200) created for connector with address null and port 9999

2024-01-21 07:58

本文主要是介绍Maximum number of threads (200) created for connector with address null and port 9999,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、INFO: Maximum number of threads (200) created for connector with address null and port 8091

说明:最大线程数错误

解决方案:

使用线程池,用较少的线程处理较多的访问,可以提高tomcat处理请求的能力。使用方式:

首先。打开/conf/server.xml,增加

  1. <Executorname="tomcatThreadPool"namePrefix="catalina-exec-"     
  2.         maxThreads="2500"minSpareThreads="20"maxIdleTime="60000"/>
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"    maxThreads="500" minSpareThreads="20" maxIdleTime="60000" />  


最大线程500(一般服务器足以),最小空闲线程数20,线程最大空闲时间60秒。

然后,修改<Connector ...>节点,增加executor属性,如:

  1. <Connectorexecutor="tomcatThreadPool"     
  2.                port="9999"protocol="HTTP/1.1"     
  3.                connectionTimeout="60000"   
  4.                keepAliveTimeout="15000"   
  5.                maxKeepAliveRequests="1"   
  6.                redirectPort="443"   
  7.                ....../>
<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. (1).ps -ef |grep tomcat  查看tomcat的进程ID,记录ID号,假设进程ID为10001    
  2. (2).lsof -p 10001|wc -l    查看当前进程id为10001的 文件操作数    
  3. (3).使用命令:ulimit -a   查看每个用户允许打开的最大文件数    
  4.   默认是1024.    
  5. (4).然后执行:ulimit -n 65536 将允许的最大文件数调整为65536   

这篇关于Maximum number of threads (200) created for connector with address null and port 9999的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/628862

相关文章

usaco 1.2 Name That Number(数字字母转化)

巧妙的利用code[b[0]-'A'] 将字符ABC...Z转换为数字 需要注意的是重新开一个数组 c [ ] 存储字符串 应人为的在末尾附上 ‘ \ 0 ’ 详见代码: /*ID: who jayLANG: C++TASK: namenum*/#include<stdio.h>#include<string.h>int main(){FILE *fin = fopen (

题目1380:lucky number

题目1380:lucky number 时间限制:3 秒 内存限制:3 兆 特殊判题:否 提交:2839 解决:300 题目描述: 每个人有自己的lucky number,小A也一样。不过他的lucky number定义不一样。他认为一个序列中某些数出现的次数为n的话,都是他的lucky number。但是,现在这个序列很大,他无法快速找到所有lucky number。既然

Debugging Lua Project created in Cocos Code IDE creates “Waiting for debugger to connect” in Win-7

转自 I Installed Cocos Code IDE and created a new Lua Project. When Debugging the Project(F11) the game window pops up and gives me the message waiting for debugger to connect and then freezes. Also a

Jenkins 通过 Version Number Plugin 自动生成和管理构建的版本号

步骤 1:安装 Version Number Plugin 登录 Jenkins 的管理界面。进入 “Manage Jenkins” -> “Manage Plugins”。在 “Available” 选项卡中搜索 “Version Number Plugin”。选中并安装插件,完成后可能需要重启 Jenkins。 步骤 2:配置版本号生成 打开项目配置页面。在下方找到 “Build Env

Cannot read property ‘length‘ of null while opening vscode terminal

同一问题地址:Cannot read property ‘length’ of null while opening vscode terminal 问题描述 One day, 我在ubuntu 18.04下用vscode打开一个项目,并想和往常一样在vscode使用终端,发现报错Cannot read property 'length' of null。 解决 打开setting.jso

非空约束(Not Null)

修改表添加非空约束 使用DDL语句添加非空约束 ALTER TABLE 表名 MODIFY 列名 类型 NOT NULL; 示例: 向emp表中的salary添加非空约束。 alter table emp modify salary float(8,2) not NULL; 删除非空约束 使用DDL语句删除非空约束 ALTER TABLE 表名 MODIFY 列名 类型 NULL;

C++常见异常汇总(三): fatal error: google/protobuf/port_def.inc

文章目录 1、fatal error : sw/redis++/redis.h2、fatal error: dwarf.h: No such file or directory3、fatal error: elfutils/libdw.h: No such file or directory4、fatal error: libunwind.h: No such file or directo

【Hdu】Minimum Inversion Number(逆序,线段树)

利用线段树在nlogn的时间复杂度内求一段数的逆序。 由于给的序列是由0 ~ n -1组成的,求出初始的逆序之后可以递推出移动之后的逆序数。 #include<cstdio>#include<iostream>#include<cstring>#include<algorithm>using namespace std;typedef long long LL;const in

【JavaScript】基本数据类型与引用数据类型区别(及为什么String、Boolean、Number基本数据类型会有属性和方法?)

基本数据类型   JavaScript基本数据类型包括:undefined、null、number、boolean、string。基本数据类型是按值访问的,就是说我们可以操作保存在变量中的实际的值。 1)基本数据类型的值是不可变的 任何方法都无法改变一个基本类型的值,比如一个字符串: var name = "change";name.substr();//hangconsole.log

leetcode#628. Maximum Product of Three Numbers

题目 Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3]Output: 6 Example 2: Input: [1,2,3,4]Output: 24 Note: The lengt