# Can I imitate a slow-moving hard drive?

I have suspicion that a particular intermittent bug could just materialize itself when there is a slow-moving disk read price. Troubleshooting is hard due to the fact that I can not accurately duplicate it.

Except merely swallowing IO with a high top priority procedure, exists any kind of means for me to imitate having a slow-moving hard drive?

0
2019-12-02 02:58:34
Source Share

Use nbd, the Network Block Device, and afterwards price restriction accessibility to it making use of claim trickle.

sudo apt-get install nbd-client nbd-server trickle

0
2019-12-03 05:46:54
Source

You can attempt running a duplicate of a huge documents, such as an iso of the Ubuntu install cd, and also run it two times. That need to reduce your drive down a fair bit.

0
2019-12-03 05:44:12
Source

Why not run iotop and also see if the procedure that you are attempting to debug is creating great deals of disk reads/writes?

0
2019-12-03 05:43:07
Source

Apart from attempting to reduce the hard drive itself, you can attempt making use of filesystem benchmarking devices such as bonnie++ which can create a large amount of disk I/O.

sudo apt-get install bonnie++

0
2019-12-03 05:42:53
Source

Have a USB 1.1 center? Or a slow-moving SD card? They'll get you to under 10mbps.

0
2019-12-03 04:43:34
Source
# echo 1 > /proc/sys/vm/drop_caches


That'll reduce you down

It'll compel you to read from disk, as opposed to capitalizing on the cached web page.

If you actually intended to get innovative you can do something like counterfeit a read mistake every nth time making use of the scsi mistake shot structure.

0
2019-12-03 02:19:34
Source

just how around make -j64? in write-ups defining that new 200line performance spot, make -j64 was a job consuming a great deal of computer system sources

0
2019-12-03 01:13:15
Source

This is by no suggests a full remedy, yet it might aid combined with various other actions : There is an I/O scheduler just like a procedure scheduler, and also it can be fine-tuned.

Most especially, you can in fact pick among various schedulers :

~# cat /sys/block/sda/queue/scheduler
~# cat /sys/block/sda/queue/scheduler

deadline might aid you get extra highly reproducible outcomes.
noop, as its name indicates, is hugely foolish, and also will certainly enable you to ravage outright chaos on I/O performance with little initiative.
anticipatory and also cfq both attempt to be clever concerning it, though cfq is usually the smarter of both. (As I remember, anticipatory is in fact the heritage scheduler from right prior to the bit began sustaining numerous schedulers.)