Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Joe L.'s "30% Read Performance Improvement Tweak" - Now with 'user shares'

Featured Replies

Hi all,

 

I have just been playing a bit around with the new unRAID 4.3-beta1 version and Joe L.'s post:

 

http://lime-technology.com/forum/index.php?topic=965.0

 

With the new version, this tweak also makes a huge difference on user shares:

 

root@NAS_Serup:/mnt# blockdev --getra /dev/md1
256

root@NAS_Serup:/mnt# dd if=/mnt/disk1/Faelles/Film/Shooter.iso of=/dev/null
8882292+0 records in
8882292+0 records out
4547733504 bytes (4.5 GB) copied, 189.354 s, 24.0 MB/s

root@NAS_Serup:/mnt# dd if=/mnt/user/Faelles/Film/Shooter.iso of=/dev/null
8882292+0 records in
8882292+0 records out
4547733504 bytes (4.5 GB) copied, 187.867 s, 24.2 MB/s

root@NAS_Serup:/mnt# blockdev --setra 2048 /dev/md1
root@NAS_Serup:/mnt# blockdev --getra /dev/md1
2048

root@NAS_Serup:/mnt# dd if=/mnt/disk1/Faelles/Film/Shooter.iso of=/dev/null
8882292+0 records in
8882292+0 records out
4547733504 bytes (4.5 GB) copied, 112.194 s, 40.5 MB/s

root@NAS_Serup:/mnt# dd if=/mnt/user/Faelles/Film/Shooter.iso of=/dev/null
8882292+0 records in
8882292+0 records out
4547733504 bytes (4.5 GB) copied, 110.392 s, 41.2 MB/s
root@NAS_Serup:/mnt#

 

Regards,

Søren

 

 

 

I did good then?  ;D ;D ;D

 

Joe L.

  • Author

I did good then?  ;D ;D ;D

 

Great  ;D  ;D

Guys you should comment your scripts (both for less linux-literate to know what is going on and to ID yourselves for recognition of your good work)...

 

 

  • 6 months later...

Hi,

 

I have Pro version of UnRaid.

Motherboard 915GM Speedster-FA4

Pentium M740

2GB RAM

now installed new SATA 3x500GB Hitachi P7K500 on internal ICH6 controller

(2xdata drive, 1xparity drive)

 

I try:

blockdev --setra 256 /dev/sda

 

dd if=....ISO of=/dev/null

 

result is 33.1 MB/s

 

after change

blockdev --setra 2048 /dev/sda

 

dd if=....ISO of=/dev/null

 

result is 33.6 MB/s

 

Where may be problem? After change block size is no effect for beter performance.

 

But with --setra 2048 parity check is run ~50-57MB/s (showed in web browser)

 

Any ideas?

 

Thanks for answer

 

Did you try:

 

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

Did you try:

 

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

 

Thanks for reply.

 

I am tested with this setting:

blockdev --setra 2048 /dev/sda

blockdev --setra 2048 /dev/sdb

blockdev --setra 2048 /dev/sdc

 

and check if is setting is set (if write correctly):

blockdev --getra /dev/sda

 

 

Your code have another effect?

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

"md1" is not "sda", "md2" is not "sdb", "md3" is not "sdc" ?

 

Thanks for answer

 

____________________________________

Sorry for type error. I write from mobile phone.

md(x) is software raid (or unRAID in this case).   They eventualy make it to sda, sdb, etc.

 

The code is Joe L.'s

md(x) is software raid (or unRAID in this case).  They eventualy make it to sda, sdb, etc.

 

The code is Joe L.'s

 

OK. I can try it - set blockdev to md1...

I am return to back and write if this is help me.

 

Very much Thanks

md(x) is software raid (or unRAID in this case).   They eventualy make it to sda, sdb, etc.

 

The code is Joe L.'s

 

I am add this code:

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

to "go" script on flash drive.

 

Reboot and I am test it again on 7,2GB file.  Now transfer rate is ~66-67 MB/s. Nice... ;D

 

Brainbone, very thanks!

Brainbone, very thanks!

 

You're welcome, but Joe L. deserves all the credit for this one.

 

Ok, just finished building my 1st server ever. Love Unraid, everything could have not gone easier.

 

As for this topic please understand I am a total newborn (lower than newbie) when it comes to Linux or programing. More of a hardware guy!

 

So what I am understanind is I need to open the go file that is located in the config folder. (notepad ok?)

then add these lines to the end of the script that is already there

 

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

Then save!

 

This is all that needs to be done?

Thank you,

Larry

 

PS I did read all the pages concerning this and think it just confused me more. Also how to view the code/script to check read write speeds?

 

 

correct

(notepad ok?)

 

No.  Wordpad would be better.  Notepad will remove the "unix" formatting of the file (LF) and replace it with the "windows" way (CRLF).

 

Also how to view the code/script to check read write speeds?

 

I prefer putty for telnetting into my unRAID box (or anything else).

 

 

(notepad ok?)

 

 

No.  Wordpad would be better.  Notepad will remove the "unix" formatting of the file (LF) and replace it with the "windows" way (CRLF).

 

That specific file just happens to be fed through  "fromdos" before being executed.  Therefore, unlike many other files, it really does not matter when editing the "go" file.

 

... Wordpad is better though.

 

Joe L.

That specific file just happens to be fed through  "fromdos" before being executed.

 

Good to know!

Here is my blockdev script.

Adjust BUFFER= below as you see fit.

 

The purpose of this is to wait for the array to come online

Then do the blockdev command.

 

Set DEV= to the highest /dev/md? device you want to wait for.

I set mine pretty high because this is called early in the go script.

It tends to pause other package installs until the array comes online.

 

 

root@Atlas /boot/custom/etc/rc.d>cat /boot/custom/etc/rc.d/S02-blockdev

#!/bin/bash

if [ ${DEBUG:=0} -gt 1 ]
   then set -x -v
fi

# Set to highest md device in your system. 

DEV=/dev/md3

while [[ ${LOOP:=10} -gt 1 && ! -b ${DEV} ]]
do
        (( LOOP=LOOP-1 ))
        echo "Waiting for ${DEV} to come online ($LOOP)"
        sleep 1
done

if [ ! -b ${DEV} ]
   then echo "Devices are not online, Array must be offline!"
        exit 129
fi

sleep 1

BUFFER=262144
BUFFER=4096
BUFFER=8192

echo "Devices Online"
for disk in /dev/md*
do  blockdev --setra ${BUFFER} $disk
done

Doesn't this part:

 

BUFFER=262144
BUFFER=4096
BUFFER=8192

 

Just come down to 8192, without using the other 2 values?

 

Doesn't this part:

 

BUFFER=262144
BUFFER=4096
BUFFER=8192

 

Just come down to 8192, without using the other 2 values?

 

 

Values which are above is for testing of script ?

Doesn't this part:

 

BUFFER=262144
BUFFER=4096
BUFFER=8192

 

Just come down to 8192, without using the other 2 values?

 

Yes, it appears those are some other values he experimented with.

Yes, on some machines the higher BUFFER= showed an improvement.

There were other threads I read which gave various numbers..

So I left them there to play with.

I use 8192 for now.

 

Remember my machine is 24x7 running at about 40% cpu with 60-80%WA..

It's a busy machine.

I might just have to move the torrents to a different ITX box with software raid 1 to help improve the I/O.

I read the other thread and there was little mention of SATA drives, except that the tweak doesn't have much effect. Unless I missed something. Is anyone using the tweak for SATA drive systems and how much benefit do you see?

Most of us use SATA drives and get the performance improvement.  I saw ~25%.

 

 

Bill

I saw a post somewhere asking why this hasn't been implemented in the UnRAID software. Anyone know the answer to that?

 

I saw a post somewhere asking why this hasn't been implemented in the UnRAID software. Anyone know the answer to that?

 

 

Now in 4.4-beta1.  It's set to 1024, but there are other changes that make this the optimal value (for 4.4).

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.