websocket最大数量的限制问题

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址:RuoYi-Nbcio后台管理系统 http://218.75.87.38:9666/

更多nbcio-boot功能请看演示系统

gitee源代码地址

后端代码: https://gitee.com/nbacheng/nbcio-boot

前端代码:https://gitee.com/nbacheng/nbcio-vue.git

在线演示(包括H5) : http://218.75.87.38:9888

1、可以修改tomcat的server.xml里的最大线程数为1000(默认是200),如下:

java 复制代码
<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="9666" protocol="HTTP/1.1"
               connectionTimeout="60000"
               maxTreads="1000"
               minSpareThreads="100"
               maxSpareThreads="1000"
               acceptCount="200"
               maxProcessors="100"
               minProcessors="30"
               redirectPort="18443"
               executor="tomcatThreadPool"
               enableLookups="false"
               useSendfile="false"
               compression="on"
               compressionMinSize="512"
               noCompressionUserAgents="gozilla, traviata"
               compressableMimeType="text/html,text/xml,text/javascript,application/javascript,text/css,text/plain,text/json,application/x-font-woff,image/jpg,image/png,image/gif,audio/x-wav" />
    <!-- A "Connector" using the shared thread pool-->
    <!--

2、修改max locked memory,如下

java 复制代码
[root@localhost nbcio-boot]# ulimit -a 
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 63450
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 63450
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@localhost nbcio-boot]# 

max locked memory (kbytes, -l) 64 这个太低了,需要修改

ulimit相关修改参数如下

可以临时修改这个参数(重启后无效了)

ulimit -l 102400

修改好后显示如下:

java 复制代码
[root@localhost nbcio-boot]# ulimit -l 102400
[root@localhost nbcio-boot]# ulimit -a 
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 63450
max locked memory       (kbytes, -l) 102400
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 63450
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@localhost nbcio-boot]# 

vi /etc/security/limits.conf 永久修改这个参数,增加下面参数

java 复制代码
* soft nofile 65536
* hard nofile 65536
* soft memlock 102400
* hard memlock 102400
相关推荐
Fnetlink15 分钟前
解析SDWAN供应商光联世纪口碑佳的原因
网络·人工智能·安全
南城以南溫暖如初1478 分钟前
树洞交友系统架构设计与匿名聊天实战指南
java·spring boot·mysql·系统架构·vue·mybatis·交友
民乐团扒谱机17 分钟前
【读论文】基于数字极大似然估计过程增强113公里O-TWTFT链路的时间传递
网络·论文笔记·量子·阅读笔记
网安小学生(兼顾数据库版)19 分钟前
从固件上传到合规报告:艾体宝ONEKEY实现CRA合规的操作实录
网络·安全·web安全
mengge.cloud28 分钟前
云计算&服务器基础小白教程
android·linux·运维·服务器·网络·云计算
Multipath71233 分钟前
多链路聚合设备-应急指挥车实战通信保障方案
网络·5g·安全·智能路由器·实时音视频
Raas10038 分钟前
AI网关是做什么的?MAI Gateway (魔芋企业级AI网关)给出企业级答案
网络·人工智能·gateway·企业级·ai网关·mai gateway·魔芋
星夜夏空991 小时前
网络编程(5)—— Reactor实现(v2)
网络
草根站起来2 小时前
将网站改成HTTPS需要几步?
网络协议·http·https
xrandzj10 小时前
MySQL8.0 从零通关核心操作手册(Ubuntu实战版)
数据库·mysql