You are not logged in.

#1 2009-04-06 08:46:34

Rehto
Member
From: Finland
Registered: 2007-04-06
Posts: 41

[SOLVED] Problems changing the max open files attribute (ulimit)

I'm trying to change the max open files by
putting this line to /etc/security/limits.conf

<username> hard nofile 4096

but nothing changes ('ulimit -n' spits as 1024 as an answer).
I did try to logout and log back in and reboot the
system but no go sad

P.S. I also tried adding 'ulimit -n 4096' to ~/.bashrc
but then I get:

bash: ulimit: open files: cannot modify limit: Operation not permitted

so should I add it to the global profile file
(etc/profile right?) or to /root/.bashrc or what?

Last edited by Rehto (2009-04-06 12:08:32)

Offline

#2 2009-04-06 08:49:24

Rehto
Member
From: Finland
Registered: 2007-04-06
Posts: 41

Re: [SOLVED] Problems changing the max open files attribute (ulimit)

I tried adding ulimit -n 4096 to /etc/profile
and it worked (I went to tty1, logged in and the answer was 4096)
for awhile anyway but when I logged in to kde the value somehow
changed back to 1024 sad

Last edited by Rehto (2009-04-06 09:00:35)

Offline

#3 2009-04-06 10:15:23

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: [SOLVED] Problems changing the max open files attribute (ulimit)

Rehto wrote:

I tried adding ulimit -n 4096 to /etc/profile
and it worked (I went to tty1, logged in and the answer was 4096)
for awhile anyway but when I logged in to kde the value somehow
changed back to 1024 sad

Try restarting kdm (or the entire PC)

Offline

#4 2009-04-06 11:25:31

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: [SOLVED] Problems changing the max open files attribute (ulimit)

Rehto wrote:

I'm trying to change the max open files by
putting this line to /etc/security/limits.conf

<username> hard nofile 4096

but nothing changes ('ulimit -n' spits as 1024 as an answer).
I did try to logout and log back in and reboot the
system but no go sad

set the soft limits first. smth like:

<your_name>     soft    nofile      4096
<your_name>     hard    nofile      4096

ulimit always uses the soft resource limit first. hard limits kills the application then, if it goes mad.

vlad

ps: logout then login again...

Last edited by DonVla (2009-04-06 11:25:56)

Offline

#5 2009-04-06 12:07:57

Rehto
Member
From: Finland
Registered: 2007-04-06
Posts: 41

Re: [SOLVED] Problems changing the max open files attribute (ulimit)

Thanks fackamato that was it! And vlad, I did also set
the soft limits in /etc/security/limits.conf. I'll mark this
as solved smile

Last edited by Rehto (2009-04-06 12:08:12)

Offline

Board footer

Powered by FluxBB