{"id":329,"date":"2019-10-21T19:47:31","date_gmt":"2019-10-21T17:47:31","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=329"},"modified":"2019-10-21T19:47:31","modified_gmt":"2019-10-21T17:47:31","slug":"ionice","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=329","title":{"rendered":"IONICE"},"content":{"rendered":"<p>IONICE(1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 User Commands \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IONICE(1)<\/p>\n<p>NAME<br \/>\nionice &#8211; set or get process I\/O scheduling class and priority<\/p>\n<p>SYNOPSIS<br \/>\nionice [-c class] [-n level] [-t] -p PID&#8230;<br \/>\nionice [-c class] [-n level] [-t] command [argument&#8230;]<\/p>\n<p>DESCRIPTION<br \/>\nThis \u00a0program sets or gets the I\/O scheduling class and priority for a program. \u00a0If no arguments or just -p is<br \/>\ngiven, ionice will query the current I\/O scheduling class and priority for that process.<\/p>\n<p>When command is given, ionice will run this command with the given arguments. \u00a0If no class is specified, \u00a0then<br \/>\ncommand will be executed with the &#8220;best-effort&#8221; scheduling class. \u00a0The default priority level is 4.<\/p>\n<p>As of this writing, a process can be in one of three scheduling classes:<\/p>\n<p>Idle \u00a0 A \u00a0program \u00a0running \u00a0with idle I\/O priority will only get disk time when no other program has asked for<br \/>\ndisk I\/O for a defined grace period. \u00a0The impact of an idle \u00a0I\/O \u00a0process \u00a0on \u00a0normal \u00a0system \u00a0activity<br \/>\nshould \u00a0be \u00a0zero. \u00a0This scheduling class does not take a priority argument. \u00a0Presently, this scheduling<br \/>\nclass is permitted for an ordinary user (since kernel 2.6.25).<\/p>\n<p>Best-effort<br \/>\nThis is the effective scheduling class for any process that has not asked for a specific I\/O \u00a0priority.<br \/>\nThis \u00a0class \u00a0takes \u00a0a \u00a0priority argument from 0-7, with a lower number being higher priority. \u00a0Programs<br \/>\nrunning at the same best-effort priority are served in a round-robin fashion.<\/p>\n<p>Note that before kernel 2.6.26 a process that has not asked for an I\/O priority formally uses &#8220;none&#8221; as<br \/>\nscheduling \u00a0class, \u00a0but \u00a0the \u00a0I\/O \u00a0scheduler will treat such processes as if it were in the best-effort<br \/>\nclass. \u00a0The priority within the best-effort class will be dynamically derived from the CPU \u00a0nice \u00a0level<br \/>\nof the process: io_priority = (cpu_nice + 20) \/ 5.<\/p>\n<p>For \u00a0kernels \u00a0after 2.6.26 with the CFQ I\/O scheduler, a process that has not asked for an I\/O priority<br \/>\ninherits its CPU scheduling class. \u00a0The I\/O priority is derived from the CPU nice level of the \u00a0process<br \/>\n(same as before kernel 2.6.26).<\/p>\n<p>Realtime<br \/>\nThe \u00a0RT \u00a0scheduling class is given first access to the disk, regardless of what else is going on in the<br \/>\nsystem. \u00a0Thus the RT class needs to be used with some care, as it can starve other processes. \u00a0As \u00a0with<br \/>\nthe best-effort class, 8 priority levels are defined denoting how big a time slice a given process will<br \/>\nreceive on each scheduling window. \u00a0This scheduling class is not permitted for an ordinary (i.e., \u00a0non-<br \/>\nroot) user.<\/p>\n<p>OPTIONS<br \/>\n-c, &#8211;class class<br \/>\nSpecify \u00a0the \u00a0name \u00a0or \u00a0number \u00a0of the scheduling class to use; 0 for none, 1 for realtime, 2 for best-<br \/>\neffort, 3 for idle.<\/p>\n<p>-n, &#8211;classdata level<br \/>\nSpecify the scheduling class data. \u00a0This only has an effect if the \u00a0class \u00a0accepts \u00a0an \u00a0argument. \u00a0 For<br \/>\nrealtime and best-effort, 0-7 are valid data (priority levels).<\/p>\n<p>-p, &#8211;pid PID&#8230;<br \/>\nSpecify the process IDs of running processes for which to get or set the scheduling parameters.<\/p>\n<p>-t, &#8211;ignore<br \/>\nIgnore failure to set the requested priority. \u00a0If command was specified, run it even in case it was not<br \/>\npossible to set the desired scheduling priority, which can happen due to insufficient privileges or \u00a0an<br \/>\nold kernel version.<\/p>\n<p>-h, &#8211;help<br \/>\nDisplay help and exit.<\/p>\n<p>-V, &#8211;version<br \/>\nDisplay version information and exit.<\/p>\n<p>EXAMPLES<br \/>\n# ionice -c 3 -p 89<\/p>\n<p>Sets process with PID 89 as an idle I\/O process.<\/p>\n<p># ionice -c 2 -n 0 bash<\/p>\n<p>Runs &#8216;bash&#8217; as a best-effort program with highest priority.<\/p>\n<p># ionice -p 89 91<\/p>\n<p>Prints the class and priority of the processes with PID 89 and 91.<\/p>\n<p>NOTES<br \/>\nLinux supports I\/O scheduling priorities and classes since 2.6.13 with the CFQ I\/O scheduler.<\/p>\n<p>AUTHORS<br \/>\nJens Axboe &lt;jens@axboe.dk&gt;<br \/>\nKarel Zak &lt;kzak@redhat.com&gt;<\/p>\n<p>AVAILABILITY<br \/>\nThe \u00a0 ionice \u00a0 command \u00a0 is \u00a0 part \u00a0 of \u00a0 the \u00a0 util-linux \u00a0 package \u00a0and \u00a0is \u00a0available \u00a0from \u00a0ftp:\/\/ftp.ker\u2010<br \/>\nnel.org\/pub\/linux\/utils\/util-linux\/.<\/p>\n<p>util-linux \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0July 2011 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IONICE(1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IONICE(1) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 User Commands \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IONICE(1) NAME ionice &#8211; set or get process I\/O scheduling [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-329","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=329"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/329\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}