GlassFishのチューニングに関して

基本的に、JVMはチューニングしないといけないのですが、
負荷がかかった時など、予期しない挙動になる場合もあります。
実は、OSのチューニングも必要です。
GlassFishを起動しているユーザのファイルディスクリプタ数の上限を変更する必要があります。
変更方法は、下記の方法になります。

ファイルディスクリプタ数の上限を変更

[root@localhost]# cd /etc/security
[root@localhost]# vi limits.conf
*   soft   nproc    2048
*   hard   nproc    16384
*   soft   nofile   2048
*   hard   nofile   655536

ログインした時に上記で設定した内容を適用させる

[root@localhost]# cd /etc/pam.d
[root@localhost]# vi login
session    required   /lib/security/pam_limits.so
[root@localhost]# cd /etc
[root@localhost]# vi profile
if [ $USER = "glassfish" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
   else
        ulimit -u 16384 -n 65536
   fi
fi
[root@localhost]# vi csh.login
if ( $USER == "glassfish" ) then
     limit maxproc 16384
     limit descriptors 65536
endif
[root@localhost]# reboot