2

I want to increase the ulimits and used the commands for it

ulimit -n
1024
ulimit -n 10000
bash: ulimit: open files: cannot modify limit: Operation not permitted

After lot of searching. I got a my links but By taking the reference of this link I just follow each and every command in the terminal but can't increase the ulimit in the system why and How will I do it Can anybody please explain this.

misha
  • 21
  • Your question and title don't seem to match. Can you fix either or explain the relation, please? It would also be helpful if you pasted those exact commands you ran directly into your question, together with their output, if there was any. Did you actually log out or reboot after changing these values, as described in your link? – Byte Commander Oct 16 '18 at 11:02
  • Welcome to Ask Ubuntu!! try use it as root, and type ulimit -n 20000 and check it using ulimit -a – abu-ahmed al-khatiri Oct 16 '18 at 11:03
  • from logout or reboot your mean close the terminal and reopen it again?@ByteCommander – misha Oct 16 '18 at 11:08

1 Answers1

1

Did you try without Sudo or Root privileges? Also -

There are two kinds of limits:

  • Soft limits are simply the currently enforced limits

  • Hard limits mark the maximum value which cannot be exceeded by setting a soft limit

Soft limits could be set by any user while hard limits are changeable only by root. Limits are a property of a process. They are inherited when a child process is created so system-wide limits should be set during the system initialization in init scripts and user limits should be set during user login for example by using pam_limits.

There are often defaults set when the machine boots. So, even though you may reset your ulimit in an individual shell, you may find that it resets back to the previous value on reboot. You may want to grep your boot scripts for the existence ulimit commands if you want to change the default.

Shaze
  • 386
  • 1
  • 7
  • with sudo commands it gives the error of command not find and with root it does not found – misha Oct 16 '18 at 11:21
  • sorry my bad, try without sudo and without root. try just ulimit -n 1025 and check? – Shaze Oct 16 '18 at 11:31
  • i want to increase it to 10000 not to 1025 – misha Oct 16 '18 at 11:34
  • it works for me, I really dont know why it doesn't work for you. I just tried ulimit -n 10000 Just press CTRL+D and log back into shell and try? – Shaze Oct 16 '18 at 11:45
  • 1
    If you are using Linux and you got the permission error, you will need to raise the allowed limit in the /etc/limits.conf or /etc/security/limits.conf file (where the file is located depends on your specific Linux distribution).

    For example to allow anyone on the machine to raise their number of open files up to 10000 add the line to the limits.conf file.

    • hard nofile 10000

    Then logout and relogin to your system and you should be able to do:

    ulimit -n 10000

    without a permission error.

    – Shaze Oct 16 '18 at 11:48