Gentoo Archives: gentoo-performance

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-performance@l.g.o
Subject: Re: [gentoo-performance] Horrible performance
Date: Thu, 26 Aug 2010 17:03:47
Message-Id: 201008261848.53504.joost@antarean.org
In Reply to: Re: [gentoo-performance] Horrible performance by Alex Schuster
1 On Thursday 26 August 2010 17:48:44 Alex Schuster wrote:
2 > Joost Roeleveld writes:
3 > > LVM-fragmentation is a definite possibility.
4 > > To defragment it, have a look at the following:
5 > >
6 > > http://bisqwit.iki.fi/source/lvm2defrag.html
7 >
8 > Cool!
9
10 Do test it first and check what it wants to do.
11 Basically, it moves all the blocks around untill you have them all in the
12 sequence you want them.
13 There are some limitations, but it worked when I tested it.
14 Btw, I provide no warranty what-so-ever, especially as I did not write any
15 part of it :)
16
17 > > http://www.linuxquestions.org/questions/linux-software-2/how-do-i-lvm2-
18 > > defrag- or-move-based-on-logical-volumes-689335/
19 > >
20 > > I played with the first one on an older machine once and it does work
21 > > quite nicely.
22 >
23 > Any idea how to check how bad the fragmentation actually is?
24
25 Yes:
26 desktop ~ # lvs -o lv_name,seg_pe_ranges
27 LV PE Ranges
28 distfiles /dev/sda4:37632-39423
29 home /dev/sda4:9472-12031
30 home /dev/sda4:39424-40703
31 home /dev/sda4:42240-44799
32 opt /dev/sda4:8192-9471
33 opt /dev/sda4:40704-42239
34 packages /dev/sda4:45312-47359
35 portage /dev/sda4:3072-3327
36 swap /dev/sda4:0-3071
37 tmp /dev/sda4:3328-4607
38 usr /dev/sda4:6400-8191
39 usr /dev/sda4:81664-81919
40 usr /dev/sda4:44800-45311
41 var /dev/sda4:4608-5119
42 vartmp /dev/sda4:5120-6399
43 vartmp /dev/sda4:60160-61183
44 virtualbox /dev/sda4:12032-32511
45 virtualbox /dev/sda4:76544-81663
46 virtualbox /dev/sda4:58112-60159
47 virtualbox /dev/sda4:81920-83310
48 virtualbox /dev/sda4:47360-58111
49 virtualbox /dev/sda4:32512-33680
50
51 home, vartmp and virtualbox are fragmented into different sections.
52
53 Alternatively, the first part of that script actually generates a text-file
54 which you then need to edit into the next text-file.
55 The first one actually shows you how the different parts are laid out.
56
57 > BTW:
58 > wonko@weird ~ $ mount | wc -l
59 > 48
60
61 desktop ~ # lvs | wc -l
62 12
63
64 server ~ # lvs | wc -l
65 99
66 (Ok, this one runs virtual machines with Xen, but online-resizing works and
67 xen-virtual machines get notified of the new size)
68
69 > I use LVM for about everything now, it makes things so much easier. First,
70 > I had two volume groups on my system drive, one for the system, placed at
71 > the front where the drive is supposed to be faster, and one for data. But
72 > I don't do this any more, it cuts down flexibility, and is probably not
73 > worth the effort.
74
75 I don't think it's worth the effort as well. You can still move the LVs around
76 physically using the "lvm-defrag" tool.
77 It's very verbose by nature as it doesn't do any changes untill you tell it
78 to. And you're the one starting the final script.
79
80 That tool basically generates a script that calls "pvmove" a couple of times.
81 And the script even contains comments describing what it is doing for each
82 step.
83 It does expect the user to determine which LVs end up where.
84
85 > > Those look ok to me, except that I would expect SATA-drives to be
86 > > faster then PATA drives.
87 >
88 > Well, they are, except for the sometimes busy system drive. And by now I
89 > get similar results as for the 2nd SATA drive, throughput is between 90
90 > and 110 MB/sec.
91
92 Btw, I tend to use "hdparm -Tt <device>" to do the testing:
93 desktop ~ # hdparm -Tt /dev/sda
94
95 /dev/sda:
96 Timing cached reads: 3456 MB in 2.00 seconds = 1728.51 MB/sec
97 Timing buffered disk reads: 276 MB in 3.01 seconds = 91.75 MB/sec
98
99 > > And unset mysql.
100 > > There is one issue that needs to be resolved manually with getting it
101 > > to work with sqlite.
102 > > See:
103 > > http://forums.gentoo.org/viewtopic-t-834883-view-
104 > > next.html?sid=3ae77f5bfba5e006e8745eedb4b6cfc4
105 > >
106 > > Here is the bit that will solve the problem:
107 > > --
108 > > $ cd ~/.local/share/akonadi
109 > > $ sqlite3 akonadi.db
110 > > sqlite> INSERT INTO ResourceTable (name, isVirtual) VALUES
111 > > ('akonadi_search_resource', 1);
112 > > sqlite> .exit
113 >
114 > I did nothing about this by now, but I probabyl will soon. Thanks for the
115 > tip!
116 > I also had trouble with akonadi in the past, and it still gives
117 > warnings/errors at every startup, but at least it seems to work now.
118
119 It doesn't complain for me anymore since I switched to sqlite.
120 Main reason for that: I don't like MySQL and prefer not to run a full database
121 on my desktop anyway. And configuring it to use the Database on the server goes
122 too far.
123
124 > > > > Disk I/O is, in my experience, a very common cause for
125 > > > > "freeze-ups". Can you test with unencrypted disks to see if the
126 > > > > issue occurs then as well?
127 > > >
128 > > > Yes, I can do this. It's some work, but I tried so much, why not
129 > > > this. I have some free space, and already have written a backup
130 > > > script that automatically creates LVM snapshots, decrypts them, and
131 > > > backs it up, so I can do this from the running system.
132 > >
133 > > Ok, am interested to see if running unencrypted actually has benefits
134 > > here.
135 >
136 > Me too, but as things are quite faster now already, the priority for this
137 > task is much lower than it was yesterday :)
138
139 Ofcourse, depending on the encryption-method used, the performance impact can
140 be a lot to not much at all.
141
142 > > > X takes an awful lot, then comes java, which is running only for my
143 > > > tvbrowser. And many many chrome processes.
144 > >
145 > > How many web browser windows do you have open? :)
146 >
147 > wonko@weird ~ $ ps ax | grep chromium-browser | wc -l
148 > 42
149 >
150 > Well, that's tabs, not windows. Chromium uses one process for each tab.
151 > I'm not sure if I really want to use Chromium, I started using it because
152 > of a nasty konqueror bug that made KDE freeze occasionally, but it seems
153 > to be fixed now.
154
155 I actually use Firefox myself and not had any real issues.
156
157 > > Also, do you have file indexing enabled?
158 >
159 > Do you mean Strigi/Nepomuk? I just turned it on again today. It never
160 > worked, but crashed. In the last days I investigated this further and
161 > filed two bugs about this, and they were already fixed. I'm running the
162 > git version now, and so far it seems to work fine, but my home directory
163 > is not fully indexed yet. And there were also issues with my music folder,
164 > let's see if indexing this will still make strigi crash.
165 > I should have done this before - I am waiting over a year now for a fixed
166 > version, but apparently few people if any have those crashes, so I had to
167 > report them myself.
168 > At the moment it's indexing, but so far system load is not very high.
169 > That's much better than a year ago when I used it the last time.
170
171 I haven't managed to get it to work to the point I can actually use it.
172 Maybe I need to read the docs to see how people expect it to work.
173
174 I actually archive my files in such a way that I can easily find them back.
175 Comes from not having decent indexing tools when I started with computers and
176 having a lot of data to keep.
177
178 > > In my experience, X uses more memory when a lot of windows are open.
179 > > And yours uses about 4 times as much as mine.
180 > > But then again, I don't have much running at the moment.
181 >
182 > I like to have many things open. With enough memory it's no problem.
183 > Unless you are using ati-drivers, that is.
184
185 Hehe, if it isn't ati-drivers, it will be something else causing problems.
186
187 --
188 Joost