Quote:
Originally Posted by xiutuo
exec command
ulimit -n 65535
when i relogin ,
ulimit -a
show default values 1024
how can i let tomcat server use max file num=65535 ,when start with /tomcat_install_dir/bin/startup.sh,why ulimit -n 65535 no effect!
configure in /etc/sercurity/limits.conf or /etc/sysctl.conf ? or
/etc/profile? or any other configure file ?
thx for your hint.....
|
Hi xiutuo,
U have this above File Descriptor (FD) problem with SQUID as Proxy server. I don't know the kernel version of linux and squid ur using with this. One thing u must be clear that linux/CentOS/RHEL or other version of linux kernel has File Descriptor limit (makes real-time file but needs to be restricted which might hang up ur server as well with memory consumption. It get removed automatically from memory after jobs are done.) and has default limit to 1024 which is really enough for other services like smtp,ftp,imap,named etc. We can configure FD with various methods.
Following link also works,
=================
http://www.linuxquestions.org/questi...le-size-822491
=================
but problem is that FD is even used on every kernel level error and every services running on system which we really don't wan't. Gr8, what we really want? Then, specific limit for specific service for user.
Here we go for the best in my practice.Ok
=============
Check for ur current Maximum File descriptor limit in current session:
-------------
# ulimit -n
-------------
Squid only starts with a maximum of 1024 FD's
=============
#vi /etc/security/limits.conf
add the following lines ( if u have squid user u can even replace * with the squid user otherwise just leave it.)
#<domain> <type> <item> <value>
* soft nofile 65536
* hard nofile 65536
------Save N Quit--------------
#ulimit -HSn 65536 --->sets File descriptor limit for current session
# ulimit -n
---------------------
# vi /etc/sysctl.conf
-----------------
add the line at the end of the file and save it
fs.file-max = 65536
-----------------
# sysctl -a
================
then add the following line inside
#vi /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
session required pam_limits.so ---> add this line
======Save N Quit==========
# reboot your computer
===========================
#ulimit -n ====> to check after reboot and should return 65536
set ulimit for current session if not set to 65536
===============
Boss it works enjoy.
U can get this on
http://www.ispexperts.com.np/?p=535