apache - Max Processes Limit 当前为 31196,应设置为 65000 以避免操作中断
问题描述
我正在尝试在 solr 中使用 ltr(learning to rank) 并按照 文档中提到的步骤进行操作
当我运行bin/solr start -e techproducts -Dsolr.ltr.enabled=true
它显示此错误
*** [WARN] *** Your Max Processes Limit is currently 31196.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh.
我试图增加进程的数量,ulimit -u 65535
但它拒绝操作
bash: ulimit: max user processes: cannot modify limit: Operation not permitted
我坚持下去,如果有人知道请帮帮我,找不到解决方案。提前致谢
解决方案
尝试以 root 用户身份运行此命令。它将配置附加到限制文件以使其工作。
nofile 是打开文件限制的数量
nproc 是进程数限制
# Increase number of open files. must be run as root
sudo su -
echo '* hard nofile 500000' >> /etc/security/limits.conf
echo '* soft nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf
echo 'fs.file-max = 2097152' >> /etc/sysctl.conf
# set the processes/threads limit
sudo vi /etc/security/limits.d/20-nproc.conf
# * soft nproc 122944
注意:打开文件限制取决于服务器的 RAM 大小
对于域特定设置 /etc/security/limits.d/20-nproc.conf 将覆盖 /etc/security/limits.conf 配置。
要完成这项工作,您应该重新启动
sudo reboot
或关闭所有活动会话窗口,因为它们仍将保持在会话中。
推荐阅读
- linux - fnd 不能被其他人修改的文件
- linux - Bash脚本:在变量中存储带有空格和参数的命令,然后执行
- mysql - 使用 GROUP BY 显示 RIGHT JOIN 查询的所有记录
- django - 使用 Docker 上传后端是 django 和前端是 Vue 的应用程序
- asp.net - 尝试发送一个视图模型来查看
- ffmpeg - 使用 FFMPEG 在 h265 视频中设置固定关键帧
- swift - 使用 String addedPercentEncoding 将字符串编码为查询参数
- python - 优化 Pandas 种子 SciPy 操作
- r - 如何将秒数缩短为分钟间隔?
- c# - 抑制 WebException