Artificial intelligent assistant

Can't set ulimit -n like I want to I just want to set ulimit -n (per process max open files) and for the setting to survive reboots, but it's proving difficult. I don't know where else to change things to allow it to be set. root@z:~# cat /etc/sysctl.conf | grep file-max fs.file-max = 2000000 root@z:~# cat /etc/security/limits.conf | grep nofile # - nofile - max number of open files * soft nofile 2000000 * hard nofile 2000000 root@z:~# sudo sysctl -p | grep file fs.file-max = 2000000 root@z:~# ulimit -n 2000000 -su: ulimit: open files: cannot modify limit: Operation not permitted root@z:~# whoami root strangley this lower setting on the other hand works: ulimit -n 1048576 Please let me know how to set per-process limit to 2000000 and for the setting to be maintained across reboots, I am on Ubuntu 18.04

# ulimit -n 1048576
# ulimit -n 2000000
bash: ulimit: open files: cannot modify limit: Operation not permitted
# sysctl fs.nr_open
fs.nr_open = 1048576
# sysctl fs.nr_open=2000000
fs.nr_open = 2000000
# ulimit -n 2000000
# ulimit -n
2000000


proc(5) man page:

> `/proc/sys/fs/nr_open`
> This file imposes a ceiling on the value to which the `RLIMIT_NOFILE` resource limit can be raised (see getrlimit(2)). This ceiling is enforced for both unprivileged and privileged process. The default value in this file is 1048576.

On the other hand, `file-max` is the limit for all process:

> `/proc/sys/fs/file-max`
> This file defines a system-wide limit on the number of open files for all processes. System calls that fail when encountering this limit fail with the error ENFILE.

Not that I have absolutely any idea if sufficiently large numbers of open files cause other problems.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy c4f3e33f07302dca74765d3ae20f51a7