Gentoo Archives: gentoo-performance

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-performance@l.g.o
Subject: Re: [gentoo-performance] Horrible performance
Date: Wed, 25 Aug 2010 20:03:19
Message-Id: 201008252138.12412.wonko@wonkology.org
In Reply to: Re: [gentoo-performance] Horrible performance by "J. Roeleveld"
1 J. Roeleveld writes:
2
3 > On Wednesday 25 August 2010 03:32:40 Alex Schuster wrote:
4
5 > > I have an AMD Athlon(tm) Dual Core Processor 4850e CPU, on-board
6 > > Radeon HD 3200 graphics, 4GB of memory, an 1.5 TB drive. Lots of LVM
7 > > volumes, all encrypted, except for /usr/src and portage stuff. The
8 > > system is ~amd64, and I have -march=k8-sse3 in my CFLAGS. Current
9 > > kernel is 2.6.34-tuxonice, but I also tried others. I'm running KDE4
10 > > with desktop effects enabled, X itself takes about 30-40% of CPU
11 > > time according to top. After system startup and login into KDE, 3.5G
12 > > of RAM are occupied. This increases after a while, and I need swap
13 > > space. Nothing to worry about I think.
14 >
15 > Encrypted filesystems can cause additional with activity, but I would
16 > expect that to remain the same over a long period.
17
18 And I just moved my PORTAGE_TMPDIR to an unencrypted partition.
19 Can LVM create noticeable overhead? I also resized my logical volumes a
20 couple of times, could this lead to some LVM fragmentation?
21
22 > However, how is the write and read performance on those disks?
23
24 Here's the output of hdparm -t for all drives, 4 times.
25
26 /dev/sda: (SATA system drive)
27 Timing buffered disk reads: 118 MB in 3.08 seconds = 38.37 MB/sec
28 Timing buffered disk reads: 194 MB in 3.11 seconds = 62.47 MB/sec
29 Timing buffered disk reads: 322 MB in 3.01 seconds = 106.82 MB/sec
30 Timing buffered disk reads: 244 MB in 3.00 seconds = 81.21 MB/sec
31
32 /dev/sdb: (PATA master)
33 Timing buffered disk reads: 114 MB in 3.02 seconds = 37.70 MB/sec
34 Timing buffered disk reads: 114 MB in 3.00 seconds = 37.97 MB/sec
35 Timing buffered disk reads: 116 MB in 3.05 seconds = 38.06 MB/sec
36 Timing buffered disk reads: 116 MB in 3.05 seconds = 38.07 MB/sec
37
38 /dev/sdc: (PATA slave)
39 Timing buffered disk reads: 164 MB in 3.03 seconds = 54.21 MB/sec
40 Timing buffered disk reads: 166 MB in 3.02 seconds = 55.04 MB/sec
41 Timing buffered disk reads: 166 MB in 3.01 seconds = 55.10 MB/sec
42 Timing buffered disk reads: 158 MB in 3.01 seconds = 52.41 MB/sec
43
44 /dev/sdd: (SATA backup drive)
45 Timing buffered disk reads: 314 MB in 3.00 seconds = 104.55 MB/sec
46 Timing buffered disk reads: 312 MB in 3.01 seconds = 103.67 MB/sec
47 Timing buffered disk reads: 308 MB in 3.01 seconds = 102.34 MB/sec
48 Timing buffered disk reads: 314 MB in 3.00 seconds = 104.60 MB/sec
49
50 The system drive throughput varies a lot, depending on other I/O.
51
52 I
53
54
55 > You're running KDE4, guess you went for the default and use mysql for
56 > "app- office/akonadi-server".
57 >
58 > I switched to using "sqlite" for this due to issues getting it to work
59 > with mysql. I think this might help there?
60
61 So I only have to set the sqlite use flag and remove the mysql use flag
62 for akonadi-server? I'm doing this now. And this also gives an example for
63 what is going on here:
64
65 I have just logged into KDE. I did not log out since yesterday, and when
66 started a VM with vmplayer, the system swapped like crazy, I could not use
67 it for minutes. After this, the panel did not react any more, and the
68 desktop background did not redraw, so I logged out and in again. The VM
69 started fine now. Well, could be faster, but maybe it was okay.
70 Then I started answering your mail, and tried to reemerge akonadi-server,
71 but I had a type, so portage took a long search for akomadi-server.
72 meanwhile the dektop became quite unresponsive, load went high, and I made
73 a screenshot [*]. If you look at the top right, gkrellm shows this above
74 'Proc'. The first increase at the left was after I started emerge, the 2nd
75 at the right was after I pressed the PrtSc key.
76
77
78 > > Performance does not feel too bad at first. But after a while, I
79 > > cannot even play videos during emerges. The playback stutters,
80 > > sometimes I have pauses for several seconds. As long as there is no
81 > > swap space occpied, it's not so bad I think. Maybe I have a probelm
82 > > with disk I/O, and things get much worse when swapping occurs. When
83 > > I look at iotop, I see various programs like chromium and various
84 > > KDE applications appear. I guess that's normal, but should not be
85 > > noticeable. Hey, there were times when I created a 2G tmpfs for
86 > > /var/tmp/portage, with only 3G on my 32bit system. BTW, I lowered my
87 > > swappiness to 10. This helps a little I think, because the swapping
88 > > occurs later, the system is more responsive.
89 >
90 > Do you also encrypt swap?
91
92 Yes.
93
94 > Disk I/O is, in my experience, a very common cause for "freeze-ups".
95 > Can you test with unencrypted disks to see if the issue occurs then as
96 > well?
97
98 Yes, I can do this. It's some work, but I tried so much, why not this. I
99 have some free space, and already have written a backup script that
100 automatically creates LVM snapshots, decrypts them, and backs it up, so I
101 can do this from the running system.
102
103
104 > > And I have similar problems when copying data between some old PATA
105 > > drives. When I copy stuff and do a mkfs on another partition, mplayer
106 > > sometimes stutters and hangs for ten seconds. No joy. Working with
107 > > KDE sucks, switching dektops sometimes takes ages, and even now I am
108 > > typing faster than kmail can display the characters. That's with am
109 > > emerge of chromium running, with PORTAGE_NICENESS=10 and using
110 > > ionice -c 3. Load is around 8, but sometimes gets even higher. And
111 > > then, load suddenly drops back to lower values, as if somthing was
112 > > blocking. Some applications swapping, maybe.
113 >
114 > Very possibly, maybe an idea to check which applications are hogging
115 > the memory. If it is the swapping of the system, then this will be
116 > caused by the most memory-hungry processes.
117 >
118 > Can you post the result of: "ps axu"?
119 > This will give an indication which processes are running and using a
120 > lot of memory.
121
122 First, here is free -m:
123 total used free shared buffers cached
124 Mem: 3452 3225 226 0 54 325
125 -/+ buffers/cache: 2844 607
126 Swap: 4094 935 3159
127
128 And here the output of top, sorted by memory. I think it is a similar
129 output to ps axu, but more condensed and better readable via mail. The
130 full ps aux output, sorted by memory, is in [2].
131
132 top - 21:23:03 up 1 day, 7 min, 11 users, load average: 0.04, 0.05, 0.02
133 Tasks: 418 total, 1 running, 417 sleeping, 0 stopped, 0 zombie
134 Cpu(s): 17.8%us, 12.7%sy, 9.9%ni, 45.9%id, 13.5%wa, 0.1%hi, 0.1%si, 0.0%st
135 Mem: 3534936k total, 3312312k used, 222624k free, 56264k buffers
136 Swap: 4193272k total, 957908k used, 3235364k free, 334048k cached
137
138 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
139 25993 root 20 0 847m 475m 47m S 21 13.8 49:01.11 X
140 26553 wonko 20 0 1312m 235m 10m S 0 6.8 0:28.32 java
141 26925 wonko 20 0 698m 112m 18m S 0 3.2 3:30.75 kontact
142 26961 wonko 20 0 526m 79m 13m S 0 2.3 2:16.01 chrome
143 26566 wonko 20 0 1128m 72m 10m S 0 2.1 1:02.46 amarok
144 27056 wonko 20 0 871m 57m 19m S 0 1.7 0:05.07 chrome
145 30324 root 30 10 195m 55m 1136 S 0 1.6 0:09.46 emerge
146 27051 wonko 20 0 874m 50m 8668 S 0 1.5 0:14.16 chrome
147 26126 wonko 20 0 1028m 44m 11m S 2 1.3 9:18.94 plasma-desktop
148 27046 wonko 20 0 878m 41m 7324 S 0 1.2 0:16.59 chrome
149 27122 wonko 20 0 871m 36m 7660 S 0 1.0 0:40.03 chrome
150 27036 wonko 20 0 865m 29m 7492 S 0 0.8 0:00.94 chrome
151 27198 wonko 20 0 860m 28m 6240 S 0 0.8 0:04.76 chrome
152 26101 wonko 20 0 427m 28m 8672 S 4 0.8 5:27.48 kwin
153 26298 wonko 20 0 396m 26m 9.9m S 0 0.8 0:02.91 knotes
154 27766 wonko 20 0 857m 26m 5924 S 0 0.8 0:03.03 chrome
155 26903 root 20 0 64316 25m 288 S 0 0.7 0:00.33 screen
156 27203 wonko 20 0 865m 24m 5960 S 0 0.7 0:04.06 chrome
157 30226 wonko 20 0 367m 23m 9232 S 0 0.7 0:03.21 gwenview
158 26221 wonko 20 0 609m 23m 3752 S 0 0.7 0:02.55 knotify4
159
160 X takes an awful lot, then comes java, which is running only for my
161 tvbrowser. And many many chrome processes.
162
163 > > Now I am out of ideas. I really hope someone here has one. I cannot
164 > > work with this system any more when emerges are going on.
165 >
166 > Had similar issues with a desktop machine myself, managed to kill some
167 > "features" that I wasn't using and this solved most of the problems.
168
169 I hope I can say this soon, too.
170
171 > Lets see where checking for IO-speeds and memory-usage of your apps
172 > take us :)
173
174 Thanks for your help! I appreciate this very much.
175
176 Wonko
177
178 [1] http://www.wonkology.org/comp/desktop/2010-08-25_emerge-akomadi.png
179 [2] http://www.wonkology.org/gentoo/

Replies

Subject Author
Re: [gentoo-performance] Horrible performance Joost Roeleveld <joost@××××××××.org>