當 Jenkins 或其他服務出現 fork: retry: Resource temporarily unavailable,可能是使用者可開啟檔案數或行程數已達上限。
可用 ulimit -a 查看目前限制。若 open files 或 max user processes 偏低,可修改 /etc/security/limits.conf。
以使用者 hades 為例,加入:
@hades soft nofile 65535 @hades hard nofile 65535 @hades soft nproc 65535 @hades hard nproc 65535
通常不需要立即重啟伺服器,重新登入 shell 後即可生效。
也可在使用者的 .bash_profile 中加入:
ulimit -n 65535
這種方式只對該使用者 shell 生效,較為局部。