LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-03-2015, 10:22 AM   #1
Ook
Member
 
Registered: Apr 2004
Location: Hell, Arizona (July - 118 degrees)
Distribution: Slackware 14.2 soon to be Slackware 15
Posts: 699

Rep: Reputation: 131Reputation: 131
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?
 
Old 11-03-2015, 10:26 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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).
 
Old 11-03-2015, 10:37 AM   #3
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,524

Rep: Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492Reputation: 8492
Are you running a 32-bit kernel? If so, try this:

Code:
echo 1 > /proc/sys/vm/highmem_is_dirtyable
 
Old 11-03-2015, 11:25 AM   #4
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Rep: Reputation: 26
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.
 
Old 11-03-2015, 12:08 PM   #5
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
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)
 
Old 11-03-2015, 12:21 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,904

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
man ionice:
Quote:
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked for an I/O priority inherits its CPU scheduling class. The I/O priority is derived from the CPU nice level of the process (same as before kernel 2.6.26).
So if you nice -n 19 whatever it is you're running it should have less of an impact on the responsiveness of the rest of your system while it's running. If you want to lower the priority even further you can put it in SCHED_IDLE using chrt -i and/or ionice -c 3, but usually I find the nice -n 19 more than sufficient to keep the system responsive.

As an example, I use the following in my kernel building script:
Code:
renice -n 19 $$ >/dev/null   # be kind, renice.
chrt -b -p 0 $$              # non-interactive batch scheduling class.

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.

Last edited by GazL; 11-03-2015 at 12:28 PM.
 
1 members found this post helpful.
Old 11-03-2015, 01:02 PM   #7
eldercitizen
Member
 
Registered: Apr 2015
Distribution: Slackware64-current
Posts: 38

Rep: Reputation: 31
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.

Last edited by eldercitizen; 11-03-2015 at 01:04 PM.
 
1 members found this post helpful.
Old 11-03-2015, 02:24 PM   #8
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
man ionice:


So if you nice -n 19 whatever it is you're running it should have less of an impact on the responsiveness of the rest of your system while it's running. If you want to lower the priority even further you can put it in SCHED_IDLE using chrt -i and/or ionice -c 3, but usually I find the nice -n 19 more than sufficient to keep the system responsive.

...

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.
was going to say the same
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

Last edited by genss; 11-03-2015 at 02:25 PM. Reason: invalid reference
 
1 members found this post helpful.
Old 11-03-2015, 02:36 PM   #9
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
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.
 
Old 11-04-2015, 02:38 PM   #10
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 497

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by eldercitizen View Post
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.
I can only second that. I have been using BFQ and BFS for years, enjoying good responsiveness even under heavy load.

The author of BFQ links to a couple of youtube videos on the page linked to above, quite worth a look.
 
Old 11-04-2015, 05:10 PM   #11
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by GazL View Post
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.
I'll be the third to agree that trying this may resolve the issue. I've used CFQ for a while in the past and I did notice the same symptoms (system slowdown caused by disk I/O). As soon as I switched to deadline, it never happened again.

You can just try it out and see if it helps.
Code:
echo deadline > /sys/block/sda/queue/scheduler
Change 'sda' to whatever disk.
 
Old 11-04-2015, 06:53 PM   #12
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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
 
Old 11-07-2015, 09:51 AM   #13
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 497

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by jailbait View Post
The way to fix a performance bottleneck is to add more capacity of whatever is causing the bottleneck.
This is not always the solution. Sometimes you have to find a smarter way of how you do things. Particularly when algorithms are involved.
 
Old 11-08-2015, 03:49 AM   #14
bogzab
Member
 
Registered: Mar 2006
Location: Dyserth, Wales
Distribution: Slackware 14.0, Slackware 14.1, Slackware-current
Posts: 306

Rep: Reputation: 33
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...)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] WEBDAV slows system down? JamesGT Slackware 10 01-23-2014 10:24 PM
usb-disk slows down my system thorstenk Linux - Hardware 3 03-09-2007 05:12 PM
Screensaver slows system down mekump Linux - General 1 08-31-2006 07:21 AM
Heavy disk access slows machine p-static Linux - Hardware 4 08-28-2004 02:18 PM
Network slows down system davecs Linux - Software 10 07-13-2003 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration