Ubuntu 解决 Too many open files 问题
#查看限制结果
ulimit -a
# 修改配置
# 删除最后一行
echo -e "# add_config" | sudo tee -a /etc/security/limits.conf
# 加上文本
echo -e "\n" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t soft \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t hard \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t soft \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "mzc \t hard \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t soft \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t hard \t nproc \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t soft \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "root \t hard \t nofile \t 204800" | sudo tee -a /etc/security/limits.conf
echo -e "\n" | sudo tee -a /etc/security/limits.conf
echo -e "# End of file" | sudo tee -a /etc/security/limits.conf
echo -e "\n" | sudo tee -a /etc/systemd/system.conf
echo -e "# add_config" | sudo tee -a /etc/systemd/system.conf
echo -e "DefaultLimitNOFILE=204800" | sudo tee -a /etc/systemd/system.conf
echo -e "\n" | sudo tee -a /etc/systemd/user.conf
echo -e "# add_config" | sudo tee -a /etc/systemd/user.conf
echo -e "DefaultLimitNOFILE=204800" | sudo tee -a /etc/systemd/user.conf
出处: https://www.cnblogs.com/meizhengchao/p/18207308
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 如有问题, 可邮件(meizhengchao@qq.com)咨询.