Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] problems with performance when booted using systemd
Date: Fri, 06 Jun 2014 10:50:15
Message-Id: 1617382.f8Uxombi8S@andromeda
In Reply to: Re: [gentoo-user] problems with performance when booted using systemd by covici@ccs.covici.com
1 On Friday, June 06, 2014 04:46:35 AM covici@××××××××××.com wrote:
2 > J. Roeleveld <joost@××××××××.org> wrote:
3 > > On Friday, June 06, 2014 03:45:17 AM covici@××××××××××.com wrote:
4 > > > J. Roeleveld <joost@××××××××.org> wrote:
5 > > > > On Friday, June 06, 2014 01:59:18 AM covici@××××××××××.com wrote:
6 > > > > > Hi. I am having some strange performance problems when booted under
7 > > > > > systemd. These problems happened a little bit under openrc, but are
8 > > > > > much more pronounced with systemd.
9 > > > >
10 > > > > I don't think it's necessarily systemd itself, just a setting that
11 > > > > systemd
12 > > > > does differently then openrc. See below for more.
13 > > > >
14 > > > > > I am using just virtual consoles, no gui whatsoever at the moment.
15 > > > > > I
16 > > > > > also use tmux with 4 windows in one of the vcs. My system is an i7
17 > > > > > processor, quod core and 16g of ram and 2g of swap space which
18 > > > > > appears
19 > > > > > not to be used. I am using uvesafb for the console, so I get 64x160
20 > > > > > screens.
21 > > > >
22 > > > > Sounds similar to my laptop, except I run KDE and got 16g of swap (for
23 > > > > hibernate)
24 > > > >
25 > > > > > The first problem is that if I don't press any keystrokes for
26 > > > > > several
27 > > > > > minutes and then want to move to another vc, it takes about 3 or 4
28 > > > > > seconds after the alt-left arrow or alt-right arrow command to take
29 > > > > > effect. Even within the same vt, if I don't do anything for several
30 > > > > > minutes, it takes several seconds till the keystroke echoes and
31 > > > > > something happens. Once I have done this, things act normally, but
32 > > > > > its
33 > > > > > kind of annoying.
34 > > > >
35 > > > > Sounds like a powersave setting. I used to get the same on my old
36 > > > > laptop
37 > > > > with spinning rust. SSDs tend to "spin-up" a lot quicker.
38 > > > >
39 > > > > > Also, my load average seems to always be >1. I have
40 > > > > > looked at top and things seem to be OK, except that my cpu usage is
41 > > > > > like
42 > > > > > this:
43 > > > > > Tasks: 934 total, 2 running, 931 sleeping, 0 stopped, 1 zombie
44 > > > > > %Cpu(s): 12.5 us, 1.2 sy, 0.0 ni, 86.0 id, 0.2 wa, 0.0 hi, 0.0
45 > > > > > si,
46 > > > > > 0.0 st
47 > > > > > KiB Mem: 16450248 total, 9678656 used, 6771592 free, 1084088
48 > > > > > buffers
49 > > > > > KiB Swap: 2097148 total, 4 used, 2097144 free. 1147688
50 > > > > > cached
51 > > > > > Mem
52 > > > > >
53 > > > > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+
54 > > > > > COMMAND
55 > > > > >
56 > > > > > 9969 root 20 0 708 16 0 R 100.0 0.0 1549:10
57 > > > > > v86d
58 > > > > >
59 > > > > > 579 root 30 10 0 0 0 S 9.1 0.0 16:09.93
60 > > > > > speakup
61 > > > > >
62 > > > > > 11789 root 20 0 22524 2388 1116 R 0.7 0.0 0:00.03
63 > > > > > top
64 > > > > >
65 > > > > > 7 root 0 -20 0 0 0 S 0.3 0.0 0:10.41
66 > > > > >
67 > > > > > kworker/u:0H
68 > > > > >
69 > > > > > and onward ...
70 > > > > > This is an awful lot of tasks, I have never seen so many!
71 > > > >
72 > > > > That is a lot, I am currently running KDE, firefox and a citrix remote
73 > > > > desktop thing. (oh, and skype and kopete and a few other items)
74 > > > > KDE is installed with semantic-desktop, but the nepomuk stuff is
75 > > > > disabled
76 > > > > in system-settings.
77 > > > > I have 200 tasks (yes, nice round figure)
78 > > > >
79 > > > > > Anyone have any ideas? Thanks much.
80 > > > >
81 > > > > For the amount of tasks, check that you are not starting too many
82 > > > > unneeded
83 > > > > services. For the load-average of 1, shouldn't be too much of an
84 > > > > issue,
85 > > > > had
86 > > > > similar in the past with a lot of stuff running and slow disks.
87 > > > >
88 > > > > For the freezing, I would suggest checking all the powersave options,
89 > > > > especially the ones for the harddrives.
90 > > > > Is there anything in the logs when this happens? Eg. check the logs
91 > > > > right
92 > > > > after the system becomes responsible again, maybe there is a hint
93 > > > > there
94 > > > > what is causing this.
95 > > >
96 > > > Unless systemd is setting some powersave options, I certainly never set
97 > > > anything like that, this is a desktop machine, not even a laptop. Next
98 > > > time this happens I will check the logs. Does systemd set some
99 > > > powersave options by default?
100 > >
101 > > I do not know that for sure, best wait for more knowledgable systemd users
102 > > to answer that. If it doesn't, then systemd itself is causing more
103 > > freezes (as per your experience) then openrc.
104 > >
105 > > I would guess it does or at least with the default configuration. What you
106 > > describe makes me think the disks are switched to powersave sooner with
107 > > systemd.
108 > > Can you provide the output of the following command:
109 > > # hdparm -B /dev/sda
110 > > to get the APM settings of the disk. (If you have multiple disks, please
111 > > run it for the others as well.
112 > >
113 > > Question for others as well, how do you get the current setting for the
114 > > spindown timeout set with " hdparm -S <value> <device> "?
115 > > I couldn't find it.
116 > >
117 > > I am happy with openrc and have no intention on switching to systemd as I
118 > > haven't heard of a single feature that would actually make my life easier.
119 >
120 > I don't have hdparm on the system, is it only for older disks? If
121 > memory serves, it did not work at all when I tried it as my disks are
122 > all /dev/sda, etc, but that may be wrong.
123
124 It also works on new SATA drives and SSDs:
125
126 # smartctl -a /dev/sda
127 smartctl 6.1 2013-03-16 r3800 [x86_64-linux-3.12.20-gentoo] (local build)
128 Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
129
130 === START OF INFORMATION SECTION ===
131 Device Model: INTEL SSDMCEAC120B3
132 Serial Number: CVLI3223002B120E
133 LU WWN Device Id: 5 5cd2e4 00028738f
134 Firmware Version: LLLi
135 User Capacity: 120,034,123,776 bytes [120 GB]
136 Sector Size: 512 bytes logical/physical
137 Rotation Rate: Solid State Device
138 Device is: Not in smartctl database [for details use: -P showall]
139 ATA Version is: ACS-2 (minor revision not indicated)
140 SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
141 Local Time is: Fri Jun 6 12:46:59 2014 CEST
142 SMART support is: Available - device has SMART capability.
143 SMART support is: Enabled
144
145 # hdparm /dev/sda
146
147 /dev/sda:
148 multcount = 16 (on)
149 IO_support = 1 (32-bit)
150 readonly = 0 (off)
151 readahead = 256 (on)
152 geometry = 14593/255/63, sectors = 234441648, start = 0
153
154 # hdparm -B /dev/sda
155
156 /dev/sda:
157 APM_level = 254
158
159 There might also be other ways to configure the powermanagement settings, I
160 haven't looked into those yet.
161
162 --
163 Joost