更改ulimit配置文件是不起作用的,需要修改service单元文件:
[Service]
LimitNOFILE=8192
有效的Limit选项可以运行man 5 systemd.exec
查看。
LimitCPU=, LimitFSIZE=, LimitDATA=, LimitSTACK=, LimitCORE=, LimitRSS=,
LimitNOFILE=, LimitAS=, LimitNPROC=, LimitMEMLOCK=, LimitLOCKS=,
LimitSIGPENDING=, LimitMSGQUEUE=, LimitNICE=, LimitRTPRIO=,
LimitRTTIME=
These settings control various resource limits for executed
processes. See setrlimit(2) for details. Use the string infinity to
configure no limit on a specific resource.
参考资料:
https://serverfault.com/questions/649577/how-can-i-permanently-set-ulimit-n-8192-in-centos-7#answer-720596
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files#sect-Managing_Services_with_systemd-Unit_File_Create
https://access.redhat.com/solutions/1257953