Tag Info

Hot answers tagged

11

No but you should close all active sessions windows. They still remember the old values. Every remote new session or a local secure shell take effect of the limits changes.


11

You can throttle a pipe tar -cf - . | throttle -M 1 | tar -C /your/usb -xvf - -b -k -m limits are in bits -B -K -M are bytes


9

I would assume you are trying not to disrupt other activity. Recent versions of Linux include ionice which does allow you to control the scheduling of IO. Besides allowing various priorities, there is an additional option to limit IO to times when the disk is otherwise idle. The command man ionice will display the documentation. Try copying the file ...


9

While it can be an abuse for memory, it isn't for CPU: when a CPU is idle, a running process (by "running", I mean that the process isn't waiting for I/O or something else) will take 100% CPU time by default. And there's no reason to enforce a limit. Now, you can set up priorities thanks to nice. If you want them to apply to all processes for a given user, ...


7

The pam_limits.so module can help you there. It allows you to set certain limits on specific individual users and groups or wildcards or ranges of users and groups. The limits you can set are typically ulimit settings but also on the number of concurrent login sessions, processes, CPU time, default priority and maximum priority (renice). Check the ...


6

The easiest way is using systemd which may be responsible for your sshd anyway (depending on the distribution). You can easily configure the limits in the sshd unit file. systemd puts all services in separate cgroups anyway. Without systemd the easiest solution is probably a modification to the sshd start script (pay attention that it's not overwritten by ...


5

ulimit -n sets the soft limit by default; you can add the -H option to view/set the hard limit. For the most part, soft and hard limits behave like this: root's processes (actually, any process with CAP_SYS_RESOURCE) may raise or lower any limit on any process. any user's processes may lower any limit on other processes owned by that user. any user's ...


5

Your problem is probably not with your computer, per se, it's probably fine. But that USB flash transition layer has a processor of its own that has to map out all of your writes to compensate for what could be as much as a 90% faulty flash chip, who knows? You flood it then you flood your buffers then you flood the whole bus, then you're stuck, man - after ...


5

If the ionice solution is not enough (whyever) and you really want to limit I/O to an absolute value there are several possibilities: the probably easiest: ssh. It has a built-in bandwidth limit. You would use e.g. tar (instead of cp) or scp (if that's good enough; I don't know how it handles symlinks and hard links) or rsync. These commands can pipe their ...


5

iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 15 --connlimit-mask 32 -j REJECT --reject-with tcp-reset will reject connections above 15 from one source IP. sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -m limit --limit 150/second --limit-burst 160 -j ACCEPT In this 160 new connections (packets really) are ...


5

He's saying it's bound by a 64-bit type, which has a maximum value of (2 ^ 64) - 1 unsigned, or (2 ^ 63) - 1 signed (1 bit holds the sign, +/-). The type is not FILE; it's what the implementation uses to track the offset into the file, namely off_t, which is a typedef for a signed 64-bit type.1 (2 ^ 63) - 1 = 9223372036854775807. If a terabyte is 1000 ^ ...


5

There is big difference between them. ulimit -e only set the RLIMIT_NICE, which is a upper bound value to which the process's nice value can be set using setpriority or nice. renice alters the priority of running process. Doing strace: $ cat test.sh #!/bin/bash ulimit -e 19 Then: $ strace ./test.sh ................................................... ...


4

Please note that lsof | wc -l sums up a lot of duplicated entries (forked processes can share file handles etc). That number could be much higher than the limit set in /proc/sys/fs/file-max. To get the current number of open files from the Linux kernel point of view, do this: cat /proc/sys/file/file-nr Example: This server has 40096 out of max 65536 open ...


4

The settings specified in /etc/security/limits.conf are applied by pam_limits.so (man 8 pam_limits). The pam stack is only involved during the creation of a new session (login). Thus you need to log out and back in for the settings to take effect.


4

As someone who is using a btrfs filesystem with Arch Linux for almost 2 years now I can safely say that there does not seem to be a practical limit on the number of snapshots that can be easily reached. There are some caveats though. btrfs filesystem can lead to fragmentation. It is therefore advisable to use the online defragmentation feature built into ...


4

Did you look at cgroups? There is some information on the Arch Wiki about them. Read the section about cpu.shares, it looks like it's doing what you need, and they can operate on a user-level, so you can limit all user processes at once.


4

The value can only be extended up to a theoretical maximum of 32768 for 32 bit systems or 4194304 for 64 bit.


3

While I don't know of a way to limit the number of processes by name, you may be able to accomplish your overall goal via pam_limits by limiting the number of user logins. An entry in /etc/security/limits such as @remotes hard maxlogins 5 will ensure that the users of the remotes group cannot have more than 5 login sessions on the ...


3

You can start the Dropbox executable under trickle. This is a simple program that limits the bandwidth used by the program that it starts. trickle -u 42 dropbox.py


3

Limits are inherited from a parent process to its child processes. Processes running as root can change limits arbitrarily; other processes cannot increase hard limits. Thus the hard limits set by the login process affect all the processes in a session. If you change /etc/security/limits.conf, this will affect all new sessions, and processes in these new ...


3

xargs One method that I'm aware of is to use xargs to find this information out. $ xargs --show-limits --no-run-if-empty < /dev/null Your environment variables take up 4791 bytes POSIX upper limit on argument length (this system): 2090313 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could ...


3

pv doesn't know about the system power states. All it sees is that the clock changed by a very large amount at some point. My guess is that pv doesn't care if the amount of time between two clock readouts suddenly gets large and just calculates the throughput based on the time interval. Since the interval is very large, it appears that the throughput is ...


3

You need to use the connlimit modules which allows you to restrict the number of parallel TCP connections to a server per client IP address (or address block). /sbin/iptables -I INPUT -p tcp --syn --dport 80 -m connlimit \ --connlimit-above 10 -j DROP


2

You can also use the ulimit command to change the values in your current shell. However, hard limits can only be adjusted downwards unless you're root. Example: # ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending ...


2

fs.file-nr represents the number of allocated file handles, the number of allocated but unused ones, and the maximum number of file handles, which is read-only. However the third field can be modified through fs.file-max instead. # sysctl -w fs.file-max=131072


2

There's a good chance that the default values are already set to reasonable values that will support most if not all use cases, they would be based on values found to be needed by running systems used by the OpenBSD developers and admins over the years of development and usage. I believe any limits would be programatically enforced and only truly limited by ...


2

Using renice without sudo would be impossible. I quote from the renice(1) man page: Users other than the super-user may only alter the priority of processes they own, and can only monotonically increase their ``nice value'' (for security reasons) within the range 0 to PRIO_MAX (20), unless a nice resource limit is set (Linux 2.6.12 ...


2

Open files are managed by a structure in kernel memory that handles the inode reference in-memory. They also track the opening mode of the file, the location in the file, as well as a cache. AFAIK in most UNIX/Linux systems, that structure cannot be swapped out, and as the storage size is usually larger in an order of magnitude or two than the memory, ...



Only top voted, non community-wiki answers of a minimum length are eligible