Heavy writes to USB3 SSD causing network latency spikes
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c, linux
- Domain
- networking, operating-systems, performance
Research direction
Reproduce heavy writes to the USB3 SSD while monitoring SSH responsiveness and ICMP ping latency. Compare ext4 with f2fs and xfs, and test the reported vm.dirty_ratio and vm.dirty_background_ratio adjustments. The issue does not identify kernel files or tests, and completion would require determining whether the latency spikes are an actionable kernel bug.
Written by the indexing model from the issue text.
Description
While debugging my issue with a USB3-SATA controller (#3026) I found that heavy writes to an USB3 SSD are causing some kernel threads to spike the CPU and increase network latency, which is observable because of the noticeable lag in the SSH session and can be confirmed with an ICMP ping.
I'm not exactly sure if this is a bug or normal behaviour for linux, and unfortunately I don't have similar low-power devices to test their behaviour in USB3 write-heavy situations.
The issue can be toned down a bit by adjusting vm.dirty_ratio and vm.dirty_background_ratio, however it's still significant.
What's weird is it doesn't seem to affect the network when the SSD is formatted to f2fs, and is less serious with xfs (smaller latency spikes and less frequently).
The attached screenshot shows writing to an ext4 formatted USB3 SSD. The latency spikes are not caused by an unrelated network issue, there's a gigabit ethernet link between the Pi and the computer.
System
Raspi 4 4GB with a Samsung EVO+ 64GiB micro SD.
Running the latest Raspbian system and firmware.
root@raspberrypi:~# uname -a
Linux raspberrypi 4.19.56-v7l+ #1242 SMP Wed Jun 26 17:41:03 BST 2019 armv7l GNU/Linux
root@raspberrypi:~# /opt/vc/bin/vcgencmd version
Jun 26 2019 17:42:42
Copyright (c) 2012 Broadcom
version 1186f932808ed601ddd583a30a3ce055477b1a26 (clean) (release) (start)

- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·