Operating System - Linux
1754921 Members
3039 Online
54826 Solutions
New Discussion юеВ

Re: How can you tell your current File-Max?

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

How can you tell your current File-Max?

Hi,

How do you tell what's your file-max setting? I've been doing this;
ulimit -a user
And I look for open files
Is ulimit and file-max are the same thing?

The default value of open files is 1024. No matter what I tried, the new value doesn't stick and goes right back in the default value 1024.

Any ideas?

Thanks,
Jorge
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: How can you tell your current File-Max?

Shalom,

ulimit displays soft limits that can be changed in the user profile. Some products will object but you can go with unlimited if you wish.

There is also a hard limit in the kernel, which is stored in /proc virtual filesystems.

To avoid limitations, you should change both.

Summary: Not the same thing.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Atul Gautam
Valued Contributor

Re: How can you tell your current File-Max?

Hi Jorge,

If you are running linux, then the limits can be set in the file ---

/etc/security/limits.conf

and also you will have to use "pam_limits" module.



--
Atul
Atul Gautam
Valued Contributor

Re: How can you tell your current File-Max?

And yes Jorge......

as SEP has suggested...the values should not be the same..



Atul
Atul Gautam
Valued Contributor

Re: How can you tell your current File-Max?

And yes Jorge......

as SEP has suggested...the values should not be the same..

And the file /etc/security/limits.conf will itself provide with enough information.



--
Atul
Atul Gautam
Valued Contributor

Re: How can you tell your current File-Max?

And yes Jorge......

as SEP has suggested...the values should not be the same..

And the file /etc/security/limits.conf will itself provide you with enough information for setting up these options.



--
Atul
Jorge Cocomess
Super Advisor

Re: How can you tell your current File-Max?

Hi,

I tried setting that up from the /etc/security/limits.conf -- After I made the changes to the limits.conf, I also manually made changes to the user, and here's the command that I used:
su - user
ulimit -n 65536 user


As soon as I exit and log back in and display the ulimit of that user, I still see the open files set at 1024.

The setting doesn't stick.

Where else should I look for?

Thanks,
J
Vitaly Karasik_1
Honored Contributor

Re: How can you tell your current File-Max?

there are two different limits:

1) system-wide limits. You can see/set them under /proc or using sysctl (/etc/sysctl.conf) interface

2) user limits - "ulimit" and /etc/security/limits.conf.
Under limits.conf you can set soft and hard limits. Regular user can increase his limit up to his hard limit.

In RH linux, for example, default for max open files 1) limit is 1024 and for 2) is 50978.

You, probably, want to increase "per user" limit - so edit /etc/security/limits.conf and ask use to relogin - you'll see new value in "ulimit".

Rgds,
Vitaly
Bob_Vance
Esteemed Contributor

Re: How can you tell your current File-Max?

NOTE that you can set limits globally (user=*) and per user:


rac2node1 ## grep -e '^[^#]' /etc/security/limits.conf
... oracle soft nproc 4000
... oracle hard nproc 20000
... oracle soft nofile 4000
... oracle hard nofile 63000




When you log in, the settings are set to the soft limit first.

*Then*, you can bump the particular limit up (max= hard limit), which may be and usually is done in the .{bash}_profile.

NOTE that a NON-root user can only bump it *up* once, but that he can bump it down as often as desired.

::::

rac2node1 ## su - oracle

rac2node1 $$ ulimit -a
... ...
... open files (-n) 4000
... max user processes (-u) 4000

rac2node1 $$ ulimit -n 63001
... -bash: ulimit: open files: cannot modify limit: Operation not permitted

rac2node1 $$ ulimit -n 63000

rac2node1 $$ ulimit -n
... 63000
rac2node1 $ ulimit -n 8888
rac2node1 $$ ulimit -n
... open files (-n) 8888

rac2node1 $$ ulimit -n 9999
... -bash: ulimit: open files: cannot modify limit: Operation not permitted

rac2node1 $$ ulimit -n 7777

rac2node1 $$ ulimit -n 6666

rac2node1 $$ ulimit -n
... 6666


hth
bv
"The lyf so short, the craft so long to lerne." - Chaucer