ubuntu 默认非服务器版本,在大压力的环境下,有些参数不设置会出现很诡异的现象
1. 网络连接上限增加,否则web服务, 例如tomcat会卡住, 数据库连接组件无法创建,需要增加连接数,或者超时时间
net.ipv4.neigh.default.gc_thresh1 = 16384
net.ipv4.neigh.default.gc_thresh2 = 16384
net.ipv4.neigh.default.gc_thresh3 = 16384
2. opensips 服务在大连接设备的情况下,目前会导致某些设备呼叫返回 call fail 的情况, 可能在与 location table的 hash_size 太小,通常默认512,需要日后验证
#### USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset", "single-instance-no-db")
modparam("usrloc", "hash_size", 14)
关于 WSS - websocket 加密服务器的密钥设置
通常都会用阿里云类似的 https 的证书, 该证书生成是 jks 格式的, 在比如用 QT/Go 之类编写 wss 服务器的时候,需要用到 cer 和 key, 一般通过如下命令转换
keytool -importkeystore -srckeystore 5449826_www.i-ttg.net.jks -destkeystore server.p12 -srcstoretype jks -deststoretype pkcs12
openssl pkcs12 -in server.p12 -nokeys -clcerts -out server_2021.crt
openssl pkcs12 -in server.p12 -nocerts -nodes -out server_2021.key
注意密码用一样的就好了,避免出错或者记不住, 阿里自带生成的证书,文件说明里面有自动生成的密码