Can I change the physical data position manually to increase the performance?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Can I change the physical data position manually to increase the performance?
I look currently for a possibility to change the physical position of specific files/folders on my HDDs. The database folder of MySQL should be for example on the fast part of the HDD(Outside). The Server HDDs are connected to a 3ware hardware raid controller (Raid 1).
I'm afraid you've a wrong imagine about physical storage. HDD has its own electronics and software that calculate physical data position and that is responsible for asymmetrical sectors layout on HDD plates. It is nearly impossible to change it in OS level.
I'm afraid you've a wrong imagine about physical storage. HDD has its own electronics and software that calculate physical data position and that is responsible for asymmetrical sectors layout on HDD plates. It is nearly impossible to change it in OS level.
Notwithstanding that comment, true though it might or might not be, (IMHO...) it simply doesn't matter in the end. Hard drives themselves often have very sophisticated electronics, including on-board caching and the ability to do asynchronous writes, and controller (cards) can be even smarter. Any "speed advantage" that you might imagine getting by virtue of the fact that your data is located 8cm instead of 4cm from the center of the platter are chimerical. Rotational delay is insignificant; seek-time is where you lose it.
Remember, CPUs operate in terms of nanoseconds, buses and so-forth in microseconds, and hard drives still require many milliseconds to do anything. Caches (both in the hardware and in Linux's own buffer pool) are where it's at.
The outside is the fastest for sustained transfer (when caches no longer help) but that is irrelevant if the actual activity occurs in small transfers. The middle is best to minimise seek times but that is irrelevant if the heads spend most of their time where the critical data is anyway.
Obviously. I mean, the very existence of disk defragmenters disproves this.
Anyway, the solution seems pretty obvious to me. Wipe the drive, and restore the parts that need to go onto the fastest parts of the drive first. The disk controller will write that to the fastest part of the drive. Then continue with what needs to go to the next fastest part. And so on.
Setting up a partition at the front of the drive for fast data access should work too.
Personally I agree with sundialsvcs, I think the OP is being extremely optimistic.
I'd also like to see a citation for
Quote:
restore the parts that need to go onto the fastest parts of the drive first. The disk controller will write that to the fastest part of the drive
Quite frankly I doubt it is that predictable with modern tech, not forgetting the OP is using a RAID, not a single disk.
If I was the user, I would want to profile the performance to see where the actual bottleneck is.
Given we're talking an RDBMS based system, it's often the lack of or incorrect indexes in the DB that is the issue.
Last edited by chrism01; 02-05-2012 at 08:06 PM.
Reason: code->quote
It's covered in Andrew Tanenbaum's "Modern Operating Systems". Due to the way hard drives work, it's obvious that all "modern tech" hard disks do indeed still work this way (except for SSDs, of course). The fact that it's a RAID does not change this; the RAID controller will start writing from the outside edges of each drive, then work its way inwards.
If by "citation" you just meant some pages where this information appears, here are some that showed up in a google search:
The outside may be relatively faster to the head in terms of mph or so. The problem is that the drive heads have to keep going back to the source to tell where the next block is. I think to save head movements since they are the slowest we now use the middle of the disk to hold partition and file location and apply data to both sides of the middle out. The stuff posted above is like it was 20 years ago.
I think sparse defragmenting would help more than worrying about the outside or the inside of the disk. XFS has such a defragmenter, I also wrote a script that can do it on filesystems that supports extents, it is on my site.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.