JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Load averages are too high

Tue Nov 03, 2015 4:17 pm

This is an RPi B+ running Jessie and it uses the RPF 7" touchscreen.

Code: Select all

 [email protected] rpi2: ~
>$ uname -a
Linux rpi2 4.1.11+ #822 PREEMPT Fri Oct 23 16:14:56 BST 2015 armv6l GNU/Linux
Let's say I boot to the Desktop and just let it sit idle, other than SSH into it using Putty for a terminal.
When I first boot up load averages look normal and typically vary around .04~.11
Load averages will slowly increase until after ~20 minutes they're up to 1.01~1.15 and they'll stay in that range for as long as it's running. Even after several days it hasn't increased, or decreased, they stay about the same.

CPU is usually up and down at less than 4%, and I have the ondemand governor set to throttle up at 70
After 110 minutes cpufreq shows

Code: Select all

 [email protected] rpi2: ~
>$ cpufreq-info -s -m
700 MHz:98.41%, 1.10 GHz:1.59%  (33)
And "htop" shows
htop-image.jpg
htop-image.jpg (52.51 KiB) Viewed 3479 times
It seems that CPU utilization is low, yet jobs are backed up in the queue for some reason.

If I start up both Synergy and Kivy to increase the CPU load the one minute load average increases to 1.24, stop both of them and it goes back to the 1.01~1.15 range.

This is the only RPi I have that is running Jessie, and I was wondering if it may have something to do with the way it determines load averages. Or maybe the touchscreen itself. Does anyone have any idea how I can track down the problem?

User avatar
topguy
Posts: 5910
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Load averages are too high

Tue Nov 03, 2015 4:23 pm

I believe standard "top" or "dstat" can give more info.
http://blog.scoutapp.com/articles/2015/ ... -cpu-stats

Have worked with unix/linux on and off for 20 years, have never really understood "load". So now I mainly ignore it.

User avatar
RaTTuS
Posts: 10493
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Load averages are too high

Tue Nov 03, 2015 4:25 pm

How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Load averages are too high

Tue Nov 03, 2015 5:01 pm

topguy wrote:I believe standard "top" or "dstat" can give more info.
http://blog.scoutapp.com/articles/2015/ ... -cpu-stats

Have worked with unix/linux on and off for 20 years, have never really understood "load". So now I mainly ignore it.
"Top" or "uptime" both show the same values. My load averages on this RPi are always greater than one, which with a single core CPU means a process or I/O is waiting.

Another B+ running Wheezy and no touchscreen shows idle load averages of .10~.20, and this one used to be the same. So I was wondering if it's Jessie, the touchscreen, or something else causing the load average to stay above 1.

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Load averages are too high

Tue Nov 03, 2015 9:34 pm

In Linux, the load averages count processes whose state was either R (runnable) or D (uninterruptible sleep). If the load is pegged at 1.00 on a quiet machine, and top does not show processes stuck using 100% CPU, then you have one stuck in D state. You can find such processes with:

Code: Select all

ps axu |grep D
(You are only interested in the matches where the capital D is in the STAT column.)

Processes in regular sleep state, S, are commonly waiting for input from slow devices such as the user or network. They can be awoken early by sending them a signal using kill. Uninterruptible processes cannot be killed. They are waiting for completion of some event that should normally be fast, such as a disk access, and which may also be critical for the process to ever continue.

D state processes are counted in the load averages so that the load goes up if the disks are too slow to keep up with the number of concurrent tasks, as well as if the CPU is too slow.

A process getting stuck in D state indefinitely may suggest a kernel bug, or some hardware issue such as unplugging a drive while it is mounted. Although the unkillable processes can be annoying, they are not actually slowing down the rest of the machine (except perhaps if they are also tying up a lot of memory).

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Load averages are too high

Tue Nov 03, 2015 10:14 pm

Thanks @jojopi, I learned something new !

Looks like it's the touch display. That's the only STAT "D" that shows up.

Code: Select all

 [email protected] rpi2: ~
>$ ps aux | grep D
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        35  0.0  0.0      0     0 ?        S<   08:49   0:00 [DWC Notificatio]
root       157  0.1  0.0      0     0 ?        D    08:49   0:42 [ft5406]
root       540  0.0  0.9   7116  3752 ?        Ss   08:49   0:06 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
I'll try shutting it down, disconnect the display, boot it back up and wait about 30 minutes to see if the load average increases as before.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5349
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Load averages are too high

Wed Nov 04, 2015 2:46 pm

I think it is caused by the msleep() in the touchscreen driver. It is harmless (there is no lost cpu due to it), apart from spoiling the load averages reported.
I believe replacing it with msleep_interruptible() will avoid the issue. I'll report when there is an update for testing.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5349
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Load averages are too high

Sat Nov 07, 2015 11:45 am

Please test latest rpi-update firmware which has a possible fix for high load reported.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Load averages are too high

Sat Nov 07, 2015 1:19 pm

I did an update.

Code: Select all

 [email protected] rpi2: ~
>$ uname -a
Linux rpi2 4.1.12+ #825 PREEMPT Fri Nov 6 17:53:21 GMT 2015 armv6l GNU/Linux
Thank you! That seems to have fixed it, load averages look correct now, good job.

Return to “Troubleshooting”