Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ulimit]

All about resource limits that can be set with the ulimit command

0
votes
1answer
13 views

Setting soft limit above hard does not fail in terms of exit code?

root@Andromeda:/# ulimit -n -S 2048 root@Andromeda:/# ulimit -n -H 2048 root@Andromeda:/# ulimit -n -S 4096 2048 root@Andromeda:/# echo $? 0 Failure to set soft limit above the hard one makes sense. ...
0
votes
0answers
15 views

No locks available

I am using ssh logging on a remote server and ran a parallel computing application. I use htop to monitor the CPU usage. But after running a long time, htop exit and shows: htop: too may open files ...
0
votes
1answer
29 views

Maximum value for /proc/sys/fs/file-max

Today my server crashed with Too many open files in system: but I already have high values, what is a maximum value for this? I feel like there aren't good results on google for this, explaining ...
1
vote
0answers
35 views

Limit memory usage for a single Linux process with only a function?

This is a shell script with a function timeout() to limit the CPU time usage for a single process. Is it possible to limit memory usage for a single Linux process with a similar function? #!/bin/bash ...
0
votes
0answers
22 views

Process only takes 50% of RAM on Debian [duplicate]

I have a program in python which takes lots of ram. My server has 16gb of ram, but when the program reaches ~8gb of ram, the os starts writing on disk which breaks performance. I want the process I'm ...
1
vote
1answer
38 views

shellcheck: “In POSIX sh, ulimit -H is not supported”

I am using shellcheck to fix warnings in a sh script. The script checks for the hard fd limit with: ulimit -H -n It sets the soft fd limit with: ulimit -n "$MAX_FD" This generates the shellcheck ...
0
votes
0answers
8 views

Concurrent requests from node.js process are far too slow - is the OS limiting them

I have a node.js script, it makes a http request to a url N number of times using two different techniques. First it does it serially, then it does it using the node.js Promise api (all the requests ...
0
votes
1answer
97 views

Open file limits not increased for redis user despite change in /etc/security/limits.conf

I got ERR max number of clients reached from my redis server so I decidied to increase the allowed max client connections in its configuration. This also requires according to the documentation, ...
1
vote
2answers
41 views

Prevent the machine being slowed down by running out of memory

My software runs a command that looks something like: find | xargs do a potentially memory hungry job The problem is that sometimes a potentially memory hungry job gets too hungry, the system gets ...
1
vote
2answers
39 views

Who would win, RLIMIT_NPROC or user namespaces?

Depending on configuration, unprivileged (non-root) processes can create a user namespace. RLIMIT_NPROC limits the number of processes per user. If I enter a user namespace, can I create processes ...
1
vote
0answers
93 views

Restart a process if cpu usage is more than 90% for more than a 60sec

Normally one of my systemd services will take about 0...5% cpu Usage. In some cases it can reach up to 100% but only for some seconds. If the Service "crashes" it takes up to 100% continuously. So I ...
0
votes
1answer
157 views

What level is the value `ulimit -n`mean? user level or process level? [duplicate]

I want to increase the ulimit -n value,so I add * soft nofile 20000 * hard nofile 20000 in the /etc/security/limits.conf file, but there is a question confuse me all the time. what ...
3
votes
0answers
49 views

What are the differences between process data segment and resident set size? [duplicate]

I searched how to limit memory usage for a single process and found 3 results,ulimit -d, -m and -v, which stand for data seg size(process's data segment), max memory size(resident set size) and ...
1
vote
1answer
42 views

mixed results from the same command (related to ARG_MAX) [duplicate]

I'm asking a question based on this link How to cause "Argument list too long" error? From the thread, I'm seeing the equivalent error, if i'm running this: >/bin/echo `perl -e 'print "...
0
votes
1answer
603 views

Why ulimit -n modifies hard limit

Checking open files (soft) limit on current shell /home/pkaramol $ ulimit -n 1024 Checking hard limit /home/pkaramol $ ulimit -n -H 1048576 Setting (soft) limit to hard limit value and verifying ...
0
votes
1answer
140 views

ulimit configuration explanation of different types

I am setting several ulimits (system is rhel 7.5) and i can't find any clarification on the values of type. From inside the /etc/security/limits.conf i get that type can get two values while in the ...
53
votes
3answers
10k views

Why can't I crash my system with a fork bomb?

Recently I've been digging up information about processes in GNU/Linux and I met the infamous fork bomb : :(){ : | :& }; : Theoretically, it is supposed to duplicate itself infinitely until the ...
-1
votes
2answers
368 views

Beyond ulimit limit [duplicate]

I execute below command: ulimit -a And it gives output as: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size ...
0
votes
1answer
1k views

How to permanently Set/change the Limits in Solaris 10 system wide

I received email from oracle to change the limit on solaris 10 server to make oracle application work, unfortunately i have no experience in Solaris, so need assistance Values will be like below ...
0
votes
1answer
191 views

How to make sure nproc values are taking effect for all the users?

In the /etc/security/limit.conf file I have added the following values: user1 - nproc unlimited user2 - nproc unlimited Both user1 and user2 have sudo privileges and I ...
13
votes
4answers
5k views

How to cause “Argument list too long” error? [duplicate]

Context for the question: According to POSIX specs, ARG_MAX is maximum length of command-line arguments to exec() family of functions. Which lead me to believe that's actual number of arguments, ...
1
vote
2answers
3k views

getting 'Operation not permitted' error when setting ulimit for memlock in a Docker container running ubuntu:xenial (macOS host)

I am having trouble setting the 'memlock' system limit in a container that I launch like this: docker run -it ubuntu:xenial Here is what I tried in a nutshell: In bash terminal session 1: ...
2
votes
1answer
2k views

Meaning of the values for ulimit memlock flag

When I run docker and use the --ulimit memlock=-1:-1 option, what do the soft/hard values of -1 mean? Does it mean that I am allowing an unlimited amount memory to be locked by this container/process?
2
votes
1answer
2k views

ulimit vs file-max

Could someone explain limit on open files in linux? The problem is that one of my applications if reporting "Too many open files". I have ulimit -n 1024 but cat /proc/sys/fs/file-max 6578523 and ...
0
votes
0answers
92 views

How can we write a script that generalize bash's ulimit to be a chain-loading utility?

In How can I change my command to run without superuser privilleges but with the changed limit value?, I found that I can run sleep 100 with changed core file size limit as sudo sh -c "ulimit -c ...
0
votes
1answer
295 views

Are the limits shown or set by ulimit per resource and per process?

Bash's ulimit concerns about limits on different kinds of resources. Is it correct a limit shown or set by ulimit is per-resource? Is each such limit the sum of the resources available to all the ...
3
votes
5answers
2k views

Why does the following way not change core file limit size?

To solve the problem in https://unix.stackexchange.com/a/446428/674, I followed https://stackoverflow.com/a/17483998/156458, but it doesn't set core file limit size? $ sudo sh -c "ulimit -c 1024 &...
2
votes
1answer
867 views

Is setting ulimit -v sufficient to avoid memory leak

We have a process that in recent weeks had a once-off memory leak that resulted in it consuming all memory on our RHEL 7 box We now wish to set limits around this such that it will never take any ...
4
votes
1answer
5k views

Where is the limit set? bash: fork: retry: No child processes

This: $ seq 100000 | xargs -P0 -n1 -I {} bash -c 'echo {};sleep {}' : 5514 bash: fork: retry: No child processes started complaining around 5500 when the system had 11666 processes running. Now, ...
0
votes
1answer
1k views

How can I automatically set the core dump size on a single user?

I am running OpenSUSE. I usually open the console with an interactive non-login shell bash, and frequently use tcsh after logon. I am writing some C code, compiling with gcc, and I'd like to have the ...
3
votes
1answer
5k views

Increase number of open files in mac high sierra [duplicate]

On a mac high sierra 10.13.3 I have 256 open files. I want to raise it and I open a terminal and enter sudo launchctl limit maxfiles 1000000 1000000 This doesnt change anything when I enter ulimit ...
3
votes
0answers
6k views

How to increase the maximum number of open files on Fedora?

I want to increase the maximum number of open files in Fedora 27, since the default settings are too low: $ ulimit -Sn 1024 $ ulimit -Hn 4096 First, I ensure that the system-wide setting is high ...
1
vote
0answers
378 views

Why did ulimit not stop my fork bomb that was running as the superuser?

I'm studying the fork bombs and I have some troubles to find a way to protect from this type of attack. As far as I know there are two possible solutions: ulimit cgroup I'm studying the first one on ...
1
vote
0answers
84 views

systemd resource management (specific case: mysql)

I have a problem tying to figure out, how the resource management in systemd works. To make clear where I am and how I got there, I should start with explaining my situation: After migrating a mysql-...
0
votes
0answers
53 views

System logging for: “unable to create new native thread” by JVM

OutOfMemoryException by whatever JVM service is a popular error message. What strives me is the fact it does not get logged somewhere in the system. Also the JVM does not report the underlying reason. ...
2
votes
0answers
86 views

How to check usage of mqueues reliably?

I run a testing server for a software that depends on the massive usage of mqueues (POSIX messages queues). I increased limits to a reasonable level and got it working a long time ago. However, the ...
0
votes
1answer
33 views

concurrent max process limit when gnuparallel used in unix

I am using gnu parallel to fire some concurrent process. Below is the command am using. parallel 'node /home/parunkarthick/NodeProject/nodescript_pd.js F_CHARGES' ::: 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
0
votes
1answer
996 views

How can a process have a higher open file descriptors limit than that set by the hard limit?

I am using Solaris 11 and it is my understanding that a non-privileged user can increase or decrease the soft limit of maximum open file descriptors while staying within the hard limit. It is also ...
0
votes
2answers
473 views

Set Limit on File Size Across Entire System

I am trying to set the limit on files to be 10GB across the entire system. When ulimit -f is run, I get back unlimited. When ulimit -a is run, I see that the units of file size are blocks. How do ...
3
votes
1answer
911 views

Figure out which process forks too many threads

I have a process in a Linux installation that at some point has some kind of spike and passes the max allowed number of threads/processes allowed by the system. I found this by checking ps -elfT | wc -...
2
votes
3answers
6k views

Increasing open files limit for all processes: Do I need to set Soft/Hard limits?

I'm trying to fix the following error that I get after a day or two of running my game server. 2017/12/13 12:08:35 http: Accept error: accept tcp [::]:8081: accept4: too many open files; retrying in ...
1
vote
1answer
276 views

process is not using new open file configuration which I have set?

I have a process which is running as golden user and I am trying to increase the open file limit for that user so that all the process that gets started up by that user, it should uses that settings. ...
2
votes
1answer
203 views

ulimit on a Specific Directory

I know about ulimit, which is used to set the size of the maximum file size, but this setting is global on the server. Is there a way to set a limit to the file size per directory? For example, I want ...
0
votes
1answer
783 views

RHEL setting a user specific max number of open files

I've set up below values in /etc/security/limits.conf in my RHEL machine. * hard nofile 65535 @student hard nofile 100000 Is this the correct approach when setting a user specific max number of ...
1
vote
1answer
4k views

Debian 9.1 - system is ignoring ulimit for maximum open files for rtorrent

For testing purposes i even raised root's limit. # /etc/security/limits.conf * soft nofile 65535 * hard nofile 65535 root soft nofile ...
4
votes
2answers
5k views

Systemd LimitNOFILE capped to 4096

I have a systemd user service with LimitNOFILE set. The value is respected until it hits 4096. After that point, it's capped to 4096. I've also tried increasing DefaultLimitNOFILE in /etc/systemd/user....
6
votes
1answer
2k views

What's the difference between setting open file limits in /etc/sysctl.conf vs /etc/security/limits.conf?

I've read two separate ways of increasing the allowed open file count (I'm attempting to modify for root, if it matters). One way is to update the settings in /etc/security/limits.conf with something ...
2
votes
2answers
2k views

How to run ulimit in a script with other application

We have following script (in CentoS 6) in our lab to execute our applications with its output one-by-one. cd A/ sleep 1 gnome-terminal -t A --tab -e "./app1" cd ../B/ sleep 1 gnome-terminal -t b --...
3
votes
0answers
340 views

What does cgroups provider over ulimit?

Why were cgroups created when the setrlimit and getrlimit system calls already existed? I thought it might be that rlimit only applies to a single process, but the man page states: Limits on the ...
1
vote
1answer
747 views

How to set resource limits for services started by systemd upon bootup

I understand that ulimit is a bash builtin that allows us to change resource limits for a shell and the children spawned from that shell. For limit changes applicable to all logged in users I believe ...