1 |
Peter Humphrey <prh@××××××××××.uk> posted |
2 |
200703041151.37846.prh@××××××××××.uk, excerpted below, on Sun, 04 Mar |
3 |
2007 11:51:37 +0000: |
4 |
|
5 |
> I'm watching the emerge of mozilla-firefox with top (I've just set the |
6 |
> java USE flag so that I can use some astronomy Web sites), and I'm |
7 |
> puzzled. This is a dual-Opteron box with 4G memory, and I have it set up |
8 |
> with 6G /tmp mounted on tmpfs. Top shows 0k of used swap, so I'm |
9 |
> confident that I'm not doing any swapping. It should show me a total of |
10 |
> up to 200% when the system is fully loaded. |
11 |
> |
12 |
> But top shows 49 - 50% wa, which I understand is I/O waiting time (even |
13 |
> with the X term rolled up), cc1plus is showing only single-digit percent |
14 |
> CPU, and the System and User CPU % are in the teens. I can get X to use |
15 |
> 30-odd % by leaving the terminal on display, or 1% by rolling it up; |
16 |
> that seems not to affect the other figures. No other user processes are |
17 |
> running; only the background processes started by init and so on. What |
18 |
> is the machine doing? Why does it not work harder at its allotted task? |
19 |
|
20 |
Ouch! |
21 |
|
22 |
There's a couple things to check. First, you say /tmp is on tmpfs and in |
23 |
memory (no swap), but you don't mention where you have $PORTAGE_TMPDIR |
24 |
pointed. That's set in make.conf and defaults to /var/tmp. Here, /var/ |
25 |
tmp is a symlink pointing to /tmp so it doesn't really matter, but I have |
26 |
$PORTAGE_TMPDIR set to /tmp anyway. You may also wish to tweak |
27 |
$PORTAGE_TMPFS (see the documentation in make.conf.example) and if you |
28 |
have FEATURES=buildpkg set, $PKG_TMPDIR (which I don't see documentation |
29 |
for ATM, but...). If /tmp is tmpfs and it's of reasonable size (as yours |
30 |
is), there's little reason not to have all of them set to /tmp. |
31 |
|
32 |
Second, for general disk access speed (IOW, not portage specific), if |
33 |
you've not checked it, emerge hdparm if necessary and see if your hard |
34 |
drives are using DMA. If they aren't, you'll have MUCH slower disk i/o. |
35 |
Normally, if you are using the correct drivers, DMA should be activated |
36 |
by default, but it's not uncommon for folks to be using the generic |
37 |
drivers or some other specific hardware drivers that don't fully match |
38 |
the disk controller chipset they actually have, thus forcing the kernel |
39 |
to use compatibility mode. Less commonly, a driver won't activate DMA |
40 |
even if it's the right one, or will, but at a lower speed (say UDMA66 |
41 |
rather than UDMA133) than both the drive and the chipset can handle. Of |
42 |
course, don't attempt to activate a higher UDMA mode than both drive and |
43 |
chipset support, or you'll risk data corruption. |
44 |
|
45 |
Of course, also note that depending on the ebuild stage and how much of |
46 |
what it is accessing you already have cached, portage does do some non- |
47 |
tmp I/O access. In particular, it has to read the portage tree to |
48 |
discover dependencies, then distdir to see if the tarball is there (and |
49 |
if not fetch it), then untar it to $PORTAGE_TMPDIR and read and apply any |
50 |
patches. At the beginning of the compile step it does the configure, |
51 |
which accesses and tests for all sorts of system binaries, so until those |
52 |
are cached (generally after the first thing using a configure script is |
53 |
emerged), there will be some disk I/O reading those. If you have CCACHE |
54 |
set up, of course it must write the compiles to that as it goes, but |
55 |
unless your drives aren't using DMA, that shouldn't be a big issue. |
56 |
Finally, at the package (if FEATURES=buildpkg) and qmerge steps, it'll |
57 |
write to the pkg dir and to the general system as it installs. |
58 |
|
59 |
There's also portage logging and associated log variables. Again, this |
60 |
shouldn't be a big deal if you've got DMA on your drives, but it might be |
61 |
if you don't. |
62 |
|
63 |
Finally, if it's writing anything to NFS mounts or the like over the |
64 |
network, or if you have distcc active, it's possible the wait is on the |
65 |
network, not on your local hard drives, of course depending on exactly |
66 |
how you are configured. |
67 |
|
68 |
|
69 |
-- |
70 |
Duncan - List replies preferred. No HTML msgs. |
71 |
"Every nonfree program has a lord, a master -- |
72 |
and if you use the program, he is your master." Richard Stallman |
73 |
|
74 |
-- |
75 |
gentoo-amd64@g.o mailing list |