The UNIX/Linux nice command is a
powerful tool for adjusting the dispatching priorities of Oracle background
processes and batch jobs, an important part of the advanced DBA toolset.
Now Linux brings a related utility called
ionice, a command which alters the dispatching for I/O devices.
This article describes the Linux ionice utility and how it might be
used in an Oracle environment:
"The best usecase for using ionice to improve
performance is when you need to do two classes of tasks
at once: The ones that don't use much disk IO but demand
fast response, and the ones that do a LOT of disk IO but
don't need it done urgently.
For example, think of some of the time-consuming
things you want to do in the background, like:
- Downloading a torrent on a fast internet link
that creates a great deal of disk seeking.
- Copy a huge file between two locations
- Perform a system backup
- Install your latest set up system updates
Most of the time, you really don't care how fast
(within reason) these tasks take, as long as
your desktop applications don't lag like hell!
This is where ionice comes to the rescue. You can, in
effect, tell Linux to only give disk access to these
programs when nothing else wants it.
The command for doing this is sudo ionice -c3 -ppid,
where pid is the numeric
Process ID of the task you want to reschedule."
So, are there legitimate uses for ionice in an
Oracle database environment? Oracle ACE Steve Karam notes:
"The ionice command looks neat but I
wouldn't use it for Oracle. Perhaps with very careful analysis it could be
attempted, but for the most part Oracle handles the priorities properly and
the CFQ elevator handles I/O scheduling properly.
Technically we can since by default, RH4.0
systems are using the CFQ I/O elevator by default, but if you consider the
way Oracle writes with a combination of server processes (direct writes) and
background processes (DBWR, LGWR, ARC0-9, DBWR slaves, etc) you could
seriously harm the balance of your system."
John Garmany also notes "ionice
looks like a cool utility but I can not find it for RedHat v4 so I can not test
it on my server. It looks from the note that it is a late addition. The kernel
listed in the blog is for RHv5 (which I do not currently have a system running).
I would think it would be something you could add to a backup script or export.
Adding it to the shell script would ionice everything run in that script. But
the database connection would be a different process and probably would not be
impacted."