Slower concurrent disk access with NCQ ?
Hi!
In theory NCQ should speed up things when multiple threads/taks/processes/programs are accessing the hard drive, right ?
But I see the opposite.
My mainboard (details below) can run its ICH9R SATA adapter in legacy or AHCI mode.
I noticed, that in AHCI mode (it allows NCQ, as opposed to legacy mode) I get huge (reproducible) slowdowns.
I did the following test procedure:
Preparations
- create a test directory , like : md C:\src
- put two large (gigabyte) files in it ([1])
- create a destination directory, like : md c:\dest
Test run:
- reboot (to make same conditions for each test run)
- open a command prompt (cmd.exe)
- run the command : copy c:\src c:\dest
- while the copy is running, open the start menu and start Wordpad
- after Wordpad starts, close it
- from the start menu start (and again immediately close) also: Notepad, Calculator, Paint
(They are all under "All Programs"/"Accessories")
(note: do this while the copy is running)
Measure the time it takes to start each program (no need for a clock, counting seconds in your head is more than enough).
What happens on my system is this :
- in legacy mode, each program starts in a seconds (Wordpad, being larger, takes 3-5 seconds)
- in AHCI mode, it sometimes it takes 2 seconds, sometimes it takes a minute ! Often, it takes 10 seconds just for the Start submenus to open.
I tried several operating systems: Windows 2003 Enterprise, Vista Enterprise, Windows XP Professional SP2, Windows 2008 x64
In all cases: legacy mode works smooth, AHCI mode have the "minute to start wordpad" problem.
Driver used:
- for legacy mode : Windows builtin Standard IDE driver
- for AHCI mode :
-- Windows XP and 2003 : Intel Matrix Storage Manager v7.8
-- Windows 2008 and Vista : msahci.sys (Windows builtin AHCI driver)
-- Vista : also tried Intel Matrix Storage Manager v7.8
There was only one exception to the "AHCI is much slower" result: Windows XP Pro SP2, updated to SP3, then cloned to another partition and finally changed from legacy mode to AHCI (by: force install the intel driver, reboot, change setting in BIOS, boot Windows)
In this case, I did not see the problem.
I contacted MS newsgroups, Asus support, Intel support. But no useful response. (Intel said : We have not replicated such issue nor have other customers reported it.) Talks with Asus are ongoing.
Did anyone experience this ?
Solution ? Just run in legacy mode ?
Regards,
David
[1] - I used the two freely downloadable iso images from this page : Windows Server 2008 Trial Software
My system details:
mainboard : Asus P3K-E WiFi AP , BIOS version 1013, Intel P35 & ICH9R chipset
CPU: Intel Q6600 (not overclocked)
RAM: 4x2GB DDR2-800 (Transcend JM800QLU-2G)
gfx: Gigabyte GV-NX88T512HP/typeA
HD: Western Digital WD7500AAKS - connected to one of the ICH9R SATA ports
optical: Samsung SH-S203P - connected to one of the ICH9R SATA ports
(problem same even if I disconnect the optical unit)
Re: Slower concurrent disk access with NCQ ?
I don't think your test is really providing sufficient queue depth for NCQ to be useful. Where you don't have deep queueing then running without NCQ is usually quicker, depending on the drive and firmware used.
Re: Slower concurrent disk access with NCQ ?
NCQ is only useful for stacking SATA commands in an order which is optimal for i/o across several sections of the disk surface in as little rotations as possible, so, great for 10 different processes doing i/o in different files... pointless for copying 2gb file from a to b. Your benchmark wouldn't make use of it.
Re: Slower concurrent disk access with NCQ ?
Stupid question but how do you enable/disable NCQ?
Re: Slower concurrent disk access with NCQ ?
In the BIOS, or driver config, or disk jumper, or where none of the former are available, you can't.
Re: Slower concurrent disk access with NCQ ?
Well I don't really care about NCQ, but more about "Why is it 50 times slower in AHCI mode" ?
And "Does it behave like that for others too or is there some defect in my equipment" ?
Re: Slower concurrent disk access with NCQ ?
AHCI is noted as being a pain in the bum for some systems. Out of my last three system builds it introduced some kind of system problem in two of the three (one cold boot problem, one warm boot).
So yes, it behaves badly in other systems, and unless you need RAID I'd strongly advise running in IDE mode.
Re: Slower concurrent disk access with NCQ ?
Quote:
Originally Posted by
xerces8
Well I don't really care about NCQ, but more about "Why is it 50 times slower in AHCI mode" ?
And "Does it behave like that for others too or is there some defect in my equipment" ?
The reason why it is much slower with NCQ is that it is prioritizing your copying, when it is busy copying it wouldn't response to your other request to open notepad. On the other hand, with NCQ off the harddrive treat your request to copy file and open notepad as equal, so notepad will open faster (since it is smaller).
Without NCQ it may take 3 minutes to open notepad AND finish copying the file.
With NCQ it may take 2 minutes 50 seconds to open notepad AND finish copying the file.
In this example the overall speed was 6% faster, but the notepad could be 50 times slower.
Re: Slower concurrent disk access with NCQ ?
That does not explain why another PC does not have the mentioned slowdowns when also running in AHCI mode.
For example a laptop with a "82801GBM/GHM (ICH7 Family) SATA AHCI Controller".
Re: Slower concurrent disk access with NCQ ?
Bad AHCI implementation perhaps?
Re: Slower concurrent disk access with NCQ ?
Quote:
Originally Posted by
aidanjt
Bad AHCI implementation perhaps?
Can be, but it is Intel ICH9R , their flagship iplementation, so to speak.
(and the software is also their latest, if you meant software)
That leaves the BIOS and motherboard hardware of Asus ...
Re: Slower concurrent disk access with NCQ ?
Well of the two intel chipsets I built recently, the 945 based system with an ASRock m/board had no problems while the 965 based system with a gigabyte m/board did.
You might want to check for presence of other SATA controllers - JMicron ones might well be getting in the way somehow.
Re: Slower concurrent disk access with NCQ ?
Quote:
Originally Posted by
kalniel
Well of the two intel chipsets I built recently, the 945 based system with an ASRock m/board had no problems while the 965 based system with a gigabyte m/board did.
You might want to check for presence of other SATA controllers - JMicron ones might well be getting in the way somehow.
1.) Problems as per my test above ?
2.) Yes, my board has a JMicron JB363 adapter. I will try if disabling it makes any difference.
PS: The JB363 can not talk to my WD MyBook Studio 500GB ... I guess a known problem, because many are reporting it.
Re: Slower concurrent disk access with NCQ ?
Quote:
Originally Posted by
arthurleung
The reason why it is much slower with NCQ is that it is prioritizing your copying, when it is busy copying it wouldn't response to your other request to open notepad. On the other hand, with NCQ off the harddrive treat your request to copy file and open notepad as equal, so notepad will open faster (since it is smaller).
Without NCQ it may take 3 minutes to open notepad AND finish copying the file.
With NCQ it may take 2 minutes 50 seconds to open notepad AND finish copying the file.
In this example the overall speed was 6% faster, but the notepad could be 50 times slower.
When posting theories like that, please state them as theories or opinion, not as accepted fact. Otherwise you may confuse whoever asked the question in the first place and they may end up believing this as fact.
@xerces8
I am using AHCI on my Asus P5k-E Wifi/AP which has an ICH9R
I will see if I can reproduce your problem.
Re: Slower concurrent disk access with NCQ ?
Badass, arthurleung was close to what I understand to be the way that NCQ works, and I think we all understand that no matter how good Hexites might seem, this is internets.
NCQ queues commands in order of least disk head movement. It has no idea about the priority of these commands aside from where they want to access on the disk. As such, it will place the contiguous file copy requests before the smaller, located elsewhere, read requests for launching programs.
NCQ is a multi-user (process) server-grade technology, that comes into it's own when a large number of drive read/write requests are made in a highly scattered pattern, all over the platters. Unless you are using raid (which can benefit some, I believe), or running dozens of programs all wanting access to different areas of the drive, then you will not see any real benefit, and could well find that for practical usage, it orders commands in a manner which, although improving total response time, slows down the more time-critical requests, worsening performance.
Re: Slower concurrent disk access with NCQ ?
Quote:
Originally Posted by
Rosaline
Badass, arthurleung was close to what I understand to be the way that NCQ works, and I think we all understand that no matter how good Hexites might seem, this is internets.
NCQ queues commands in order of least disk head movement. It has no idea about the priority of these commands aside from where they want to access on the disk. As such, it will place the contiguous file copy requests before the smaller, located elsewhere, read requests for launching programs.
NCQ is a multi-user (process) server-grade technology, that comes into it's own when a large number of drive read/write requests are made in a highly scattered pattern, all over the platters. Unless you are using raid (which can benefit some, I believe), or running dozens of programs all wanting access to different areas of the drive, then you will not see any real benefit, and could well find that for practical usage, it orders commands in a manner which, although improving total response time, slows down the more time-critical requests, worsening performance.
The theory although relevant has been incorrectly applied. The cause of the OP's problem is most certainly not NCQ. NCQ can and does slow down accessing of data when there is only 1 program requesting data, however we are talking about small percentage differences here. I have seen direct comparisons.
When more than 1 program is accessing the disk, NCQ compared to non NCQ will always speed up both programs.* Once again, I have seen the graphs - they were linked from this forum but I cant find them.
I have been unable to reproduce the notepad problem on my PC running in AHCI mode.
In fact, copying 2 very large files simultaneously on my machine made the HDD's thrash like buggery and the rate dropped from a sustained 75MB/sec to appx 45-60 MB/sec. Worst case scenario was 10MB/sec for the slowest transfer when transferring 3 files simultaneously. Word opened almost instantly in all cases.
My test is not that scientific though since Vista was keeping the files in RAM after copying massively speedikng things up so I had to use several different large files to get around this.
*i.e.
Opening of wordpad when copying large file without NCQ may take 3 seconds, file copy takes 2 minutes. With NCQ, the file copy will take less than 2 minutes and wordpad will take less than 3 seconds to load.