Author Topic: How to reduce unnecessary disk activity?  (Read 2975 times)

Offline vc

  • Hero Member
  • *****
  • Posts: 519
How to reduce unnecessary disk activity?
« on: January 20, 2010, 11:07:31 AM »
Yes, I am being stupid again - after all; what else could be expected of me?  I've installed Minime09 into a single XFS-formatted partition, to see how it would behave - and what I am observing is that the disk is being accessed repeatedly, with an interval of around a second, or several.  Why is this occurring, and what could I do to eliminate it, please?
« Last Edit: January 20, 2010, 11:09:14 AM by vc »

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5335
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: How to reduce unnecessary disk activity?
« Reply #1 on: January 20, 2010, 11:57:10 AM »
Well you really haven't given any information to help you. Try opening 'top' in a console window and see what is using your resources, or you an open the process table (press 'ctrl and esc') keys at the same time an it will show you the processes and which ones are chewing up the most time.




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #2 on: January 20, 2010, 03:13:37 PM »
Well you really haven't given any information to help you. Try opening 'top' in a console window and see what is using your resources, or you an open the process table (press 'ctrl and esc') keys at the same time an it will show you the processes and which ones are chewing up the most time.

You're correct; I should have been more clear.  What I am really wondering is if this behaviour is something that PCLinuxOS does normally, in the background?  (My 'main' computer is an EeePC; I never notice the drive accesses on that thing because it's all SSD anyway).  Or - is this on the other hand something that would normally be a characteristic of the XFS filesystem, instead?

Anyway; here is my current top listing and process table, as you have requested:

[attachment deleted by admin]

Offline oldschool

  • Full Member
  • ***
  • Posts: 148
Re: How to reduce unnecessary disk activity?
« Reply #3 on: January 20, 2010, 05:09:44 PM »
vc,

I read a post somewhere (don't rember where) that talked about the differences in filesystems. One of the things mentioned was that XFS tended towards lots of disk activity and therefore some felt it was haarder on hardware. Apparently, the solution is to use a different filesystem, such as EXT3 or 4.


oldschool
"Great horny-toads!"

Online Rudge

  • Hero Member
  • *****
  • Posts: 9701
  • I'm Just A Dog.
Re: How to reduce unnecessary disk activity?
« Reply #4 on: January 20, 2010, 06:19:20 PM »
I always thought this was hal doing this. If not, I should open a new thread. I know sr0 is my dvd but still.

edit: file system ext3. My hard drive does this too.

ps -ef | grep hal
72        2090     1  0 00:13 ?        00:00:00 hald
root      2094  2090  0 00:13 ?        00:00:00 hald-runner
root      2278  2094  0 00:13 ?        00:00:00 hald-addon-input: Listening on /dev/input/event1 /dev/input/event0
root      2335  2094  0 00:13 ?        00:00:08 hald-addon-storage: polling /dev/sr0 (every 2 sec)
500      26261 26198  0 20:15 pts/1    00:00:00 grep --color hal
[rudge12000@localhost ~]$
 
« Last Edit: January 20, 2010, 06:24:39 PM by rudge »


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #5 on: January 20, 2010, 08:06:19 PM »
I seem to recollect encountering a related issue once, back around the 'Big Daddy' day, when I was wondering why video playback on a K6-2/500 machine seemed regularly 'skippy'.  The answer to that particular problem turned out to be a simple editing of /etc/gamin.rc, in order to disable its polling.  I was wondering if a similar condition may be affecting my system today; however, a quick lsof doesn't seem to indicate gamin-anything... so,  I'm supposing now that it's likely something else instead.  I had wondered about the XFS filesystem a bit, but then here's rudge on the other hand, stating that his ext3-based system suffers the same behaviour.  Hal?  Possibly.  Again, I really don't know, so that's why I'm enquiring.

Edit:  rudge, from the listing you posted above it does indeed seem to be a behaviour that could be attributable to the hal daemon.  Is there any way to reconfigure same, such that it would avoid any polling of certain designated devices?
« Last Edit: January 20, 2010, 09:13:33 PM by vc »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: How to reduce unnecessary disk activity?
« Reply #6 on: January 21, 2010, 01:52:53 AM »
Code: [Select]
root      3229  3055  0 08:16 ?        00:00:00 hald-addon-storage: no polling on /dev/hda because it is explicitly disabled
root      3251  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sdc (every 2 sec)
root      3252  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sdd (every 2 sec)
root      3253  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sde (every 2 sec)
root      3254  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sdf (every 2 sec)
root      3255  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sr1 (every 2 sec)
root      3256  3055  0 08:16 ?        00:00:00 hald-addon-storage: polling /dev/sr0 (every 2 sec)

That looks to me like HAL is doing what it is supposed to do ......... poll the removable media locations to check if something has been inserted. In my case sdc -> sdf  are sockets in a USB hub. sr0 & sr1  my two optical drives.

regards.

Online Rudge

  • Hero Member
  • *****
  • Posts: 9701
  • I'm Just A Dog.
Re: How to reduce unnecessary disk activity?
« Reply #7 on: January 21, 2010, 08:54:52 AM »
vc just as JohnBoy said, I think this is exactly what HAL is supposed to be doing. If you turn off that polling, your system won't recognize and auto mount cds, dvds or usb devices.


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: How to reduce unnecessary disk activity?
« Reply #8 on: January 21, 2010, 09:19:30 AM »
Have you tried using "-noatime" as a mount option?  Very rarely would you need to update the last access time (create and modify get used more often).

You could also try looking into what tweaks can be made to the filesystem:
http://www.google.ca/search?hl=en&q=xfs+tweaks&btnG=Search&meta=&aq=0&oq=xfs+twea
(The first hit http://everything2.com/title/Filesystem+performance+tweaking+with+XFS+on+Linux, looked interesting).

There are also the man pages for the various xfs_* utilities:
Code: [Select]
[root@grendel ~]# xfs_
xfs_admin      xfs_db         xfs_growfs     xfs_mdrestore  xfs_quota
xfs_bmap       xfs_estimate   xfs_info       xfs_metadump   xfs_repair
xfs_check      xfs_freeze     xfs_io         xfs_mkfile     xfs_rtcp
xfs_copy       xfs_fsr        xfs_logprint   xfs_ncheck
[root@grendel ~]# xfs_
(You have to be root to access these utils)

While I am running XFS on a 1.5T drive, I haven't played with tweaking it much.  Sorry :(



Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #9 on: January 21, 2010, 06:19:07 PM »
Have you tried using "-noatime" as a mount option?  Very rarely would you need to update the last access time (create and modify get used more often).

Yes, I did.  However, every time I went through the disk partitioner, the install failed - even if nothing had been done, and the disk partitioner cancelled.  I learned that the only successful method involved first creating the partition with a GParted live CD, and then selecting 'Use Existing Partitions' during the install, in order to avoid entering into the disk partitioner section entirely.  Unfortunately, this method affords no access to the -noatime parameter, so I was unable to implement it.

You could also try looking into what tweaks can be made to the filesystem:

Yes, that shall indeed by my next step - and thank you for the links, also.

(You have to be root to access these utils)

Acknowledged.

While I am running XFS on a 1.5T drive, I haven't played with tweaking it much.  Sorry :(

Same here, actually - I've been running it on a 500GB USB external for about a year now, and it's never behaved in an unusual or abnormal manner.  It's simply that this is the first I've attempted, of booting it - that, along with the non-standard partitioning and installation method.

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #10 on: January 21, 2010, 06:24:31 PM »
vc just as JohnBoy said, I think this is exactly what HAL is supposed to be doing. If you turn off that polling, your system won't recognize and auto mount cds, dvds or usb devices.

Well, yes; I realise that - as I said, I don't wish to turn it off entirely.  The problem is that it autodetects the SDHC card in an EeePC as a 'removable device', and it is there that I would wish to disable its polling for in my EeePC installs the SDHC card is integral to the / filesystem; it is part of the system, never a 'removable' device at all.
« Last Edit: January 21, 2010, 06:32:51 PM by vc »

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: How to reduce unnecessary disk activity?
« Reply #11 on: January 22, 2010, 07:05:46 AM »
Have you tried using "-noatime" as a mount option?  Very rarely would you need to update the last access time (create and modify get used more often).

Yes, I did.  However, every time I went through the disk partitioner, the install failed - even if nothing had been done, and the disk partitioner cancelled.  I learned that the only successful method involved first creating the partition with a GParted live CD, and then selecting 'Use Existing Partitions' during the install, in order to avoid entering into the disk partitioner section entirely.  Unfortunately, this method affords no access to the -noatime parameter, so I was unable to implement it.


After the install has been completed, you can edit the /etc/fstab file and implement the -noatime option there.  Unmount and remount, or reboot to enable (well, actually, disable  ;) ) it.
See
Code: [Select]
man fstab for details.

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #12 on: January 24, 2010, 09:19:48 AM »
Bit of a flurry of investigational activity being undertaken at this end during this time, so by now I have something to report.  I did edit fstab as you suggested; however, it did not seem to make any real difference - the 'background' disk activity remains unabated, regardless.

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: How to reduce unnecessary disk activity?
« Reply #13 on: January 25, 2010, 06:26:45 AM »
And, just to be sure...you've rebooted (or otherwise re-mounted the drives in question) since editting the file, so that the changes are in place?  You can check with:
Code: [Select]
mount
Example:
Quote
[jpaglia@core2pclinuxos ~]$ mount
/dev/sda1 on / type ext3 (rw,noatime)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=0620)
none on /proc/bus/usb type usbfs (rw)
/dev/sda6 on /home type ext3 (rw,noatime<-- Here is my /home partiton on this machine, mounted with -noatime...
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
[jpaglia@core2pclinuxos ~]$

Offline vc

  • Hero Member
  • *****
  • Posts: 519
Re: How to reduce unnecessary disk activity?
« Reply #14 on: January 29, 2010, 01:14:10 PM »
Yes, I did reboot completely.  As of now, I have also had the chance to test same on a couple of other machines - still no difference; the disk light still flashes on a freshly-booted-but-otherwise-untouched machine, and gkrellm indicates persistent activity also.  In comparing between several different installation layouts, it seems to me as though the activities are likely accessing something in the /var partition.  Could it be related to system monitoring, or logging functions?

Additional observation:  my original EeePC does not suffer from such behaviour.  It is an old install of Minime 2008.1 with KDE 3.5.9, and it has not been updated in quite a while.  It is partitioned as follows:

sda1 --- /
sdb1 --- /tmp
sdb2 --- /var
sdb3 --- /home

With all partitions being primary, formatted with ReiserFS, and also with notail,noatime set in fstab.  The internal 4GB SSD is /dev/sda, whereas /dev/sdb is an 8GB SDHC card.
« Last Edit: January 29, 2010, 02:17:44 PM by vc »