{"id":1683,"date":"2015-02-02T20:00:48","date_gmt":"2015-02-03T02:00:48","guid":{"rendered":"https:\/\/justinparrtech.com\/JustinParr-Tech\/?p=1683"},"modified":"2015-02-02T20:05:56","modified_gmt":"2015-02-03T02:05:56","slug":"simple-throughput-formula","status":"publish","type":"post","link":"https:\/\/justinparrtech.com\/JustinParr-Tech\/simple-throughput-formula\/","title":{"rendered":"Simple Throughput Formula"},"content":{"rendered":"<h2>Simple Throughput Formula<\/h2>\n<p>&nbsp;<\/p>\n<p>To calculate throughput in megabits per second (Mbps), divide 8192 by the time it takes to copy a 1 gigabyte file (2^30 bytes, or 1,073,741,824).<\/p>\n<p><strong>v = 8,192 \/ t<\/strong><\/p>\n<p style=\"padding-left: 30px;\">v &#8211; Throughput in Mbps<\/p>\n<p style=\"padding-left: 30px;\">t &#8211; Time in seconds, that it takes to copy a 1 gigabyte file<\/p>\n<p>This simple throughput test allows you to quickly check actual throughput for storage or network connections, and can be a valuable troubleshooting tool.<\/p>\n<p>&nbsp;<\/p>\n<h3>Example:<\/h3>\n<p>A 1 gig file takes 300 seconds to copy.<\/p>\n<p>8,192 \/ 300 = 27.3 Mbps (Megabits per second)<\/p>\n<p>&nbsp;<\/p>\n<h3>How does this work?<\/h3>\n<p>Throughput is the number of bits transferred, in a specified amount of time (in seconds).<\/p>\n<p>File size is measured in bytes, while throughput is measured in bits per second.\u00a0 As there are 8 bits in a byte, the first step is to multiply the file size by 8, to get the total number of bits.<\/p>\n<p>If we have a 1 gig file, that&#8217;s 1,073,741,824 bytes, or\u00a08,589,934,592 total bits to transfer.<\/p>\n<p>If we divide at this point, we will get a really large number, representing &#8220;bits per second&#8221; (bps).<\/p>\n<p>When dealing with network or internet throughput rates, we typically use a much larger scale, such as megabits per second.\u00a0 A kilobit is 1024 bits, and a megabit is 1024 kilobits (or 1024 * 1024 bits).\u00a0 To go from bits to megabits, we divide by 1024 * 1024 ( 1,048,576 ).<\/p>\n<p>So for a given file size <em>f<\/em>, taking time\u00a0<em>t<\/em> in seconds to copy, the throughput v is as follows:<\/p>\n<p style=\"padding-left: 30px;\">v = ( f * 8 \/ ( 1024 * 1024 ) ) \/ t)<\/p>\n<p style=\"padding-left: 30px;\"><strong>v = ( f * 8 ) \/ ( 1024^2 * t )<\/strong><\/p>\n<p>With a file size of 1 gigabyte (1024 * 1024 * 1024 bytes), the equation looks like this:<\/p>\n<p style=\"padding-left: 30px;\">v = ( 1024^3 * 8 ) \/ ( 1024^2 * t )<\/p>\n<p>Since 1024^3 \/ 1024^2 = 1024, the above can be simplified to:<\/p>\n<p style=\"padding-left: 30px;\">v = ( 1024 * 8 ) \/ t<\/p>\n<p style=\"padding-left: 30px;\"><strong>v = 8,192 \/ t<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h3>Variations<\/h3>\n<p>To specify throughput in Gbps (Gigabits per second), simply divide 8 by the time in seconds.\u00a0 Since you would be dividing 8192 by 1024 to go from megabits to gigabits, the answer, 8 represents the original 1 gig (abyte) file converted to bits, which is simply 1 (the file size) times 8 (the number of bits in a byte).<\/p>\n<p>v (Gbps) = 8 \/ t<\/p>\n<p>The problem is that, as the time taken to copy the file approaches 1 second or less, you lose precision.<\/p>\n<p>Let&#8217;s say your 1 gig file takes 0.9 seconds.\u00a0 The throughput is 8 \/ 0.9 = 8.9 Gbps.\u00a0 The problem is that measuring 9\/10 of one second, which is 900 milliseconds, takes a sensitive and precise timer.<\/p>\n<p>One way around this is to scale everything up &#8211; for example, using a 10 gig file means we simply multiply the number of gigabits by 10:<\/p>\n<p>v (Gbps) = 80 \/ t<\/p>\n<p>Now, our 10 gig file might take 9 seconds, a quantity of time we can easily count using a stopwatch, but yields the same result:\u00a0 80 \/ 9 = 8.9 Gbps.<\/p>\n<p>As storage and networking become faster, larger file sizes are required, to make an accurate measurement.<\/p>\n<p>&nbsp;<\/p>\n<h3>How Do I Create a 1 Gig File?<\/h3>\n<p>In Windows, use these commands at a command prompt:<\/p>\n<pre>echo ABCDEF&gt;test.txt\r\nfor \/L %i in (1,1,27) do type test.txt &gt;&gt; test.txt<\/pre>\n<p>The first line creates an 8 byte file.\u00a0 6 bytes are in the string &#8220;ABCDEF&#8221;, followed by a Carriage Return and Line Feed, that you don&#8217;t see, are also stored in the file.<\/p>\n<p>The second line counts from 1 to 27, and adds the file to the bottom of itself, doubling the file each time.<\/p>\n<p>Since the original file is 2^3 bytes, if we double it, the resulting file is 2^4 bytes.\u00a0 If we double it 27 times, the file size is 2^(3 + 27), or 2^30, which is exactly 1 gig.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple Throughput Formula &nbsp; To calculate throughput in megabits per second (Mbps), divide 8192 by the time it takes to copy a 1 gigabyte file (2^30 bytes, or 1,073,741,824). v = 8,192 \/ t v &#8211; Throughput in Mbps t &#8211; Time in seconds, that it takes to copy a 1 gigabyte file This simple [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1683","post","type-post","status-publish","format-aside","hentry","category-quick-facts","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/posts\/1683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/comments?post=1683"}],"version-history":[{"count":4,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/posts\/1683\/revisions"}],"predecessor-version":[{"id":1687,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/posts\/1683\/revisions\/1687"}],"wp:attachment":[{"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/media?parent=1683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/categories?post=1683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justinparrtech.com\/JustinParr-Tech\/wp-json\/wp\/v2\/tags?post=1683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}