You are not logged in.

#1 2017-02-17 03:29:14

halgi
Member
Registered: 2016-05-19
Posts: 27

[SOLVED] HDD Access lag

So I have no idea how to approach this problem:

I currently have an SSD and an HDD. I keep my file system on my SSD and have my HDD mounted in ~/multimedia.
The problem happens when I first access my HDD it has around a 1-2 second delay and after that there is no lag. If I dont access the HDD for a while (couple mins) this process repeats.
For example, if im editing a document in ~/multimedia it will take an extended amount of time to save.

Any ideas why this is happening?

I took this HDD out of one of my laptops, here is the output of hdparm -I /dev/<hdd>

/dev/sdb:

ATA device, with non-removable media
	Model Number:       WDC WD10JPVX-22JC3T0                    
	Serial Number:      WD-WXQ1E93SWNZ2
	Firmware Revision:  01.01A01
	Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
	Supported: 9 8 7 6 5 
	Likely used: 9
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:    16514064
	LBA    user addressable sectors:   268435455
	LBA48  user addressable sectors:  1953525168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      953869 MBytes
	device size with M = 1000*1000:     1000204 MBytes (1000 GB)
	cache/buffer size  = 8192 KBytes
	Nominal Media Rotation Rate: 5400
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, with device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Advanced power management level: 96
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	   *	Advanced Power Management feature set
	    	Power-Up In Standby feature set
	   *	SET_FEATURES required to spinup after power up
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	64-bit World wide name
	   *	IDLE_IMMEDIATE with UNLOAD
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Gen3 signaling speed (6.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	   *	NCQ priority information
	   *	Host automatic Partial to Slumber transitions
	   *	Device automatic Partial to Slumber transitions
	   *	READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
	   *	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Write Same (AC2)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
	    	unknown 206[12] (vendor specific)
	    	unknown 206[13] (vendor specific)
	    	unknown 206[14] (vendor specific)
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
		frozen
	not	expired: security count
		supported: enhanced erase
	196min for SECURITY ERASE UNIT. 196min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50014ee6041de960
	NAA		: 5
	IEEE OUI	: 0014ee
	Unique ID	: 6041de960
Checksum: correct

Last edited by halgi (2017-02-18 22:41:53)

Offline

#2 2017-02-17 04:38:21

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [SOLVED] HDD Access lag

Hi there halgi

To me this sounds like a power saving feature. The HDD spins down when inactive. Since it's only mounted as ~/multimedia it only gets reads and writes when you are using it. I'm just a newbie my self so I am not sure on how to go around and solve this. But a quick search through the wiki points me in the direction of hdparm.


Be aware of my Newbie Powers

Offline

#3 2017-02-17 16:13:26

halgi
Member
Registered: 2016-05-19
Posts: 27

Re: [SOLVED] HDD Access lag

Hmm, I suspected it would be a power feature, I'll look into hdparm tonight thanks

Offline

#4 2017-02-18 22:41:36

halgi
Member
Registered: 2016-05-19
Posts: 27

Re: [SOLVED] HDD Access lag

Using hdparm I was able to fix this by adding the following to /etc/udev/rules.d/50-hdparm.rules:

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 255 -S 0 /dev/<hdd>"

Offline

Board footer

Powered by FluxBB