System slows down/intermittent freeze happens while copying large files to USB HDD
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
System slows down/intermittent freeze happens while copying large files to USB HDD
Hi folks,
System details-
Lenovo ThinkPad L412, Intel i5-540, 4GB DDR3, Kingston SSDUV100 120GB, Linux Mint 17.1 KDE 4.14.2
Kernels - 3.19.0-18-generic AND 4.0.4-040004-generic
File system - ext4 on both / and /home
Problem-
Generally the system is as fast as anything on day to day operations for both the kernels, as well as previous kernels as well(3.13 - 3.18). However, one problem which has been there since the beginning is- when I copy a large file of size more than 1-2GB any of either my 2 USB hard disks(USB3 WD, USB2 Seagate) or any of the pen drive I attach, the system starts to crawl. The mouse starts to stutter around, alt-tab gets slow, basically everything starts to get slow.
Its not the high CPU, neither high RAM usage, I have checked that.
How to reproduce the issue-
-Copy a large file via Dolphin.
-Copy via command line.
Both ways the issue remains same.
Additional details-
Attached iostat, iotop and top output at the time of copying a large vdi file from my home directory to the USD HDD.
Any help would be really appreciated.
Regards
Last edited by PrinceCruise; 07-22-2015 at 11:22 AM.
Hi
So, this happens as well when you're not reading anything and just writing to the external storage (e.g. "dd if=/dev/zero of=/mnt/myexternalhdd/deleteme.testdata bs=1M count=3072 && sync)?
Hi
So, this happens as well when you're not reading anything and just writing to the external storage (e.g. "dd if=/dev/zero of=/mnt/myexternalhdd/deleteme.testdata bs=1M count=3072 && sync)?
Hi
So, this happens as well when you're not reading anything and just writing to the external storage (e.g. "dd if=/dev/zero of=/mnt/myexternalhdd/deleteme.testdata bs=1M count=3072 && sync)?
Hey, thanks for replying man. Sorry couldn't respond earlier, girlfriend was staying overnight.
I in fact checked the values of dirty_bytes and dirty_background_bytes before writing the post and both are already set to 0. I'd need more digging up on dirty_ratio value though.
At least one of the file systems involved is NTFS by way of FUSE, a user land process...
Quote:
Originally Posted by PrinceCruise
Its not the high CPU, neither high RAM usage, I have checked that.
There's a ludicrous iowait percentage of over 50 pointing back at two kernel, two user land KDE and a mount.ntfs process. I agree testing sets of VMM values, EXT4 mount options and previous kernel versions would be a good idea. BTW ever heard of 'ionice'?
At least one of the file systems involved is NTFS by way of FUSE, a user land process...
Not sure if understood the reference. Yes, I'm copying a large file from my /home to a /media/ mounted USB hdd.
Quote:
Originally Posted by unSpawn
There's a ludicrous iowait percentage of over 50 pointing back at two kernel, two user land KDE and a mount.ntfs process. I agree testing sets of VMM values, EXT4 mount options and previous kernel versions would be a good idea. BTW ever heard of 'ionice'?
Correct. That's one of the areas baffling me as well. I'll test the vm values and update once back home.
You want me to ionice which process btw, I'm sorry?
iowait doesn't mean waiting for I/O - not necessarily anyway. And even when it does, there is no way to tell what is waiting for the I/O to complete.
Mindlessly useless metric these days - may have made sense in the days of uniprocesors. Maybe.
in place, I tested dd if=/dev/zero of=/media/cruise/hp/deleteme.testdata bs=1M count=3072 && sync as suggested by good guy Pearlseattle. The KDE/system froze completely for a min or so, didn't just go slow, it completely went frozen. After the file was written, the system came back to normal. IOWAIT was still around 50, if that matters.
2. I went through the link http://lwn.net/Articles/572911/ and from what I understood there, I thought of testing using small values of dirty_ratio and dirty_background_ratio -
With these small values in place, I ran the same dd test above and VOILA! the system didn't freeze. It acted like nothing's happening. The iowait was still around 50, if that still matters.
I'm going to read some more into this and play around with other values, will keep updating. Any further inputs are really appreciated.
iowait doesn't mean waiting for I/O - not necessarily anyway. And even when it does, there is no way to tell what is waiting for the I/O to complete.
Mindlessly useless metric these days - may have made sense in the days of uniprocesors. Maybe.
Could you please contribute to this thread constructively instead of only providing negatives?
Quote:
Originally Posted by PrinceCruise
Thanks for replying mod.
Not a mod in this thread, just a regular user.
Quote:
Originally Posted by PrinceCruise
Not sure if understood the reference. Yes, I'm copying a large file from my /home to a /media/ mounted USB hdd.
Its just that user land processes are dealt with differently compared to kernel processes.
Quote:
Originally Posted by PrinceCruise
You want me to ionice which process btw, I'm sorry?
As it's not in your fstab, what is "/media/cruise/hp" here? Because I was under the impression that you had trouble copying from removable media to your system ssd?..
Not a mod in this thread, just a regular user.
....
Its just that user land processes are dealt with differently compared to kernel processes.
...
Couldn't hurt to try?
...
As it's not in your fstab, what is "/media/cruise/hp" here? Because I was under the impression that you had trouble copying from removable media to your system ssd?..
Hello unSpawn,
Appreciate the response! I actually wanted to know what process do you want me to ionice? Is it the copying process, the system gets to slow, I can't even type a command properly.
That hp is the label of the pen drive I'm using as one of the USB medias. It shouldn't be in fstab, just mounted in current session. The issue persisted with any external USB media.
By the way, I managed a workaround as my above post and will test a few more things tonight.
I actually wanted to know what process do you want me to ionice? Is it the copying process, the system gets to slow, I can't even type a command properly.
Just start the copying with say 'ionice -n3 -c3 cp /path/to/src /path/to/dst;'?
Quote:
Originally Posted by PrinceCruise
The issue persisted with any external USB media.
Regardless of external media file system? NTFS-3g as well as VFAT or EXT2?
Just start the copying with say 'ionice -n3 -c3 cp /path/to/src /path/to/dst;'?
Let me play around with the dirty values and I will test this as well, thanks much.
Quote:
Originally Posted by unSpawn
Regardless of external media file system? NTFS-3g as well as VFAT or EXT2?
Because both my USB drives contain backups and are of ntfs, I couldn't test that. But hey, I can test it with that hp pen drive by formatting it in a different file system. Great idea.
With these small values in place, I ran the same dd test above and VOILA! the system didn't freeze. It acted like nothing's happening.
As would be hoped.
Where did you get the original (40/60) numbers from ?. Committing up to 60% of your RAM to I/O pages and no swap seems highly adventurous.
The effects can be seen in your attachments - you really do not want kswapd waiting on I/O (state "D" in top) or chewing up CPU trying to find unused pages to allocate. Especially when you have no swap (kswapd doesn't just deal with swap BTW) ...
When you next run the tests with the lower value, post similar attachments to the original.
As would be hoped.
Where did you get the original (40/60) numbers from ?. Committing up to 60 of your RAM to I/O pages and no swap seems highly adventurous.
The effects can be seen in your attachments - you really do not want kswapd waiting on I/O (state "D" in top) or chewing up CPU trying to find unused pages to allocate. Especially when you have no swap (kswapd doesn't just deal with swap BTW) ...
When you next run the tests with the lower value, post similar attachments to the original.
Hi,
I have no idea. If you see the values I posted first, those were 60/1. And I have good amount of swap assigned to my system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.