Re: fdisk units size & disk manufacturers buying the standard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phillip Susi wrote:
Umm... yea.. you said bytes are not SI, I'm saying watt-hours aren't
either.  You said that means the kilo prefix should be base 2 since a
byte is 2^3 bits.  I'm saying by the same silly logic, a
killowatt-hour should be 3600 watt-hours since a watt-hour is 60^2
joules.  Are you getting it now?
====
   I was hoping you'd ask that.
   The 'kilo' applies to the 'watt', not the hour.  If you had
1000 kWHr, you wouldn't see normal usage calling it 1 MWHr.  It's ok
to use Metric prefixes with metric units. Multiplying a metric
quantity by a non-metric value doesn't change that -- but you
won't see power plants rated that way, nor will you see
that on your power bill.

   You will see articles talking about hard disk technologies speaking
of density in 'bits'/area (where either bit OR area can have an SI
quantity), since a bit requires no conversion constant to go from
flux-changes/area. HD-densities (in the US) are expressed in
<metric-prefix>-bits/in².  Again, with the metric prefix applying to
the unit that requires no conversion constant (the bit) to be expressed
as some combination of SI units.

   This is a great point here -- concerning the HD industry.
If they were so concerned about using the metric system, why wouldn't
they specify density in <prfx>-bits/cm².  Snort.


See kernel messages for a 10b-T ethernet.

[ 21.224641] ixgbe 0000:05:00.0: PCI Express bandwidth of 32GT/s available [ 21.224644] ixgbe 0000:05:00.0: (Speed:5.0GT/s, Width:
x8, Encoding Loss:20%)

That message is referring to the encoding loss on the pci express gen
2 bus, not ethernet.
---
   Thank you.  I didn't know that.  Now I know I need a HW upgrade... ;-)


excludes optional protocols.  The 125MB/s is a max theoretical rate
and is in base 2.

No, as I said, that is base 10, not base 2.  1,000,000,000 bps / 8
bits per byte = 125,000,000 bytes / second, not 131,072,000 bytes.
---
   My bad... you're right.  I *thought* it was the other way
around at one point, but later realized that the output of 'dd'
was in decimal prefixes (regardless of user input).  My test
script even tries to convert units back to base2... ;-)
In practice, 125 millionBytes for writes and 119 millionBytes are
a benchmark maximum that includes headers (SMB/CIFS for the test I
most frequently run).

Nope, not possible.
===
   Maybe not, but it is repeatable by myself and other people.
Do you have samba and a 1Gb connection?  It's fairly easy to setup.
I'll even attach the primitive test script (bash) -- easy to use
once you get the files setup in a server-dir.
I'm on an internal network (so no encryption on the link).  Client
is Win7SP1, linux flavor = opensuse, but kernel is vanilla,
currently at 3.17.3. Measuring line speeds only, I use the following files in my home
directory on the server:

 cd
 ll zero null
crwxrw-rw- 1 1, 3 Jan  9 13:55 null
crwxrw-rw- 1 1, 5 May  7  2013 zero
---
Using cygwin 'dd', for client writes I read from /dev/zero and write
to 'null' oflag=direct conv=notrunc,nocreat, BS=16M, total size=4GB
for client reads: if=zero of=/dev/null.

Note -- if you make them regular files, at least defrag them.
Using 'xfs', you can use "xfs_fsr" to make a file contiguous.

Other people on the samba list report similar results, though
it is definitely a minority who have tuned their systems for that.
Besides what I can do on windows, I have also used a fair number
of large or insane parameters on the linux networking stack.

Maybe it's your hardware?  For my fastest results, I've been using
Intel dual-port cards:

Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
Intel Corporation Ethernet Controller 10 Gigabit X540-AT2 (rev 01)

Identical cards on server and client -- though my client only uses the
10Gb card now...(300-650MB/s transfer tops... varies widely).

I also use 9kB (9000) byte packets and whatever offload features I
find yield a positive effect.  You aren't going to get those speeds
out of the box... it does take a bit of performance tuning.

I.e. 125millionBytes/s -- the base10 number IS a benchmark maximum that includes protocol headers (specifically for SMB).

Nope.
---
I've seen it multiple times -- others have reproduced it.
Vs. the max ranges for 10Gb (8Gb on my setup), have been in the
600's (usually lower) (smb protocol is cpu bound and usually w/1 user
connection -- though newer smb (win8+) seems to have some beginnings
for support for using parallelism in the processors.
But their core unit 'bit' like the 'second', is based on a minimal
distinct magnetic flux variation on the media.  It is directly
usable with SI prefixes.

No, it isn't.
Reality disagrees: See:

  http://en.wikipedia.org/wiki/Bit_cell
  http://www.softpres.org/?id=glossary:bit_cell

 Specifically: (quote)

This is essentially the distance along the track allocated for the recording of an area of Flux. That is, in each “cell” there are magnetic particles that together indicate a detectable magnetic polarity of set length. Note that bit cells are not read as bits of data directly, they are used to form the flux transitions used to make up the Encoding. Every bit cell contains either a change of polarity (1) or not (0).

--endquote--

Perhaps you have some references that would convince me that the
above terminology isn't both common and standard in this field?


Only when you get into marketing speak (getting away from tech speak),
will you see things like $$$/[MGT]B, where the prefix applies
to 'Byte'.  But again, that's marketing speak.

Disk manufacturers describe and talk about "bits"/area when describing
disk technologies.


You can't get the correct number of bytes transfered over 1 300bps
modem by dividing by 8.

Umm, yes, that is exactly what you do.  It kind of follows from the
definition of bits and bytes.  Of course, there weren't 1,300 bps
modems, but still.
---
   That's "one" 300bps modem.  And no, you don't divide by 8
since 300bps modems only had a 30cps throughput -- not 37.5 as you
would seem to indicate.



#!/bin/bash -u
# iotest v0.1 - lawalsh: open usage allowed

_prgpth="${0:?}"; _prg="${_prgpth##*/}"; _prgdr="${_prgpth%/$_prg}"
[[ -z $_prgdr || $_prg == $_prgdr ]] && $_prgdr="$PWD"
export PATH="$_prgdr:$_prgdr/lib:$PATH"
shopt -s expand_aliases extglob sourcepath ; set -o pipefail

#include stdalias

Dd=$(type -P dd)

[[ $Dd ]] || { echo "Cannot find dd.  Cannot proceed.";  exit 1; }

alias intConst=declare\ -ix int=declare\ -i my=declare
alias string=declare sub=function array=declare\ -a
# 1 num = block size
# num-num = range of block sizes to test; w/increment = "2x", so
# 4M-16M tests 4M, 8M, 16M
# 4M-12M test 4M, 8M, 12M
# count adjusted to xfer 4G, rounding up
#----

#all xfers are using 'devices' (/dev/zero for source, /dev/null for target)
# remote filenames "zero" and "null" should be setup to be remote devices

intConst K=1024
intConst M=$[K*K]
intConst G=$[M*K]
intConst T=$[G*K]

int BS=$[16*M]
int count=256
int IOSIZE=${IOSIZE:-4*G}

#		desuffix 	1st arg = num+suffix -> convert to int
#							2nd arg = optional buff name (else print to stdout)
#							return 0 if no error

sub desuffix {						#convert num+Suff => int store in optional Buff
	string str="${1:?}" ; shift
	string bufnam=""; (($#)) && bufnam=$1
	if [[ $p =~ ^([0-9]+)([KMGT])$ ]]; then 
		int num=${BASH_REMATCH[1]}*${BASH_REMATCH[2]}
		((num)) || return 1
		if [[ $bufnam ]] ; then printf -v $bufnam "%d" "$num"
		else printf "%d" "$num" ; fi
	else 
		return 1
	fi
}




sub hdisp {
	int num=${1:?}; shift
	string bufnam=""; (($#)) && bufnam=$1
	string suf=""
	int ans=num
	array pows=('K' 'M' 'G' 'T')
	for s in ${pows[@]};do
		int si=$s
		if (((num/si)*si==num)); then
			ans=num/si;suf="$s"
		fi
	done
}

sub check_params {
	int num=0
	if (($#)) ; then 
		string p="$1"; shift;
		if [[ $p =~ ([0-9]+)([KMGT]) ]]; then 
			num=${BASH_REMATCH[1]}*${BASH_REMATCH[2]}
		fi
	fi
	((num)) && {
		BS=num
		count=IOSIZE/BS
	}
}

(($#)) && check_params "$@"

array reada=(/h/zero /dev/null)
array writea=(/dev/zero /h/null conv=nocreat,notrunc)

sub dd_need_io  {
	local if="$1" of="$2"; shift 2
	nice --19 $Dd if="$if" of="$of" bs="$BS" count="$count"\
	 		oflag=direct iflag=direct conv=nocreat "$@"
}

sub dd {
	local if="$1" of="$2" ;shift 2
	#echo $dd if="$if" of="$of" bs="$BS" count="$count" "$@" >&2
	array out err
	readarray err < <( \
		readarray out < <(dd_need_io "$if" "$of" "$@";int s=$?; 
											((s)) && echo "stat:$s">&2  ) 2>&1 )
	#
	if ((${#err[@]})) ;then echo "${err[@]}"; exit 1; fi
	return 0
}
	
function dd_format { my ln
	while read ln;do
		echo $ln | while read bytes btxt pnum suffp \
											copt time unitc rate ra_unit; do
			[[ $bytes == records ]] && continue
			[[ ${pnum:0:1} != \( || ${suffp:0-1:1} != \) ]] && continue
			num="${pnum:1}" 
			suff="${suffp%?}" 
			unit="${unitc%?}"
			printf "%s:%s:%s:%s:%s:%s:\n"	"$num" "$suff" "$time" "$unit" "$rate" "$ra_unit"
		done
	done
}

sub onecycle {
	echo -n "R:"; { dd "${reada[@]}"|| exit $?; } | dd_format 
	echo -n "W:";	{ dd "${writea[@]}" || exit $?; } | dd_format 
}

onecycle

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux