Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: limits.conf
PostPosted: Wed Jun 23, 2010 3:29 pm 
Offline
Senior Newbie

Joined: Wed Jun 23, 2010 11:22 am
Posts: 14
Hi,

I'm having a bit of a problem setting number open files limit - setting 'ulimit -n 65535' works, which tells me the kernel supports it, but it does not survive a reboot. When I put it in limits.conf it does not seem to have any effect

limits.conf:

* soft nofile 65535
* hard nofile 65535

It always worked on my other servers, but not on linodes for some reason...

Thanks!
Art


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:10 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
What is the result of
Code:
$ ulimit -a


Are you wanting to set a per process limit (ulimit -n), or set a limit allowed by the kernel (/proc/sys/fs/file-max)?

If you are wanting to set the maximum open file descriptors allowed by the kernel, then you need to do it in /proc/sys/fs/file-max. For example:
Code:
$ echo "65535" > /proc/sys/fs/file-max


You can check this the open and allowed file descriptors:
Code:
$ cat /proc/sys/fs/file-nr


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:18 pm 
Offline
Senior Newbie

Joined: Wed Jun 23, 2010 11:22 am
Posts: 14
the ulimit -a outputs this:

Code:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


the /proc/sys/fs/file-max contains some insanely large number...

I'm trying to set 'ulimit -n'


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:25 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
Ok. I'm not sure what to tell you... setting the /etc/security/limits.conf persists after a reboot on my servers. What version (OS/kernel) are you using?

Code:
$ cat /etc/security/limits.conf
*               soft    nofile          65535
*               hard    nofile          65535

Code:
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 8192
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 8192
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


Last edited by BrianJM on Wed Jun 23, 2010 4:26 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:26 pm 
Offline
Senior Newbie

Joined: Wed Jun 23, 2010 11:22 am
Posts: 14
Ubuntu 10.4 64
(Latest 2.6 Paravirt (2.6.34-x86_64-linode13)


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:37 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
Have you considered setting placing "ulimit -n 65535" inside /etc/bashrc?

Also, after modifying your /etc/security/limits.conf, did you issue a reboot? A reboot is required for that to have any effect.


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 4:44 pm 
Offline
Senior Newbie

Joined: Wed Jun 23, 2010 11:22 am
Posts: 14
yes, i did reboot and it says 1024...

wouldn't bashrc only have effect upon interactive login?

Thanks!
Art


Top
   
 Post subject: RESOLVED
PostPosted: Wed Jun 23, 2010 4:48 pm 
Offline
Senior Newbie

Joined: Wed Jun 23, 2010 11:22 am
Posts: 14
Ok, my bad. Ubuntu does not apply * wildcards to root, it must be explicit:

root soft nofile 65535
root hard nofile 65535


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2010 5:00 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
Yes, it would only have an effect after an interactive login.

I'm glad you got it worked out!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group