Apache とオープンファイル

Apache とオープンファイル

編集を試みました/etc/security/limits.confが、それが機能するには Apache に PAM プラグインが必要ですか?

nobody soft nofile 40960000
nobody hard nofile 102400000
phpuser soft nofile 40960000
phpuser hard nofile 102400000
httpd soft nofile 40960000
httpd hard nofile 102400000
nginx soft nofile 40960000
nginx hard nofile 102400000
* soft nofile 40960000
* hard nofile 102400000

設定してみました

fs.file-max = 20970800
net.core.somaxconn = 1024000
kern.maxfilesperproc = 16638400
kern.maxfiles = 819200

sysctl.conf で設定しましたが、まだうまくいきません。

私も/etc/init.d/httpdセットで持っていますULIMIT_MAX_FILES="ulimit -n 16384"

ulimit -n xxxxxx

それは機能しますが、一時的なものです。nginx をインストールするとこの問題は解決しますか、またはこれを機能させる方法はありますか?

エラーは次のとおりです:

[...] failed to open stream: Too many open files [...]

答え1

CentOS に同梱されているデフォルトの httpd と設定を使用している場合、Apache はユーザー root として起動します (ポート 80/443 にバインドできます)。これらを root に設定し、ログアウトして再度ログインしてから、Apache を再起動します。

関連情報