LoginSignup
0
0

More than 1 year has passed since last update.

WebArena Indigo 環境設定5)プロセス最大値の変更

Last updated at Posted at 2021-12-30

WebArena Indigo 環境設定4)時間設定の変更
https://qiita.com/naga_kt/items/194dfcd70f72d977187d
の続き。

プロセス最大値の変更(CentOS7のみ)

 ulimitコマンドで実行可能なユーザープロセスの最大数を確認したところ、デフォルト設定では3790だった。それを「-S」オプションで4096に増やそうとしたが、エラーメッセージが出てできなかった。
 これはOSの問題というよりもvpsのスペックの問題だったかもしれない。

$ulimit -u
3790
$ulimit -Su 4096
-bash: ulimit: max user processes: cannot modify limit: Invalid argument

スーパーユーザになって/etc/security/limits.confを編集した。

$su
Password:
#cd /etc/security/
#ls -lrt
total 52
-rw-r--r--. 1 root root 1718 Dec  7  2011 pwquality.conf
-rw-r--r--. 1 root root   82 Apr 11  2018 chroot.conf
-rw-r--r--. 1 root root 4564 Apr 11  2018 access.conf
-rw-r--r--. 1 root root 2972 Apr 11  2018 pam_env.conf
drwxr-xr-x. 2 root root    6 Apr 11  2018 console.perms.d
-rw-r--r--. 1 root root  939 Apr 11  2018 console.perms
-rw-r--r--. 1 root root  604 Apr 11  2018 console.handlers
drwxr-xr-x. 2 root root    6 Apr 11  2018 console.apps
-rw-r--r--. 1 root root 3635 Apr 11  2018 group.conf
-rwxr-xr-x. 1 root root 1019 Apr 11  2018 namespace.init
drwxr-xr-x. 2 root root    6 Apr 11  2018 namespace.d
-rw-r--r--. 1 root root 1440 Apr 11  2018 namespace.conf
-rw-r--r--. 1 root root  419 Apr 11  2018 sepermit.conf
-rw-r--r--. 1 root root 2179 Apr 11  2018 time.conf
-rw-------. 1 root root    0 Apr 11  2018 opasswd
drwxr-xr-x. 2 root root   27 Oct  6  2018 limits.d
-rw-r--r--. 1 root root 2558 Dec 17 15:26 limits.conf
#cp -p limits.conf limits.conf-org
#vi limits.conf

編集前

*               hard    nofile          4096
*               soft    nofile          4096
*               soft    nproc           4096

編集後

*               hard    nofile          4096
*               soft    nofile          4096
*               hard    nproc           4096
*               soft    nproc           4096

 この後でセッションを終わらせて、再度ログインすると以下のようにプロセス最大値が変更されていた。

$ulimit -u
4096

WebArena Indigo 環境設定6)/tmpフォルダのファイルの削除処理の変更
https://qiita.com/naga_kt/items/c18089ebecb6e26374f4
に続く。


参考記事

【 ulimit 】コマンド――ユーザーが使用できるリソースを制限する
https://atmarkit.itmedia.co.jp/ait/articles/1908/01/news031.html

プロセスのリソース制限
http://cos7.it-mem.info/2019/01/10/%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%81%AE%E3%83%AA%E3%82%BD%E3%83%BC%E3%82%B9%E5%88%B6%E9%99%90/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0