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),如下:

<!-- 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,如下

[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

修改好后显示如下:

[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  永久修改这个参数,增加下面参数

* soft nofile 65536
* hard nofile 65536
* soft memlock 102400
* hard memlock 102400


 

相关推荐

  1. Graylog解决超出ES搜索窗口限制问题

    2024-05-10 09:26:08       56 阅读
  2. js中页面请求高并发处理,限制请求数量

    2024-05-10 09:26:08       32 阅读
  3. 数组问题

    2024-05-10 09:26:08       40 阅读
  4. 模型】websocket连接频繁断掉问题

    2024-05-10 09:26:08       101 阅读
  5. 数字(maxnumber)

    2024-05-10 09:26:08       28 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-10 09:26:08       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-10 09:26:08       100 阅读
  3. 在Django里面运行非项目文件

    2024-05-10 09:26:08       82 阅读
  4. Python语言-面向对象

    2024-05-10 09:26:08       91 阅读

热门阅读

  1. rust学习(openssl rsa加解密文件)

    2024-05-10 09:26:08       33 阅读
  2. C++ 746. 使用最小花费爬楼梯

    2024-05-10 09:26:08       27 阅读
  3. hbase建表预分区的2种方法

    2024-05-10 09:26:08       25 阅读
  4. DRM/RESP无法连接linux上redis的原因

    2024-05-10 09:26:08       36 阅读
  5. stm32学习探究:利用TB6612驱动直流电机

    2024-05-10 09:26:08       35 阅读
  6. Spark SQL

    Spark SQL

    2024-05-10 09:26:08      26 阅读