-
-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large file write on USB disk leads to freeze #3330
Comments
@balexandrov |
@balexandrov Apart from SDcard test, did you try a different USB port as well? And what about CPU and RAM/swap usage by dd process? The drive has an external power supply, right? Did you check the last |
Thanks all! I'm continuing with investigations, because this really bothers me. It starts to look like a hardware problem though, something saturates and starts slows down. The activity diode on the Pi shines constantly w/o blinking. The original drive is WD Elements with external power supply, the test drive is 2.5 Toshiba in enclosure w/o power supply. 512 MB freezed once and 2 times already there is no problem. With 1G file always freezes so bad that the console times out.
I'll try with another Pi |
Can you please try this test on your device and tell me if it freezes. I don't have much experience with these mini computers and don't know what to expect... |
@balexandrov
I guess you are running out of memory. As far as I see on |
Thanks @Joulinar ! Maybe this is memory issue but the original problem was with transmission when downloading a torrent. Any ideas how to test and isolate the problem w/o filling up the memory? |
Here stats from the original problem with transmission. It starts to download a torrent, looks well, after few megabytes downloaded it suddenly freezes, transmission remote gui times out, at the console succeeded to get this top stats:
|
Also very low phys memory available. Little bit strange as well is the
|
It seems there is some problem with transmission 2.92, fixed in 2.94. |
@balexandrov
https://packages.debian.org/search?searchon=names&keywords=transmission BTW: DietPi has nothing to do with Transmission Software. We just use official packages available. |
I've forgot the tool and installed it with apt install and it shows 2.92. Will try clean installation tomorrow again. |
@Joulinar @balexandrov
The issue with the version that is shipped by Stretch currently is known: #2413 EDIT: Ah, the solution was not the version bump but to compile it against
|
@MichaIng
so it should pull 2.94, isn't it 😉 @balexandrov |
@Joulinar @balexandrov
|
@MichaIng After mine encountered issues, I've went on path to eliminate side factors and tried to reproduce it on fresh image. So that was the one fresh image, downloaded the same day from https://dietpi.com and let it update itself on the first boot. I'm not very sure what are Buster and Stretch versions. Haven't got time to further test it these days but probably will go on your suggested path to just use another torrent client. I'm only experienced in Transmission but will try Deluge as you suggested. I need only basic torrent use: 20-30 movie torrents that I want to watch on a TV.... my first disappointment was that RPi 3b+ have only USB 2 and now that glitch.... took me 2 days headbanging. |
"Stretch" and "Buster" are the codenames for the current stable and the last stable (oldstable) Debian versions: https://en.wikipedia.org/wiki/Debian#Code_names Before doing any further debugging, I hence would first assure a clean and consistent DietPi image, with a single main APT repository in use, as shipped by our images by default. |
Thanks a lot for your support. Indeed the list with 2.92 Transmission was on the old image. On the clean one I've only went with minimal installation and the tests with dd. There the offered package is 2.94 |
Just tried, on the fresh install sd card, installed transmission - no problems, 230/976 MB used ram and no freezing. |
Thanks @MichaIng @Joulinar for your support. |
@balexandrov As well I remember some other issues with high CPU usage in combination with exFAT: #3027 #3025 |
I've tested with ext4 formated drive and the effect was the same (but tested it only once..will check again). The problem is with every external drive. On the sd card there is no such problem... |
@balexandrov
|
Raspberry Pi 4B running Manjaro ARM. Having this issue as well :( |
Edit: yep, @balexandrov was totally right. The preallocation of large files is definitely the problem here. Somehow transmission is filling up the system memory when downloading files to an external HDD. I could literally see it rockets up to 4GB until ~200MB is left which then causes everything to just freeze. Anything that tries to access the mount point will then freeze as well. Ughhh. I though it was a problem with the filesystem driver but obviously it isn't. I believe I've just witnessed the exact same issue as @balexandrov. Also some background: |
My sincere apologies for creating so many notifications but may I ask how you guys managed to fix this issue in the end? I've spent hours troubleshooting this in which I had to do countless force shutdowns on the external HDD, which is obviously going to damage its longevity. I'd really appreciate if a workaround can be given. |
@JQ555888 |
Thank you so much @Joulinar. My bad for totally missing that comment. I have just switched from NTFS to exFAT and finally ext4 last month for better compatibility with Linux, but I guess I really need to change it back to NTFS then. It's kind of ironic that what I thought was the best turns out to be creating even more hassle since I had to install ext4 drivers on my Mac and Windows machines. But thanks again. |
Yes, few months later it works stable and without issues on NTFS and RB3B+ downloading and serving of about hundred of torrents to my TV with Minidlna. |
Yep. Switching to NTFS and using ntfs-3g seem to have solved the issue. Huge thanks to @balexandrov and @Joulinar! |
@JQ555888 @balexandrov @Joulinar |
I want to add one more issue that had a role in this story. When downloading torrents with say more than 4 Mb/sec Transmission's interface frequently locks up for 5-10-20 sec, mount.ntfs (the disk is ntfs now) consumes about 80% CPU time. These were remediated successfully with adding "big_writes" to the mount line. Its now like this @MichaIng Consider if this option need to be used by default. I'm not sure about the reliability but in my case I'm on UPS. There are more tweaks for NTFS but this is the essential one. |
Many thanks for the hint. Little research: https://unix.stackexchange.com/a/544864
We need to add it 👍. |
+ CHANGELOG | DietPi-Drive_Manager: For NTFS mounts, the "big_files" mount option is now added by default, which reduces CPU load and by this may increase performance. Many thanks to @balexandrov for suggesting this enhancement: #3330 (comment)
Creating a bug report/issue
Required Information
cat /DietPi/dietpi/.version
#!/bin/bash
G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=28
G_DIETPI_VERSION_RC=0
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
echo $G_DISTRO_NAME
orcat /etc/debian_version
buster, 10.2
uname -a
Linux DietPi 4.19.57-v7+ DietPi-Config | Nvidia driver: nouveau disable required for 750Ti #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux
echo $G_HW_MODEL_DESCRIPTION
or (EG: RPi3)RPi 3 Model B+ (armv7l)
Original Pie power supply
Kingston
Yes, above are the values for fresh minimal instalation
Steps to reproduce
Fresh install. Mount external USB hard drive.
I've tried with 2 different drives in different enclosures and one of them tried to format with exFAT, NTFS, EXT4. The behavior is almost the same: On large file writes the Pi becomes unresponsive, event ssh console times out and everything stops. Initially found it when tried to download file with transmission. With top command can be observed (when it suceeds to show it) that "wa" usage hits 80-90%.
The same behavior can be observed with simple dd command:
Writing 512MB file - no problems
dd if=/dev/zero of=/mnt/dec13470-f879-4ac3-8d4a-f74649b12c1b/test.img bs=512M count=1 oflag=dsync
536870912 bytes (537 MB, 512 MiB) copied, 18.2792 s, 29.4 MB/s
800MB sometimes is good too
dd if=/dev/zero of=/mnt/dec13470-f879-4ac3-8d4a-f74649b12c1b/test.img bs=800M count=1 oflag=dsync
838860800 bytes (839 MB, 800 MiB) copied, 30.7547 s, 27.3 MB/s
But 1GB blocks everything and eventually finishes after a while...
dd if=/dev/zero of=/mnt/dec13470-f879-4ac3-8d4a-f74649b12c1b/test.img bs=1G count=1 oflag=dsync 2> hdd1.txt
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 242.693 s, 4.4 MB/s
The problem is only on writing, never observed on reading files. The drive is USB3 but Pi have USB2 ports only.
Here dmesg log for the drive
[ 654.468723] usb 1-1.1.2: new high-speed USB device number 6 using dwc_otg
[ 654.680054] usb 1-1.1.2: New USB device found, idVendor=152d, idProduct=0578, bcdDevice=32.02
[ 654.680066] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 654.680076] usb 1-1.1.2: Product: JMS579
[ 654.680089] usb 1-1.1.2: Manufacturer: JMicron
[ 654.680098] usb 1-1.1.2: SerialNumber: 819A40B34
[ 654.705986] usb 1-1.1.2: The driver for the USB controller dwc_otg_hcd does not support scatter-gather which is
[ 654.706010] usb 1-1.1.2: required by the UAS driver. Please try an other USB controller if you wish to use UAS.
[ 654.706023] usb-storage 1-1.1.2:1.0: USB Mass Storage device detected
[ 654.706535] usb-storage 1-1.1.2:1.0: Quirks match for vid 152d pid 0578: 1000000
[ 654.707543] scsi host0: usb-storage 1-1.1.2:1.0
[ 655.759300] scsi 0:0:0:0: Direct-Access TOSHIBA MK6465GSXN 3202 PQ: 0 ANSI: 6
[ 655.761789] sd 0:0:0:0: [sda] 1250263728 512-byte logical blocks: (640 GB/596 GiB)
[ 655.762164] sd 0:0:0:0: [sda] Write Protect is off
[ 655.762171] sd 0:0:0:0: [sda] Mode Sense: 47 00 00 08
[ 655.762462] sd 0:0:0:0: [sda] Disabling FUA
[ 655.762469] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 655.786099] sda: sda1
[ 655.787942] sd 0:0:0:0: [sda] Attached SCSI disk
Tried to change the io governor from mq-deadline to kyber - no effect
Tell me please what else can provide or test.
The text was updated successfully, but these errors were encountered: