Tag Info

Hot answers tagged

10

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


8

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 ...


8

Important is to know that there are two kinds of limit: hard limit is configurable by root only. This is the highest possible value (limit) for the soft limit. soft limit can be set by ordinary user. This is the actual limit in effect. Solution for a single session In the shell set the soft limit: ulimit -Sn 2048 This example will raise the actual ...


8

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.


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

Instead of cp -a /foo /bar you can also use rsync and limit the bandwidth as you need From the rsync manpage: --bwlimit=KBPS limit I/O bandwidth; KBytes per second and the final command: rsync -av --bwlimit=1 /foo /bar


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 ^ ...


4

Yes, there are such limits. They are called resource limits (rlimits). There are more then dozen different limits. For CPU time, for memory, for number of opened files etc. Kernel sends different signals to process, when process exceeds different limits. If process does not react properly, it will get killed. For each rlimit there are two values. First one ...


4

There are various ways to implement such a policy, but there is a fairly obvious reason why it does not exist by default in the first place: because the system is intended to be used to its maximum potential. By analogy: if you bought a car that could do 200 kph and it had a 100 litre tank, you probably would not want it controlled by software that limited ...


4

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 ...


4

There is no such tool because it does not make any sense from a single-program point of view. One can consider CPU/HDD/RAM/swap as resources. These resources can be shared in different ways by the operating system among processes, users, contexts, etc. In some specific situations, it makes sense to tell the operating system to enforce hard limits: Don't ...


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.


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

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 ...


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

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

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

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 ...


2

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 ...


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, ...


2

The problem is that the copy is filling up your memory with blocks "in flight," crowding out "useful" data. A known (and very hard to fix) bug in the Linux kernel handling of I/O to slow devices (USB in this case). Perhaps you can try to parcel out the copying, e.g. by a script like the following (proof-of-concept sketch, totally untested!): while true do ...


2

No, it is not possible to limit by process name, because the process name can be changed easily. So that limit could easily be evaded. (It can even be changed at runtime I think.)


2

All values is correct and have different meanings./proc/sys/kernel/pid_max is maximum value for PID, ulimit -u is maximum value for number of processes. From man 5 proc: /proc/sys/kernel/pid_max (since Linux 2.5.34) This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the ...



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