1 |
On 11/26/2010 05:57 PM, Stroller wrote: |
2 |
> Hi there, |
3 |
> |
4 |
> As per subject, what's the best way to improve interactivity with |
5 |
> heavy disk activity, please? |
6 |
> |
7 |
> Or perhaps a better question would be: what approaches are |
8 |
> available? |
9 |
>[...] |
10 |
> |
11 |
> But I have also heard of `ionice` in the past: |
12 |
> http://linux.die.net/man/1/ionice |
13 |
> |
14 |
> I've never used that - in fact, I can't recall ever having to use the |
15 |
> regular `nice` - but I think maybe I should consider it. |
16 |
|
17 |
'nice' is for CPU time. 'ionice' is for disk I/O time. So yes, it |
18 |
helps a lot with heavy disk tasks if you run them -c3. This is why |
19 |
Portage has support for ionice (PORTAGE_IONICE_COMMAND). There's also |
20 |
'schedtool' (sys-process/schedtool). |
21 |
|
22 |
The way I solved the I/O problems is to use the sys-kernel/ck-sources |
23 |
kernel (2.6.36-r3). It shouldn't be necessary to use ionice and |
24 |
schedtool for most tasks, but I use it for portage with this in make.conf: |
25 |
|
26 |
PORTAGE_NICENESS=19 |
27 |
PORTAGE_IONICE_COMMAND="sh -c \"schedtool -D \${PID}; ionice -c 3 -p |
28 |
\${PID}\"" |
29 |
|
30 |
But you can use this method for everything you want. Running something |
31 |
with nice -19, ionice -c3 and schedtool -D should make it pretty much |
32 |
invisible; it should have zero impact on interactivity. At least that's |
33 |
the case here when using sys-kernel/ck-sources. |