Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ulimit -n dose not works #4575

Closed
19317362 opened this issue Oct 5, 2019 · 5 comments
Closed

ulimit -n dose not works #4575

19317362 opened this issue Oct 5, 2019 · 5 comments

Comments

@19317362
Copy link

19317362 commented Oct 5, 2019

$ uname -a Linux DESKTOP-RF30NLI 4.19.72-microsoft-standard #1 SMP Sun Sep 15 10:03:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
$ ulimit
unlimited
$ ulimit -n
1024
$ 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) 124007
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) 124007
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ ulimit -n
1024
$ ulimit -n 1023
$ ulimit -n 1023
$ ulimit -n 8000
-bash: ulimit: open files: cannot modify limit: Operation not permitted
$ ulimit -n 1024 -bash: ulimit: open files: cannot modify limit: Operation not permitted
$

@therealkenc
Copy link
Collaborator

Linux behavior.

image

@hundanLi
Copy link

So how to solve this problem?

@therealkenc
Copy link
Collaborator

If a process could increase its own limit, it wouldn't be much of a limit, would it.

You possibly want:

$ mylimit=8000
$ sudo prlimit --nofile=$mylimit --pid $$; ulimit -n $mylimit

n.b. Support for process limits on WSL1 is... limited.

@hundanLi
Copy link

Thanks a lot!

@crazyoptimist
Copy link

sudo prlimit --nofile=8000 --pid $$; ulimit -n 8000

That solved my problem, thanks.

Can you explain what it does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants