Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
7
votes
1
answers
2794
views
What is ionice `none: prio 0` equivalent to?
The ionice manual states that: > Note that before kernel 2.6.26 a process that has not asked for an io > priority formally uses "none" as scheduling class, but the io > scheduler will treat such processes as if it were in the best effort > class. The priority within the best effort class will be dyn...
The ionice manual states that:
> Note that before kernel 2.6.26 a process that has not asked for an io
> priority formally uses "none" as scheduling class, but the io
> scheduler will treat such processes as if it were in the best effort
> class. The priority within the best effort class will be dynamically
> derived from the cpu nice level of the process: io_priority =
> (cpu_nice + 20) / 5.
>
> For kernels after 2.6.26 with CFQ io scheduler a process that has not asked for an io priority inherits CPU scheduling class. The io
> priority is derived from the cpu nice level of the process (same as
> before kernel 2.6.26).
I am post 2.6.26, but that still leaves some open questions (I'm assuming CFQ):
1. What is the inheritance mapping for the scheduled class? Does TS SCHED_OTHER = Best Effort (io class 2)?
2. When using the ionice -p command to get the value, it returns
none: prio 0
. However, the formula mentioned in the ionice man would suggest that the same process (cpu nice of zero) would be best-effort: prio 4
since (0 + 20) / 5 = 4.
So my assumption at this point is that none: prio 0
= best-effort: prio 4
, but I'm hoping someone can cite some kernel source in order to prove that this is authoritatively true.
Kyle Brandt
(872 rep)
Aug 7, 2013, 05:26 PM
• Last activity: Apr 10, 2025, 11:01 PM
0
votes
1
answers
531
views
Set highest CPU and IO priority for a systemd service
How to set CPU and IO priority for a systemd service? In partucular, how to set the highest values? (Assume that the service is idling most of the time and will absolutely NOT clog the rest of the system. Assume that the request is intentional and desired.)
How to set CPU and IO priority for a systemd service? In partucular, how to set the highest values?
(Assume that the service is idling most of the time and will absolutely NOT clog the rest of the system. Assume that the request is intentional and desired.)
VasyaNovikov
(1527 rep)
Dec 22, 2024, 06:27 PM
0
votes
0
answers
163
views
System starts to freeze when copying large amounts of data
OS is Debian 12. Got a brand new disk to use as a backup for a disk currently in use. For the initial rsync, my system starts to lag and freeze for maybe half a second at a time. This is especially noticeable when playing back audio. Load average jumps from ~5 to ~15 during the rsync. What is going...
OS is Debian 12. Got a brand new disk to use as a backup for a disk currently in use. For the initial rsync, my system starts to lag and freeze for maybe half a second at a time. This is especially noticeable when playing back audio.
Load average jumps from ~5 to ~15 during the rsync. What is going on here? I know it's rsync because the instant I kill the process, audio playback goes back to normal.
Trying to run with lowest cpu priority and lowest io priority like so:
sudo nice -n 19 ionice -c 3 rsync -a --sparse --delete --info=progress2 /mnt/src/ /mnt/dest
Running with sudo as a few files are owned by root and I want to be sure those get copied.
How can I run rsync so my system doesn't freeze?
Also I know it's not an issue with these specific disks, as I have tried other combinations of disks and I get the same issue. I also had this same problem on my older system, which used entirely different disks and motherboard.
cat pants
(167 rep)
Jul 26, 2024, 09:57 PM
6
votes
1
answers
103
views
How useful is ionice tool with modern linux kernel
The `ionice` tool is supposed to offer relief on high I/O load by executing commands only when the system is in a specified state. The [man page](https://www.linux.org/docs/man1/ionice.html) states: > Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ I/O scheduler. Howev...
The
ionice
tool is supposed to offer relief on high I/O load by executing commands only when the system is in a specified state.
The [man page](https://www.linux.org/docs/man1/ionice.html) states:
> Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ I/O scheduler.
However CFQ I/O has been deprecated and removed from kernel since 5.3.
So what is the state of this utility? Does it actually work at all on modern kernels?
Additional piece of information
* ionice
uses kernel call ioprio_set
* The [documentation](https://www.man7.org/linux/man-pages/man2/ioprio_set.2.html) states:
> These system calls have an effect only when used in conjunction with an I/O scheduler that supports I/O priorities. As at kernel 2.6.17 the only such scheduler is the Completely Fair Queuing (CFQ) I/O scheduler.
Darko Miletic
(173 rep)
Mar 25, 2024, 08:05 PM
• Last activity: Apr 5, 2024, 05:41 PM
2
votes
1
answers
1033
views
How to set process to the lowest possible priority on Linux?
I want to set the process to the lowest possible scheduling on Linux. I came up with the following: nice -n 39 ionice -c 3 chrt -i 0 command Are there also other settings that one can set for a process to "lower" the process priority? Are these settings the "lowest" possible? More often than not, I...
I want to set the process to the lowest possible scheduling on Linux. I came up with the following:
nice -n 39 ionice -c 3 chrt -i 0 command
Are there also other settings that one can set for a process to "lower" the process priority? Are these settings the "lowest" possible?
More often than not, I do
make -j$(nproc)
or cmake
or heavy tar processes that take full available I/O, memory and CPU on my machine. What is really frustrating, is that my mouse starts lagging. So I want to prevent it.
KamilCuk
(970 rep)
May 13, 2023, 06:45 PM
• Last activity: May 13, 2023, 10:05 PM
22
votes
2
answers
10412
views
nice and ionice: which one should come first?
I need to run some long and heavy commands, but at the same time, I'd like to keep my desktop system responsive. Examples: btrfs deduplication, btrfs balance, etc. I don't mind if such commands take longer to finish if I give them a lower priority, but my system should always be responsive. Using `n...
I need to run some long and heavy commands, but at the same time, I'd like to keep my desktop system responsive.
Examples: btrfs deduplication, btrfs balance, etc. I don't mind if such commands take longer to finish if I give them a lower priority, but my system should always be responsive.
Using
nice -n 19
and ionice -c 3
should solve my problem, but I'm not sure which command should come first for maximum benefit.
* Option A:
nice -n 19 ionice -c 3 btrfs balance start --full-balance /
* Option B:
ionice -c 3 nice -n 19 btrfs balance start --full-balance /
Is there some subtle difference between options A and B? Are they equivalent perhaps?
user22304
Sep 5, 2017, 01:06 PM
• Last activity: Oct 26, 2022, 05:44 PM
9
votes
3
answers
8568
views
How to renice a group of processes?
`lb build` can build live system image, and it invokes many processes while building the image. If I start it as below: # nice -n 19 ionice -n 7 -c 3 lb build all the children processes get the same nice level: PID USER IORR IOWR IO IO PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 26196 morfik 0 0 0...
lb build
can build live system image, and it invokes many processes while building the image. If I start it as below:
# nice -n 19 ionice -n 7 -c 3 lb build
all the children processes get the same nice level:
PID USER IORR IOWR IO IO PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
26196 morfik 0 0 0 B4 20 0 23888 672 668 S 0.0 0.1 0:00.24 │ ├─ -bash
30926 root 0 0 0 B4 20 0 53668 536 536 S 0.0 0.1 0:00.02 │ │ └─ su -
31008 root 0 0 0 B4 20 0 34656 6260 1144 S 0.0 0.6 0:02.60 │ │ └─ -su
11784 root 0 0 0 ?? 39 19 4496 796 524 S 0.0 0.1 0:00.01 │ │ └─ /bin/sh /usr/lib/live/build/build
11797 root 0 0 0 ?? 39 19 4328 612 512 S 0.0 0.1 0:00.00 │ │ └─ /bin/sh ./auto/build
11806 root 0 0 0 ?? 39 19 7028 604 504 S 0.0 0.1 0:00.00 │ │ ├─ tee build.log
11798 root 0 0 0 ?? 39 19 4496 824 532 S 0.0 0.1 0:00.01 │ │ └─ /bin/sh /usr/lib/live/build/build noauto
11915 root 0 0 0 ?? 39 19 4496 836 544 S 0.0 0.1 0:00.01 │ │ └─ /bin/sh /usr/lib/live/build/bootstrap
12753 root 0 0 0 ?? 39 19 4496 856 548 S 0.0 0.1 0:00.02 │ │ └─ /bin/sh /usr/lib/live/build/bootstra
12867 root 0 0 0 ?? 39 19 62980 3508 2132 S 11.2 0.3 0:07.00 │ │ └─ aptitude --assume-yes update
12943 root 0 0 0 ?? 39 19 24296 1916 1568 S 0.0 0.2 0:00.14 │ │ ├─ /usr/lib/apt/methods/xz
12927 root 0 0 0 ?? 39 19 53280 30688 30172 R 86.5 3.0 0:28.65 │ │ ├─ /usr/lib/apt/methods/rred
12891 root 0 0 0 ?? 39 19 24304 1784 1440 S 0.0 0.2 0:00.00 │ │ ├─ /usr/lib/apt/methods/gpgv
12889 root 0 0 0 ?? 39 19 24292 1624 1384 S 0.0 0.2 0:00.00 │ │ ├─ /usr/lib/apt/methods/copy
12887 root 0 0 0 ?? 39 19 32860 1956 1560 S 0.0 0.2 0:00.17 │ │ ├─ /usr/lib/apt/methods/http
12886 root 0 0 0 ?? 39 19 24292 1696 1444 S 0.0 0.2 0:00.00 │ │ └─ /usr/lib/apt/methods/fil
But I forgot to add this nice -n 19 ionice -n 7 -c 3
and ran just lb build
. So, I tried to renice
the parent process:
# renice -n 19 -p 6187
But this doesn't renice the other processes. So, it looks like this:
26196 morfik 0 0 0 B4 20 0 23888 668 664 S 0.0 0.1 0:00.24 │ ├─ -bash
30926 root 0 0 0 B4 20 0 53668 528 528 S 0.0 0.1 0:00.02 │ │ └─ su -
31008 root 0 0 0 B4 20 0 34656 5952 1224 S 0.0 0.6 0:02.62 │ │ └─ -su
6187 root 0 0 0 B7 39 19 4496 800 524 S 0.0 0.1 0:00.00 │ │ └─ /bin/sh /usr/lib/live/build/build
6349 root 0 0 0 B4 20 0 4328 612 512 S 0.0 0.1 0:00.00 │ │ └─ /bin/sh ./auto/build
6351 root 0 0 0 B4 20 0 7028 592 488 S 0.0 0.1 0:00.00 │ │ ├─ tee build.log
6350 root 0 0 0 B4 20 0 4496 828 532 S 0.0 0.1 0:00.01 │ │ └─ /bin/sh /usr/lib/live/build/build noauto
6445 root 0 0 0 B4 20 0 4496 840 548 S 0.0 0.1 0:00.00 │ │ └─ /bin/sh /usr/lib/live/build/bootstrap
7580 root 0 0 0 B4 20 0 4496 856 552 S 0.0 0.1 0:00.02 │ │ └─ /bin/sh /usr/lib/live/build/bootstra
7692 root 0 0 0 B4 20 0 62924 5236 3848 S 15.5 0.5 0:03.78 │ │ └─ aptitude --assume-yes update
7932 root 0 0 0 B4 20 0 54776 16480 15916 R 84.1 1.6 0:16.60 │ │ ├─ /usr/lib/apt/methods/rred
7912 root 0 0 0 B4 20 0 24296 2036 1648 S 0.0 0.2 0:01.62 │ │ ├─ /usr/lib/apt/methods/gzip
7733 root 0 0 0 B4 20 0 27948 5552 1632 S 0.0 0.5 0:02.85 │ │ ├─ /usr/lib/apt/methods/bzip2
7711 root 0 0 0 B4 20 0 24304 1780 1436 S 0.0 0.2 0:00.00 │ │ ├─ /usr/lib/apt/methods/gpgv
7709 root 0 0 0 B4 20 0 30800 2200 1812 S 0.0 0.2 0:01.01 │ │ └─ /usr/lib/apt/methods/http
I could renice all the processes manually but they are changing.
**EDIT#1**
The following command:
# nice -n 19 ionice -n 7 -c 3 lb build
sets also:
> ionice - sets or gets process io scheduling class and priority. ...
>
> -c, --class scheduling class name or number
> 0: none, 1: realtime, 2: best-effort, 3: idle
>
> -n, --classdata scheduling class data
> 0-7 for realtime and best-effort classes
How to set -c
and -n
option of ionice
to the processes?
Mikhail Morfikov
(11029 rep)
Feb 3, 2014, 02:39 AM
• Last activity: Jul 16, 2022, 02:48 PM
0
votes
1
answers
62
views
Does ionice also apply to i/o redirections?
A coworker recently observed a command: `user@host:~$ ionice -c 3 mysqldump -uredacted -p redacted redacted > redacted.dmp` Since the host in question uses the `deadline` scheduler anyway, [`ionice` is ignored][1]. However, the question was posed: Does `ionice` also apply to the `>` redirection? Doe...
A coworker recently observed a command:
user@host:~$ ionice -c 3 mysqldump -uredacted -p redacted redacted > redacted.dmp
Since the host in question uses the deadline
scheduler anyway, ionice
is ignored . However, the question was posed:
Does ionice
also apply to the >
redirection? Does it apply to the entire command, or just the mysqldump
?
Kahn
(1827 rep)
Sep 17, 2021, 07:09 PM
• Last activity: Sep 17, 2021, 07:40 PM
1
votes
0
answers
132
views
Linux shell wrapper to run program with low system resources?
There's `nice` and `renice` to lower priority of a process, `cpulimit` to lets say 30% maximum, `taskset` to limit to 1 core, `ionice`. Each of these tools has a different syntax. Specifically `cpulimit` seems harder to master. Syntax isn't trivial. Writing this for multiple tasks (on a server) woul...
There's
nice
and renice
to lower priority of a process, cpulimit
to lets say 30% maximum, taskset
to limit to 1 core, ionice
. Each of these tools has a different syntax. Specifically cpulimit
seems harder to master. Syntax isn't trivial. Writing this for multiple tasks (on a server) would be a lot work.
nice
alone does not solve it. If I run for example nice -n19 stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
on my desktop system, it helps, but it is still less responsive until that process finishes.
Would be useful for tasks (such as backups) that require a lot of CPU / IO where it does not matter if these finish in 5 seconds, 5 minutes or 30 minutes. More important is not to take away CPU shares from more important processes.
Before re-inventing all of that...
Is there a linux shell wrapper script to run programs with low system resources that covers all or most of above?
adrelanos
(1956 rep)
May 13, 2020, 02:45 PM
• Last activity: May 13, 2020, 03:38 PM
10
votes
2
answers
1089
views
What is the nicest a Unix command can be?
For a quick benchmarking test, how can nice and ionice be combined to maximum effect, ie for a command to use as little resource as possible (without idling altogether)? *(I think it's something like `nice -n 19 ionice -c 2 [command], but not sure about ionice's "-n" (classdata param), the man page...
For a quick benchmarking test, how can nice and ionice be combined to maximum effect, ie for a command to use as little resource as possible (without idling altogether)?
*(I think it's something like `nice -n 19 ionice -c 2 [command], but not sure about ionice's "-n" (classdata param), the man page is cryptic about its relevance.)*
mahemoff
(862 rep)
Oct 12, 2017, 06:06 PM
• Last activity: Nov 9, 2019, 10:31 AM
29
votes
2
answers
23932
views
Using and understanding systemd scheduling-related options in a desktop context
In systemd service files, one can set the following scheduling related options (from the [`systemd.exec` man page][1], correct me if I'm wrong): > **Nice** > Sets the default nice level (scheduling priority) for executed processes. Takes an integer between -20 (highest priority) and 19 (lowest prior...
In systemd service files, one can set the following scheduling related options (from the
systemd.exec
man page , correct me if I'm wrong):
> **Nice**
> Sets the default nice level (scheduling priority) for executed processes. Takes an integer between -20 (highest priority) and 19 (lowest priority). See setpriority(2) for details.
Which is the familiar nice level. It seems its effect is ‘subverted’ somewhat due to the ‘autogroup’ feature of recent linux kernels. So the options below may be what I'd really want to set to keep processes behaving nicely for my desktop experience.
> **CPUSchedulingPolicy**
> Sets the CPU scheduling policy for executed processes. Takes one of other, batch, idle, fifo or rr. See sched_setscheduler(2) for details.
>
> **CPUSchedulingPriority**
> Sets the CPU scheduling priority for executed processes. The available priority range depends on the selected CPU scheduling policy (see above). For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority) can be used. See sched_setscheduler(2) for details.
>
> **CPUSchedulingResetOnFork**
> Takes a boolean argument. If true, elevated CPU scheduling priorities and policies will be reset when the executed processes fork, and can hence not leak into child processes. See sched_setscheduler(2) for details. Defaults to false.
I understand the last option. I gather from the explanation of the first two that I can choose a scheduling policy and then, given that policy, a priority. It is not entirely clear to me what I should choose for which kind of tasks. For example, is it safe to choose ‘idle’ for backup tasks (relatively CPU intensive, because deduplicating), or is another one better suited?
In general, getting an understandable overview of each policy, with each of its priorities and suitability for specific purposes is what I am looking for. Also the interaction with the nice level is of interest.
Next to CPU scheduling, there is IO scheduling. I guess this corresponds to ionice
(correct me if I'm wrong).
> **IOSchedulingClass**
> Sets the I/O scheduling class for executed processes. Takes an integer between 0 and 3 or one of the strings none, realtime, best-effort or idle. See ioprio_set(2) for details.
>
> **IOSchedulingPriority**
> Sets the I/O scheduling priority for executed processes. Takes an integer between 0 (highest priority) and 7 (lowest priority). The available priorities depend on the selected I/O scheduling class (see above). See ioprio_set(2) for details.
We here see the same structure as with the CPU scheduling. I'm looking for the same kind of information as well.
For all the ‘Scheduling’ options, the referred to man pages are not clear enough for me, mostly in translating things to a somewhat technically-inclined desktop user's point of view.
equaeghe
(654 rep)
Jan 25, 2017, 10:14 AM
• Last activity: May 31, 2019, 06:01 AM
1
votes
1
answers
654
views
How can I limit the bandwidth to a davfs-mounted cloud storage?
I need to copy approximately 400 files of approximately 25 MB each to a davfs-mounted cloud storage. I have tried the following commands to limit the CPU-load and IO-load: nice -n 15 ionice -c 3 rsync -avhW --no-compress --progress /src/ /dst/ My destination folder `dst` is a davfs-mounted cloud sto...
I need to copy approximately 400 files of approximately 25 MB each to a davfs-mounted cloud storage. I have tried the following commands to limit the CPU-load and IO-load:
nice -n 15 ionice -c 3 rsync -avhW --no-compress --progress /src/ /dst/
My destination folder
dst
is a davfs-mounted cloud storage. Whenever I transfer a single file, the rsync just takes a few seconds -- at least it shows up to be this fast:
sending incremental file list
xxx
26.70M 100% 15.75MB/s 0:00:01 (xfer#1, to-check=0/1)
sent 26.70M bytes received 31 bytes 7.63M bytes/sec
total size is 26.70M speedup is 1.00
I don't see any rsync or nice process running, but the system reacts very slowly, as the data transfer is still running in the background. There is only one davfs process for the mounted cloud storage. After a few minutes, my system is responsive again and the file transfer is finished.
netstat
shows an active connection to the cloud storage.
How can I limit the bandwidth to the davfs-mounted cloud storage to prevent my system from slowing down?
32u-nd
(215 rep)
Sep 24, 2014, 07:14 PM
• Last activity: Feb 11, 2019, 04:37 PM
0
votes
2
answers
1058
views
Ionice on cp - why I need set dir
I'm wondering why I can't set ionice for cp. ionice -c2 -n0 cp I run this command and I get: cp: missing file argument Try `cp --help' for more information Why?
I'm wondering why I can't set ionice for cp.
ionice -c2 -n0 cp
I run this command and I get:
cp: missing file argument
Try `cp --help' for more information
Why?
Paweł Jaworowski
(455 rep)
Feb 4, 2015, 01:46 PM
• Last activity: Nov 25, 2018, 12:46 AM
4
votes
1
answers
915
views
ionice does not have any effect on un-synced writes (i.e. normal writes)?
> When I dump a large MySQL database (its dump weighs around 10GB) - it appears on the disk almost immediately, but then, later, when the kernel decides to flush it to the disk, the server almost stalls and other IO requests take a lot more time to complete even though mysqldump is run with ionice -...
> When I dump a large MySQL database (its dump weighs around 10GB)
- it appears on the disk almost immediately, but then, later, when the kernel
decides to flush it to the disk, the server almost stalls and other IO requests
take a lot more time to complete even though mysqldump is run with ionice -c3,
so the use of ionice has no real effect.
>
> [Artem](https://lore.kernel.org/lkml/1814253454.3449.1382689853825.JavaMail.mail@webmail07/)
When you write data into the page cache, there is no field to store the IO priority. So
ionice
will have no effect. Do I have that right?
My latest kernel version is 4.18.16-200.fc28.x86_64
.
sourcejedi
(53222 rep)
Nov 9, 2018, 10:08 PM
1
votes
3
answers
302
views
ionice every imap process automatically
I want to ionice a process on its startup. In our hosting environment, we use old Paralells Confixx servers. (Yes I know, Confixx is outdated, but that is not the question). We use courier for mails and sometimes it happens, that the `/usr/bin/imap Maildir` process eats up the whole I/O which also c...
I want to ionice a process on its startup.
In our hosting environment, we use old Paralells Confixx servers. (Yes I know, Confixx is outdated, but that is not the question).
We use courier for mails and sometimes it happens, that the
/usr/bin/imap Maildir
process eats up the whole I/O which also causes high CPU load. We allways manually ioniced (ionice –c 3 –p [PID]
) the process and the I/O went down.
What is the best way to automatically ionice every imap process?
I’m not very experienced in the courier mail server.
Simon Sutter
(51 rep)
May 24, 2018, 08:19 AM
• Last activity: May 25, 2018, 02:20 PM
1
votes
0
answers
191
views
Per user priority of access to a file system
Please, let me know if there is a tool, which allows to give different reading (writing) priority to different users on Linux. I am looking for something similar to 'ionice' but able to set I/O priorities per file system and per user instead of per process. Using ionice assumes that each process acc...
Please, let me know if there is a tool, which allows to give different reading (writing) priority to different users on Linux. I am looking for something similar to 'ionice' but able to set I/O priorities per file system and per user instead of per process. Using ionice assumes that each process accessing file system would have to be started in a special way or its priority would have to be adjusted once it is started - this is not a safe way to do it. For example, if some time critical production processes need to read/write some data to a file system, they need to have ultimate priority to do so, while lower priority processes (like backup or research) should have some low priority. It is not safe to assume that each user will always remember to use ionice whenever they read something from such shared file system. It would be much better to just give specific sets of users different priorities accessing a specific file system.
Thank you for your help!
S.V
(141 rep)
May 9, 2018, 01:31 PM
• Last activity: May 9, 2018, 08:19 PM
7
votes
1
answers
346
views
How does ionice work with multiple drives?
I understand how `ionice` can help you when you have multiple processes requesting access to the same disk resources, but how does it work when you have multiple disks? For example, you have one `rsync` operation moving data from *Drive A -> Drive B*, and another `rsync` moving data from *Drive C ->...
I understand how
ionice
can help you when you have multiple processes requesting access to the same disk resources, but how does it work when you have multiple disks?
For example, you have one rsync
operation moving data from *Drive A -> Drive B*, and another rsync
moving data from *Drive C -> Drive D*.
In theory, since they are not competing for resources, ionice
'ing one of these rsync
processes shouldn't change its throughput. Is this how it works, or will it still impact performance?
Additionally, is there some "upper limit" on total *I/O* one might experience on a *linux* system that is independent of drive speed? Like if you hooked up 100 *SSD* drives, at some point would the *OS* run into a bottleneck aside from drive speed?
user159726
(73 rep)
Jul 21, 2016, 04:41 AM
• Last activity: Jan 1, 2017, 01:48 AM
4
votes
1
answers
3197
views
iotop and ionice -p show a different class/priority for the same process
After running `ionice -c2 -n7 ` on an I/O-intensive process (VirtualBox VM) and checking the result with `ionice -p ` it shows `best-effort: prio 7` which is expected. But when monitoring the overall disk I/O of all processes via `iotop` it shows in `PRIO` column a value of `be/4` for that process,...
After running
ionice -c2 -n7
on an I/O-intensive process (VirtualBox VM) and checking the result with ionice -p
it shows best-effort: prio 7
which is expected.
But when monitoring the overall disk I/O of all processes via iotop
it shows in PRIO
column a value of be/4
for that process, which I assume means **b**est-**e**ffort and level (priority) 4, which is average priority and not expected.
Can somebody comment why there's a difference between what ionice and what iotop displays? And is there another way to verify the actual I/O priority of a given process other then with ionice -p
?
From what I understood, there's /proc//io
but it only displays bytes/characters read and written, but not the priority, cf. Know which process does I/O without iotop
Also How do I view the IO priority of a process? only lists ionice -p
For completeness sake, this is on RHEL 6.7 with iotop 0.3.2, and the scheduler is the default CFQ.
doktor5000
(2779 rep)
Oct 24, 2015, 11:03 PM
• Last activity: Oct 24, 2015, 11:09 PM
2
votes
1
answers
1525
views
Set ionice for a multi-threaded application
I have a program that spawns multiple threads, all of which do fairly intensive IO, running on the background. I want to set the scheduling class to `idle` so that it doesn't clog up the system; however, `ionice -c3 -p `, where ` ` is the process ID, does not have the desired effect. Although the sc...
I have a program that spawns multiple threads, all of which do fairly intensive IO, running on the background. I want to set the scheduling class to
idle
so that it doesn't clog up the system; however, ionice -c3 -p
, where ` is the process ID, does not have the desired effect. Although the scheduling class for process
is changed, when I launched
iotop`, all the threads it had spawned still had the default priority (best-effort level 4).
How do I change the IO priority of a program and all the threads or processes it has spawned on Linux?
jaymmer - Reinstate Monica
(835 rep)
Apr 1, 2015, 06:13 AM
• Last activity: Apr 2, 2015, 12:26 PM
5
votes
1
answers
2073
views
Different between `ulimit -e` and `renice`?
I would like to run a backup script in low CPU and disk I/O. Is there any different between this: #!/bin/bash ulimit -e 19 ionice -c3 -p $$ and this: #!/bin/bash ionice -c3 -p $$ renice -n 19 -p $$
I would like to run a backup script in low CPU and disk I/O.
Is there any different between this:
#!/bin/bash
ulimit -e 19
ionice -c3 -p $$
and this:
#!/bin/bash
ionice -c3 -p $$
renice -n 19 -p $$
quanta
(1700 rep)
Jul 23, 2014, 03:28 AM
• Last activity: Jul 23, 2014, 10:51 PM
Showing page 1 of 20 total questions