NFS Speedscript?

    • NFS Speedscript?

      Hallo,

      ich habe im ihad Forum folgendes script gefunden, welches auch auf der DM funktionieren soll.
      NFS Speedscript

      NFS Speedscript:

      Shell-Script

      1. #!/bin/sh
      2. # IP of your NFS server
      3. serverip=192.168.69.70
      4. # exported directory on your NFS server
      5. exportdir=filme
      6. # mount point on dbox
      7. dboxmountpoint="/var/mnt/nfs"
      8. # filesize to transfer in MBytes.
      9. # At least 8 MByte. Good values are 32 or 64 MByte.
      10. # Try 128 to be more accurate (takes much longer!)
      11. filesize=64
      12. # block sizes to test in KBytes, possible values are 1 2 4 8 16 32.
      13. # values have to be separated with spaces. See examples below.
      14. # blocksizelist="4 8 32"
      15. # blocksizelist="16"
      16. blocksizelist="4 8 16 32"
      17. # wether to enable synchronous reading, writing. Possible values are "yes"
      18. # or no. Normally synchronous reading or writing should be slower than
      19. # asynchronous, so to save some time most people would say "no" here.
      20. enablesynctests="no"
      21. ##################################################################
      22. ######## don't edit below this line ########
      23. ##################################################################
      24. bs=8192
      25. count=`expr $filesize \* 1048576 / $bs`
      26. wlist=""
      27. rlist=""
      28. synctests="async"
      29. if [ $enablesynctests = "yes" ]; then
      30. synctests="sync "$synctests
      31. fi
      32. echo
      33. echo "Measuring NFS throughput..."
      34. for factor in $blocksizelist
      35. do
      36. for protocol in udp tcp
      37. do
      38. for synchronized in $synctests
      39. do
      40. size=`expr $factor \* 1024`
      41. bitcount=`expr $bs \* $count \* 8`
      42. umount $dboxmountpoint 2>/dev/null
      43. mount -t nfs -o rw,soft,$protocol,nolock,$synchronized,rsize=$size,wsize=$size $serverip:$exportdir $dboxmountpoint
      44. echo "Mount options: "$protocol", "$synchronized", wsize="$size
      45. echo "writing "$filesize" MBytes..."
      46. a=`date +%s`
      47. dd if=/dev/zero of=$dboxmountpoint/test bs=$bs count=$count 2>/dev/null;
      48. if [ $? = "0" ]
      49. then
      50. z=`date +%s`
      51. duration=`expr $z - $a`
      52. throughput=`expr $bitcount / $duration`
      53. echo "Success after "$duration" seconds"
      54. else
      55. throughput="Failure"
      56. echo "Failure"
      57. fi
      58. wlist=$wlist$throughput" with "$protocol","$synchronized",wsize="$size"\n"
      59. echo "Mount options: "$protocol", "$synchronized", rsize="$size
      60. echo "reading "$filesize" MBytes..."
      61. a=`date +%s`
      62. dd of=/dev/null if=$dboxmountpoint/test bs=$bs count=$count 2>/dev/null;
      63. if [ $? = "0" ]
      64. then
      65. z=`date +%s`
      66. duration=`expr $z - $a`
      67. throughput=`expr $bitcount / $duration`
      68. echo "Success after "$duration" seconds"
      69. else
      70. throughput="Failure"
      71. echo "Failure"
      72. fi
      73. rlist=$rlist$throughput" with "$protocol","$synchronized",rsize="$size"\n"
      74. echo
      75. done
      76. done
      77. done
      78. echo "Results for write throughput:"
      79. echo -e $wlist | sort -nr | sed 's/^\([0-9]*\)\([0-9]\{3\}\)\([0-9]\{3\}\(.*\)\)/\1.\2 Mbit\/s\4/g'
      80. echo "Results for read throughput:"
      81. echo -e $rlist | sort -nr | sed 's/^\([0-9]*\)\([0-9]\{3\}\)\([0-9]\{3\}\(.*\)\)/\1.\2 Mbit\/s\4/g'
      Alles anzeigen

      Mein NAS ist über das Mountplugin einbezogen, aber wenn ich das mit der folgenden Config auf meiner DM aufrufe ...

      Shell-Script

      1. #!/bin/sh
      2. # IP of your NFS server
      3. serverip=192.168.178.88
      4. # exported directory on your NFS server
      5. exportdir=/dreambox
      6. # mount point on dbox
      7. dboxmountpoint="/hdd/NAS"
      8. # filesize to transfer in MBytes.
      9. # At least 8 MByte. Good values are 32 or 64 MByte.
      10. # Try 128 to be more accurate (takes much longer!)
      11. filesize=64
      12. # block sizes to test in KBytes, possible values are 1 2 4 8 16 32.
      13. # values have to be separated with spaces. See examples below.
      14. # blocksizelist="4 8 32"
      15. # blocksizelist="16"
      16. blocksizelist="4 8 16 32"
      17. # wether to enable synchronous reading, writing. Possible values are "yes"
      18. # or no. Normally synchronous reading or writing should be slower than
      19. # asynchronous, so to save some time most people would say "no" here.
      20. enablesynctests="no"
      Alles anzeigen
      ... bekomme ich folgende Fehlermeldung:

      Quellcode

      1. : not found1:
      2. : not found2:
      3. : not found6:
      4. expr: non-numeric argument
      5. ./nfs.sh: 39: Syntax error: word unexpected (expecting "do")

      Kennt jemand eine Lösung?
      Ich fnd das script interessant, weil bei den Testern mit höheren wsize- und rsize-Werten als 8192 eine bessere Performance erzielt wurde und man mit idealen Einstellungen noch ein paar Prozent Bandbreite rauskitzeln kann, welches ja für HD-Aufnahemn auf den NAS hilfreich sein könnte.

      Gruß
      cruiser

      DM900UHD DVB-C/T2 Newnigma2 OE 2.5 Daily