Disk i/o slows down system
I've noticed for a long time that anything doing a lot of disk i/o can bring the system to it knees. This is usually when starting something like a VM or any program that loads a lot of stuff from disk at startup, so it's not a problem most of the time. However, if I have a backup process that is transferring stuff over the network to a storage device at the max rate of the network, which is only 1GB, it causes noticeable performance problem even though there is little cpu or memory being consumed.
(FWIW, Windows is if anything, worse. Something on Windows that hammers the hard drive bring Windows to it's knees just as bad if not worse.) Is this just the nature of the beast? Are there any kernel options or other settings that can set disk i/o to a lower priority so it does not interfere with the real time operation of a desktop box? |
Main reasons nowadays for poor hard drive performance:
1. It is set to IDE mode in BIOS. 2. Partitions are misaligned (drive with 4096 B sectors is aligned to 512 B). |
Are you running a 32-bit kernel? If so, try this:
Code:
echo 1 > /proc/sys/vm/highmem_is_dirtyable |
i have found when writing heavily to the disk that holds the operating system is when the system will freeze.
so i always try to use at least a second hard drive to hold data, that way reading/writing to that is less likely to freeze the system. |
I also notice major slowdown when I copy large files to USB flash drives through KDE (dolphin).
If I open a console and use midnight-commander to copy the same files to the same flash drive there is no slowdown... Can I set default i/o with lower priority for dolphin or ioslaves on KDE? (tried ionice, didn't work) |
man ionice:
Quote:
As an example, I use the following in my kernel building script: Code:
renice -n 19 $$ >/dev/null # be kind, renice. Another option might be to swap from the CFS to deadline scheduler, but whether that helps you or not may depend on the characteristics of your workload. P.S. 'nice' priorities only work relative to other processes in the same cgroup, so if you're using cgroups you'll have to use the cgroup related mechanisms instead. This is one of the reasons I have for not liking cgroups, and by extension systemd which starts everything in its own individual cgroup. |
You could try the BFQ-scheduler (available as kernel-patch). It doesn't work for 4.3 kernel right now but should be updated soon. I hope it will be included in mainline some day.
|
Quote:
note that ionice only works with the CFQ deadline, on the other hand, may or may not help in general it will make the computer faster but it might cause hickups in real-time processes another potential problem comes if the kernel does too much buffering (that i suspect OP may be experiencing) that happened to me when copying huge files to usb, as the kernel would have to wait to flush to get some memory back iotop could help diagnose, slabtop iirc and idk, forgot many of these already |
Using legacy IDE mode rather than AHCI shouldn't impact perform that much. You're only dealing with how the disk is managed across the SATA bus. Usually things like disk thrashing from inadequate swap space are my main culprits, or a badly bottlenecked CPU, like a single core.
Try booting with hdparm enabled to optimize disk read/write, and try increasing your physical RAM as well. A new multicore CPU can help greatly. Having your swap space closer to the front of the drive helps also with speed. |
Quote:
The author of BFQ links to a couple of youtube videos on the page linked to above, quite worth a look. |
Quote:
You can just try it out and see if it helps. Code:
echo deadline > /sys/block/sda/queue/scheduler |
The way to fix a performance bottleneck is to add more capacity of whatever is causing the bottleneck. I suggest that you install a second hard drive and balance your disk I/O demand across the two drives.
------------------ Steve Stites |
Quote:
|
This thread: http://www.linuxquestions.org/questi...ty-4175557039/ was very helpful to me when I had similar performance issues. Mapping out the bad blocks on my disk made a really big difference. There were a lot of bad blocks and I am about to replace the whole drive with a new one (which of course is twice the capacity and costs half as much as the original drive...)
|
All times are GMT -5. The time now is 08:13 AM. |