Managing FastAPI Projects with Poetry: A Step-by-Step Guide

If you've noticed that SSH connections become very slow or unresponsive after your Ubuntu laptop has been idle for a while. This often happens because your Wi-Fi card enters power-saving mode, reducing network activity until it's manually "woken up."
Here's how to check and disable Wi-Fi power management to ensure fast access to services like SSH, Telnet, and FTP.
Run the following command to find your WiFi network interface:
$ iw dev
phy#0
Interface wlp3s0
ifindex 3
wdev 0x1
addr d4:d2:52:96:ff:6e
ssid ABCD1234
Here, wlp3s0
is your Wi-Fi interface name. You'll use this in the following steps.
Use iwconfig
to check if power saving is enabled:
$ iwconfig wlp3s0
wlp3s0 IEEE 802.11 ESSID:"ABCD1234"
Mode:Managed Frequency:5.26 GHz Access Point: 38:06:E6:28:76:75
Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=65/70 Signal level=-45 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:7 Invalid misc:2548 Missed beacon:0
If you see `Power Management: on`, then your Wi-Fi card is going to sleep when idle and it causes the SSH delay.
To turn off power-saving mode immediately (for the current session), execute the following command.
$ sudo iwconfig wlp3s0 power off
1. Edit NetworkManager's default-wifi-powersave-off.conf
$ sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 2
Value | Identifier | Description | Use Case |
---|---|---|---|
0 | NM_SETTING_WIFI_POWERSAVE_DEFAULT | Default setting (depends on internal policy or driver) | When you don't want to customize the setting |
1 | NM_SETTING_WIFI_POWERSAVE_ENABLED | Enable power saving mode | When saving power is important (e.g., on laptops) |
2 | NM_SETTING_WIFI_POWERSAVE_DISABLED | Disable power saving mode | When connection stability is important (e.g., avoid SSH timeouts) |
3 | NM_SETTING_WIFI_POWERSAVE_IGNORE | Ignore this setting and follow system defaults | When you prefer to rely on system defaults |
2. Restart NetworkManager
$ sudo systemctl restart NetworkManager
$ iwconfig wlp3s0
wlp3s0 IEEE 802.11 ESSID:"ABCD1234"
Mode:Managed Frequency:5.26 GHz Access Point: 38:06:E6:28:76:75
Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off (*)
Comments
Post a Comment