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 [limit]

Limiting the usage of a resource (memory, disk space, CPU time, open files, network bandwidth, …) by a process or a group of processes.

1
vote
0answers
28 views

Limit container resources both using --memory and --cgroup-parent

I'd like to limit both total memory consumption for a group of containers as well as memory consumption for a particular container. Say, a container is allowed to consume not greater than 1Gb and all ...
0
votes
1answer
15 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. ...
5
votes
1answer
62 views

dash maximum variable length under systemd

I have a shell script that uses a single variable as an associative array (one KEY=VALUE per line). Throughout the execution of the script, the variable is manipulated to add, remove or modify ...
1
vote
1answer
47 views

Change max line length of GNU parallel

The following command: parallel --max-line-length-allowed returns 131049. Is this a constant, or can I somehow change this limit?
1
vote
1answer
35 views

Limit on continuously writing to a log file

I am using Debian running on a BeableBone Black with 4GB of internal flash storage. My program is continuously writing / appending to a log file that I created with >> every minute, all day ...
0
votes
1answer
164 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, ...
0
votes
1answer
243 views

Download error with youtube-dl and axel

I am trying to download following video: https://www.youtube.com/watch?v=pQWj2Fgxdrc by combining 'youtube-dl' and 'axel'. I am trying to download this video in such a way that I want these two ...
0
votes
0answers
35 views

Limit TCP connections per second for different IP addresses [attacked with 1000 connections with different IP] [duplicate]

How to limit TCP connections per second for different IP addresses? I'm looking for limit per second for different IP's on 25565 port. Limit max connections per IP address and new connections per ...
2
votes
1answer
519 views

How to limit a systemd service to “play nice” with the CPU?

I have a systemd service (a CI runner) that tends to bog the system down with very CPU intensive jobs. I caught the load average flying over 100 just now and want to put a stop to that nonsense. ...
2
votes
0answers
119 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 ...
1
vote
0answers
15 views

Launch a program to only specific resources

Question: How can I launch a program such that it only uses X ram and Y CPU cores, etc? I happen to be using Ubuntu in this case, but since I often am on other distros, I need a general GNU/Linux ...
1
vote
0answers
191 views

What is the maximum open files limit?

I'm working on a reasonably large project, and recently had to bump the nofile setting above 500,000. I tried to change it to five million in /etc/security/limits.d/99-users-nofile.conf, but ...
4
votes
1answer
9k views

max no of tcp connections on a linux system

I know that /etc/security/limits.conf provides the persistent soft and hard limits for several values. However, in the relevant list there is no indication about imposed limits on: a) concurrent ...
0
votes
1answer
220 views

cgroups: Is it possible to limit cpu usage by process name instead of by pid

As we know, cgroups can limit cpu usage of processes. Here is an example: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30142 root 20 0 104m 2520 1024 R 99.7 ...
1
vote
2answers
103 views

Preventing un tar from using too much CPU

I am running un tar i.e tar xzvf abc.tar.gz on Beaglebone green. This seems to be using too much CPU. When a untar operation is in progress, i see via top command the CPU usage.. not sure why it seems ...
0
votes
1answer
55 views

Is there a way to restrict the application access to the system time in linux?

Is there a way to restrict the application access to the system time in linux? I want to make the application launch as much as possible abstracted from the environment. If you can restrict access to ...
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 ...
1
vote
0answers
147 views

Where does a bash process get its default signal handlers/traps?

From https://stackoverflow.com/questions/50606753/do-getrlimit-and-setrlimit-work-by-reading-from-and-writing-to-etc-sec#comment88227414_50607042 Bash doesn't have a special handler for SIGQUIT ...
0
votes
1answer
340 views

Limiting RAM for a group of users on Ubuntu Machine

I have a gpu based system. Multiple users use the system, as a result, the RAM frequently gets fully utilized leaving no memory for myself. I want to put a maximum RAM limit on all the users except ...
0
votes
0answers
290 views

Limit directory size in a Docker container

I have a web application in a Docker container. I need to limit maximum size of some of its directories. When I was not using Docker, I just created disk partitions of the limit size and put those ...
2
votes
0answers
318 views

scp : -l option (bandwidth limiting) doesn't work when scp-ing from a remote server to another remote server

If I do : $ scp -l 1024 remote1:/path/to/file remote2:/path/to/destination I can see, using nload on remote1, that the bandwidth used by scp isn't limited to 1024 kbits/s like I thought. I found a ...
1
vote
0answers
65 views

Using a large number of nullfs mounts to create a virtual FS on FreeBSD - what are the practical limits + impacts?

I have a situation where I'm possibly going to create a virtual file system on FreeBSD, comprised entirely of nullfs mounts of selected "ordinary" dirs within my various ZFS datasets (and their ...
2
votes
2answers
2k views

How to limit the number of open files for nfsd with systemd

It's fairly straightforward to control open file limits for many services with systemd: You create a file at /etc/systemd/system/$service_name.service.d/limits.conf, add a [Service] section with ...
2
votes
0answers
99 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 ...
1
vote
0answers
156 views

How to check the shell of a running process?

I am working on Solaris 11 zone and I need to check which shell a running process is using. I have the PID but I am not sure where to get the information from. I have a scenario where some resource ...
2
votes
3answers
7k 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 ...
2
votes
2answers
3k views

What is maximum number of files you can store in a tar archive under Solaris 11?

I need to store a large number of files (> 100,000) in a tar archive and have run into the error: /bin/sh: /bin/tar: cannot execute [Arg list too long]. Are there limits with UNIX Solaris tar or GNU ...
1
vote
0answers
167 views

how to let aufs use more than 127 layers? or an alternative to it

I came to the conclusion that aufs is limited to 127 layers based on tests. (prepare) mkdir write joined {1..400} for((i=1;i<=400;i++));do echo >$i/$i.txt;done #for checks using a single ...
0
votes
0answers
19 views

how to make a memory hungry application cause swap slowness only to itself? [duplicate]

I have 6GB RAM and 10GB swap. Some applications dare to consume/allocate/use about 5GB to 6GB of RAM. When the memory completely fills out, the whole system hangs for 1 to 2 minutes to swap all ...
19
votes
3answers
2k views

Get over 2 GB limit creating PDFs with ImageMagick

I am using convert to create a PDF file from about 2,000 images: convert 0001.miff 0002.miff ... 2000.miff -compress jpeg -quality 80 out.pdf The process terminates reproducible when the output file ...
0
votes
1answer
834 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
88 views

Truncate if necessary when moving file to filesystem with shorter NAME_MAX

I want to move veryverylongfilename.txt to a filesystem which has a short NAME_MAX. mv veryverylongfilename.txt /mnt/tiny gives me an ENAMETOOLONG-type error: mv: cannot stat '/mnt/tiny/...
3
votes
1answer
675 views

System wide environment variable gets truncated

On Ubuntu 16.10, I set a system wide environment variable in /etc/environment file. The variable is a string that has a length of thousands of characters (the string is a comma-separated list of small ...
2
votes
2answers
363 views

Max out file descriptors

I wish to write a script that will use up all of the available file descriptors on my Linux machine. I am unsure how exactly to do this, or if it is even possible? But I wish to use this script for a '...
1
vote
1answer
857 views

Do files opened by child processes count against the file open limit for the parent process?

On Mac or Linux if you use the command ulimit -n you can see the page open limit for what seems to be an individual process according to this stackoverflow post. So if a parent process spawns child ...
18
votes
2answers
3k views

Why is socket path length limited to a hundred chars?

On Unix systems path names have usually virtually no length limitation (well, 4096 characters on Linux)... except for socket files paths which are limited to around 100 characters (107 characters on ...
0
votes
1answer
2k views

Ulimit values in limits.conf vs 20-nproc.conf

In a CentOS/RHEL machine, the limit of user processes can be defined in /etc/security/limits.conf as well as in /etc/security/limits.d/20-nproc.conf What is the difference in those two values ...
1
vote
1answer
1k views

Curl parallel download file list

first post sorry if I did some mess here =) Using Ubuntu 14.04lts 64bits server version. I have a list (url.list) with only URLs to download, one per line, that looks like this: http://domain.com/...
6
votes
2answers
9k views

/etc/security/limits.conf not applied

I have /etc/security/limits.conf, that seems not been applied: a soft nofile 1048576 # default: 1024 a hard nofile 2097152 a soft noproc 262144 # default 128039 a hard noproc 524288 Where a is my ...
2
votes
2answers
1k views

Time limit for bash script

I have bash script and I would like to set time limit for it. For example if scripts runs longer than 50s, exit with 0. It should be done inside script, I can not change the command how script is ...
5
votes
0answers
303 views

Limiting per process dirty bytes without slowing down the whole system

Given a busy system with a really fast block device (highend NVMe raid, 2 GB/s write, 4 GB/s read) mounted at /data and an a really slow device (USB HDD with spinning 8 TB disk, 50 MB/s write, 60 MB/s ...
2
votes
2answers
1k views

Command line length limit: built-in vs executable

So per POSIX specification we have the following definition for *: Expands to the positional parameters, starting from one, initially producing one field for each positional parameter that is set....
8
votes
1answer
21k views

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

I tested this on different GNU/Linux installations: perl -e 'while(1){open($a{$b++}, "<" ,"/dev/null") or die $b;print " $b"}' System A and D The first limit I hit is 1024. It is easily raised ...
2
votes
1answer
1k views

Setting a long environment variable breaks a lot of commands

I've been seeing a strange behavior when messing up with the environment variables. I'm setting up a very long environment variable and this prevent launching any command: ( Ubuntu 14.04.5 LTS (GNU/...
0
votes
0answers
98 views

CentOS 7 tweaking sshd config to access the machine no matter how busy its

When CentOS 7 free memory goes below 200 MB, it become unresponsive even to ssh connection. Currently I have many machines not accessible remotely in peak time due to free memory being between 80 MB ...
1
vote
3answers
3k views

How to kill the processes when no root permission and nproc limit exceeded?

So, a user had exceeded her nproc limit. Due to this, both SSH and su are unable to login as the target user. However, there is no accessible shell which is owned by the user. How can this be solved ...
1
vote
0answers
32 views

Made a mess at end of limits.conf file, will it still work? [closed]

I made a mess at end of limits.conf file in Linux, was supposed to just write: * - nofile 1000000 But I added Will everything still work as it should? If not, how can ...
4
votes
1answer
961 views

Why the following error occurs in the terminal while using linux commands?

The following error occurs while using the below commands.Guide me to overcome this issue. rpasa-vd1-363: cd /home/rpasa/DDEMO No more processes.
1
vote
1answer
236 views

Difference between behaviors of setrlimit and limit stack

I am seeing a difference of behavior when setting stack size from shell and from inside my c program. The issue is that I have a function which has a large set of local variables (large arrays). If I ...
2
votes
1answer
226 views

Limit number of program executions

Please help me to find out how to limit number of program concurrent executions. I mean, particular program can be ran only, for example 5 times at once. I know how to limit proccess number for user, ...