Hi,
I just installed Alpine 3.20.3 on a RPI 2 in diskless mode.(headless,
minimal installation)
I noticed that if I let the device idling, I have a few seconds latency
when I try to connect the machine with SSH for example. Even when connected
I can have my SSH session frozen for a few seconds if I do nothing in the
terminal.
I notice the same when using a nodejs app (HTTP) therefore this is a
general thing (not just about SSH)
I don't see anything weird in logs. Any idea ? Is that a power saving
feature ?
Jerome
Jerome Marc wrote in
<CAD1Ag0wW0nw-BR1aqKkD66LLO_yndJAy__i6yg9TWvU_Z6QEDA@mail.gmail.com>:
|I just installed Alpine 3.20.3 on a RPI 2 in diskless mode.(headless,
|minimal installation)
|
|I noticed that if I let the device idling, I have a few seconds latency
|when I try to connect the machine with SSH for example. Even when connected
|I can have my SSH session frozen for a few seconds if I do nothing in the
|terminal.
|I notice the same when using a nodejs app (HTTP) therefore this is a
|general thing (not just about SSH)
|
|I don't see anything weird in logs. Any idea ? Is that a power saving
|feature ?
It *could* be that cpupower-openrc is indeed the
tools/power/cpupower of the linux kernel sources, it seems to be
widely available (architecture-wise, on Alpine).
If that is so, then running it should output stuff like
#?0|kent:~# bin/cpupower.sh
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 400 MHz - 3.40 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 400 MHz and 3.40 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 800 MHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
On the reserve laptop however the EFI(BIOS) "always" sets back
cpupower, and we start with "powersave" governor and low
frequency, and so the initial decrypting of the hard disk takes
seeeeconds. I btw drive it via
#!/bin/sh -
#@ /root/bin/cpupower.sh
# cpupower is in Linux src, tools/power/cpupower
: ${HOSTNAME:=$(uname -n)}
if [ -f /root/hosts/${HOSTNAME}/cpupower ]; then
. /root/hosts/${HOSTNAME}/cpupower
else
logger -s -t /root/bin/cpupower.sh "MISS /root/hosts/${HOSTNAME}/cpupower"
exit 1
fi
if command -v cpupower >/dev/null 2>&1; then :; else
logger -s -t /root/bin/cpupower.sh 'no cpupower tool'
exit 1
fi
if [ $# -gt 0 ]; then
x=
case $1 in
lo) x=$lo;;
med) x=$med;;
hi) x=$hi;;
default) x=$default;;
75) x=$x75;;
*) echo >&2 'Synopsis: cpupower [lo|med|hi|default[|75]]';;
esac
[ -n "$x" ] && cpupower frequency-set -u $x
fi
cpupower frequency-info
and that /root/hosts/$HOSTNAME/cpupower is (here)
#@ /root/hosts/self/cpupower
lo='400M -g powersave'
med='1600M -g powersave'
hi='3400M -g performance'
default='3400M -g powersave'
x75='2500M -g performance'
(i use "hi" only for kernel and port builds).
It makes "a hell of a difference".
Other than that i have seen similar things because (a) the
kernel's crng came up slowly (up to 30 minutes at times), but this
*should* be a thing of the past (dunno Alpine 3.20, i always use
[edge]), or because of WiFi chip powersafe stuff, i usually do
that though, i use "iw dev $dev set power_save on":
# iw dev wlp1s0 get power_save
Power save: on
Other than that i am out of ideas.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
Hi Steffen,
Thanks !
Unfortunately there is cpupower rc service running and I don't have wifi.
I installed cpupower and got this output :
alpine:~# cpupower frequency-info
analyzing CPU 0:
driver: cpufreq-dt
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: Cannot determine or is not supported.
hardware limits: 600 MHz - 900 MHz
available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz
available cpufreq governors: conservative ondemand userspace performance
schedutil
current policy: frequency should be within 600 MHz and 900 MHz.
The governor "schedutil" may decide which speed to use
within this range.
current CPU frequency: 600 MHz (asserted by call to hardware)
Looks good...
Le lun. 30 sept. 2024 à 22:27, Steffen Nurpmeso <steffen@sdaoden.eu> a
écrit :
> Jerome Marc wrote in> <CAD1Ag0wW0nw-BR1aqKkD66LLO_yndJAy__i6yg9TWvU_Z6QEDA@mail.gmail.com>:> |I just installed Alpine 3.20.3 on a RPI 2 in diskless mode.(headless,> |minimal installation)> |> |I noticed that if I let the device idling, I have a few seconds latency> |when I try to connect the machine with SSH for example. Even when> connected> |I can have my SSH session frozen for a few seconds if I do nothing in the> |terminal.> |I notice the same when using a nodejs app (HTTP) therefore this is a> |general thing (not just about SSH)> |> |I don't see anything weird in logs. Any idea ? Is that a power saving> |feature ?>> It *could* be that cpupower-openrc is indeed the> tools/power/cpupower of the linux kernel sources, it seems to be> widely available (architecture-wise, on Alpine).> If that is so, then running it should output stuff like>> #?0|kent:~# bin/cpupower.sh> analyzing CPU 0:> driver: intel_pstate> CPUs which run at the same hardware frequency: 0> CPUs which need to have their frequency coordinated by software: 0> maximum transition latency: Cannot determine or is not supported.> hardware limits: 400 MHz - 3.40 GHz> available cpufreq governors: performance powersave> current policy: frequency should be within 400 MHz and 3.40 GHz.> The governor "powersave" may decide which speed to use> within this range.> current CPU frequency: Unable to call hardware> current CPU frequency: 800 MHz (asserted by call to kernel)> boost state support:> Supported: yes> Active: yes>> On the reserve laptop however the EFI(BIOS) "always" sets back> cpupower, and we start with "powersave" governor and low> frequency, and so the initial decrypting of the hard disk takes> seeeeconds. I btw drive it via>> #!/bin/sh -> #@ /root/bin/cpupower.sh> # cpupower is in Linux src, tools/power/cpupower>> : ${HOSTNAME:=$(uname -n)}>> if [ -f /root/hosts/${HOSTNAME}/cpupower ]; then> . /root/hosts/${HOSTNAME}/cpupower> else> logger -s -t /root/bin/cpupower.sh "MISS> /root/hosts/${HOSTNAME}/cpupower"> exit 1> fi>> if command -v cpupower >/dev/null 2>&1; then :; else> logger -s -t /root/bin/cpupower.sh 'no cpupower tool'> exit 1> fi>> if [ $# -gt 0 ]; then> x=> case $1 in> lo) x=$lo;;> med) x=$med;;> hi) x=$hi;;> default) x=$default;;> 75) x=$x75;;> *) echo >&2 'Synopsis: cpupower [lo|med|hi|default[|75]]';;> esac> [ -n "$x" ] && cpupower frequency-set -u $x> fi>> cpupower frequency-info>> and that /root/hosts/$HOSTNAME/cpupower is (here)>> #@ /root/hosts/self/cpupower> lo='400M -g powersave'> med='1600M -g powersave'> hi='3400M -g performance'> default='3400M -g powersave'> x75='2500M -g performance'>> (i use "hi" only for kernel and port builds).> It makes "a hell of a difference".>> Other than that i have seen similar things because (a) the> kernel's crng came up slowly (up to 30 minutes at times), but this> *should* be a thing of the past (dunno Alpine 3.20, i always use> [edge]), or because of WiFi chip powersafe stuff, i usually do> that though, i use "iw dev $dev set power_save on":>> # iw dev wlp1s0 get power_save> Power save: on>> Other than that i am out of ideas.>> --steffen> |> |Der Kragenbaer, The moon bear,> |der holt sich munter he cheerfully and one by one> |einen nach dem anderen runter wa.ks himself off> |(By Robert Gernhardt)>
Ok I found the culprit. It was a network issue. The problem was happening
when initiating the connection from a wlan which is bridged with the wired
lan.
For some reason, my Internet router forgets the presence of the RPI.
Therefore IP address resolution can be slow. I suppose it's because there
is no traffic coming from the RPI.
I installed the avahi daemon, I think it will make the RPI visible
continuously.
Le lun. 30 sept. 2024 à 23:20, Jerome Marc <marcjero@yahoo.com> a écrit :
> Hi Steffen,>> Thanks !> Unfortunately there is cpupower rc service running and I don't have wifi.> I installed cpupower and got this output :>> alpine:~# cpupower frequency-info> analyzing CPU 0:> driver: cpufreq-dt> CPUs which run at the same hardware frequency: 0 1 2 3> CPUs which need to have their frequency coordinated by software: 0 1 2 3> maximum transition latency: Cannot determine or is not supported.> hardware limits: 600 MHz - 900 MHz> available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz> available cpufreq governors: conservative ondemand userspace performance> schedutil> current policy: frequency should be within 600 MHz and 900 MHz.> The governor "schedutil" may decide which speed to use> within this range.> current CPU frequency: 600 MHz (asserted by call to hardware)>> Looks good...>> Le lun. 30 sept. 2024 à 22:27, Steffen Nurpmeso <steffen@sdaoden.eu> a> écrit :>>> Jerome Marc wrote in>> <CAD1Ag0wW0nw-BR1aqKkD66LLO_yndJAy__i6yg9TWvU_Z6QEDA@mail.gmail.com>:>> |I just installed Alpine 3.20.3 on a RPI 2 in diskless mode.(headless,>> |minimal installation)>> |>> |I noticed that if I let the device idling, I have a few seconds latency>> |when I try to connect the machine with SSH for example. Even when>> connected>> |I can have my SSH session frozen for a few seconds if I do nothing in>> the>> |terminal.>> |I notice the same when using a nodejs app (HTTP) therefore this is a>> |general thing (not just about SSH)>> |>> |I don't see anything weird in logs. Any idea ? Is that a power saving>> |feature ?>>>> It *could* be that cpupower-openrc is indeed the>> tools/power/cpupower of the linux kernel sources, it seems to be>> widely available (architecture-wise, on Alpine).>> If that is so, then running it should output stuff like>>>> #?0|kent:~# bin/cpupower.sh>> analyzing CPU 0:>> driver: intel_pstate>> CPUs which run at the same hardware frequency: 0>> CPUs which need to have their frequency coordinated by software: 0>> maximum transition latency: Cannot determine or is not supported.>> hardware limits: 400 MHz - 3.40 GHz>> available cpufreq governors: performance powersave>> current policy: frequency should be within 400 MHz and 3.40 GHz.>> The governor "powersave" may decide which speed to use>> within this range.>> current CPU frequency: Unable to call hardware>> current CPU frequency: 800 MHz (asserted by call to kernel)>> boost state support:>> Supported: yes>> Active: yes>>>> On the reserve laptop however the EFI(BIOS) "always" sets back>> cpupower, and we start with "powersave" governor and low>> frequency, and so the initial decrypting of the hard disk takes>> seeeeconds. I btw drive it via>>>> #!/bin/sh ->> #@ /root/bin/cpupower.sh>> # cpupower is in Linux src, tools/power/cpupower>>>> : ${HOSTNAME:=$(uname -n)}>>>> if [ -f /root/hosts/${HOSTNAME}/cpupower ]; then>> . /root/hosts/${HOSTNAME}/cpupower>> else>> logger -s -t /root/bin/cpupower.sh "MISS>> /root/hosts/${HOSTNAME}/cpupower">> exit 1>> fi>>>> if command -v cpupower >/dev/null 2>&1; then :; else>> logger -s -t /root/bin/cpupower.sh 'no cpupower tool'>> exit 1>> fi>>>> if [ $# -gt 0 ]; then>> x=>> case $1 in>> lo) x=$lo;;>> med) x=$med;;>> hi) x=$hi;;>> default) x=$default;;>> 75) x=$x75;;>> *) echo >&2 'Synopsis: cpupower [lo|med|hi|default[|75]]';;>> esac>> [ -n "$x" ] && cpupower frequency-set -u $x>> fi>>>> cpupower frequency-info>>>> and that /root/hosts/$HOSTNAME/cpupower is (here)>>>> #@ /root/hosts/self/cpupower>> lo='400M -g powersave'>> med='1600M -g powersave'>> hi='3400M -g performance'>> default='3400M -g powersave'>> x75='2500M -g performance'>>>> (i use "hi" only for kernel and port builds).>> It makes "a hell of a difference".>>>> Other than that i have seen similar things because (a) the>> kernel's crng came up slowly (up to 30 minutes at times), but this>> *should* be a thing of the past (dunno Alpine 3.20, i always use>> [edge]), or because of WiFi chip powersafe stuff, i usually do>> that though, i use "iw dev $dev set power_save on":>>>> # iw dev wlp1s0 get power_save>> Power save: on>>>> Other than that i am out of ideas.>>>> --steffen>> |>> |Der Kragenbaer, The moon bear,>> |der holt sich munter he cheerfully and one by one>> |einen nach dem anderen runter wa.ks himself off>> |(By Robert Gernhardt)>>>