Wednesday, March 27, 2013

parlor games: sizing AWS with "terrible math (tm)"

People have been playing this parlor game for years I wanted to follow up on my last post about potentially 3.7 million hosts to play a game to see how many there actually are. I borrowed from the great work over at, many thanks to @powdahound for a quick flash of inspiration.

Caveat: this has absolutely *nothing* to do with my day job, it is all based on purely fictitious (and dubious) math.  The only parts here that are even slightly correct were lifted from random public sources.  Everything below is a pure construct for fun and pleasure only, do not use these numbers to advise your stock broker, set career goals, or make any decision about anything what so ever!

Enjoy :-)

NameDRAM (GB)STORAGE (GB)BITSAPI NAME/hour (linux)/hour (windows)
M1 Small1.716032/64-bitm1.small$0.06$0.12
M1 Medium3.7541032/64-bitm1.medium$0.12$0.23
High-CPU Medium1.735032/64-bitc1.medium$0.14$0.28
M1 Large7.585064-bitm1.large$0.24$0.46
High-Memory Extra Large17.142064-bitm2.xlarge$0.41$0.57
M1 Extra Large15169064-bitm1.xlarge$0.48$0.92
M3 Extra Large15064-bitm3.xlarge$0.50$0.98
High-CPU Extra Large7169064-bitc1.xlarge$0.58$1.14
High-Memory Double Extra Large34.285064-bitm2.2xlarge$0.82$1.14
M3 Double Extra Large30064-bitm3.2xlarge$1.00$1.96
Cluster Compute Quadruple Extra Large23169064-bitcc1.4xlarge$1.30$1.61
High-Memory Quadruple Extra Large68.4169064-bitm2.4xlarge$1.64$2.28
Cluster GPU Quadruple Extra Large22169064-bitcg1.4xlarge$2.10$2.60
Cluster Compute Eight Extra Large60.5337064-bitcc2.8xlarge$2.40$2.97
High I/O Quadruple Extra Large60.5204864-bithi1.4xlarge$3.10$3.58
High Memory Cluster Eight Extra Large24424064-bitcr1.8xlarge$3.50$3.83
High Storage Eight Extra Large117480064-biths1.8xlarge$4.60$4.93

Makes for a nice picture, M3 double extra has a bit of what I've decided to call a "redmond bump", but you can see the server/complexity price performance model pretty well here. Although I do prefer me some straight lines for financial models... heh

So if we take the following averages over all instances, with application of "bad math", but not yet patent pending "terrible math (tm)", we are working up to a new level of "awesome sums" shortly, pay attention that bit comes next and is loaded with "awesome" ;-):

                        Linux   Windows
Ave. inst. cost         $1.28   $1.65
Median inst. cost       $0.70   $1.14

And think daft thoughts, assuming a 1:1 mapping of all public space based on a total number of hosts based of 3,702,664 from my previous epic one liner... also assuming a 1:1 mapping of all private to public hosts, ignore S3, and generally assume even more than we are stating we are assuming :-)

                                     /hour             /year
Average Linux                   $4,733,239   $41,490,672,122
Average Windows                 $6,092,939   $53,409,548,382

Median Linux                    $2,591,865   $22,719,794,382
Median Windows                  $4,221,037   $37,000,807,994
Warning! fake math, average 
of averages, of averages...     $4,409,770   $38,655,205,720

So in theory, EC2 alone could represent between $22B and $53B a year!  Or $4MM/hour!

Random unconfirmed reports from the internet show AWS as $2B/yr, so factor this against a potential $38B... @ 3,700,000 maximum potential servers (from IP space).... gives (drum roll please!), oh and if you are playing along at home, this is the bit when the math goes from bad to "extremely suspect" and onwards to patent pending "terrible math (tm)"!

so, with logical consequence, # servers in AWS  


he he he, ho, ho ho!

I'm guessing that we should all just quit guessing! Although it is super fun!

The real facts are that no matter how you look at the numbers for public cloud (and in particular AWS), they are all enormous, staggering and vast. Even more so when you look at the sheer range of capability on offer, it is just fascinating. The only numbers in this game that continue to be small (and the only ones you really need to care about!) are the $/instance/hour.

And yet, these numbers continue to become ever, ever smaller each and every day. Plus [even with "terrible math(tm)"] there are clearly a lot of servers out there. Basically, this is awesome great news for everyone needing to run science and computation at scale and for short $. That's the really cool part of this parlor game!

And that, oh yes - that is the bit that I do use in the day job :-)

p.s. comments about issues with "terrible math (tm)" will be met with mild amusement

Monday, March 25, 2013

how big is the public cloud?

Fun question came up today about cloud resources and IP adresses. Totally randomly, I also spotted a tweet by my pal Pax, and decided to put two and two together to come up with new values of four!

So I decided to get a little crazy!

jcuff@jcuff-virtualbox:~/netaddr$ wget -qO - | grep -Eoh "[0-9.]+{4}/[0-9]+" | xargs -I % ./ % | awk '{print sum=sum+$2}' | tail -1


So enough for over 3.7 million public hosts all thanks to netaddr and a pointer from my pal Pax. Oh, here's the code, remember there are always 2 less hosts per "ip.size" so chopped off two...

jcuff@jcuff-virtualbox:~/netaddr$ cat
import sys
from netaddr import *
import pprint
ip = IPNetwork(sys.argv[1])
print sys.argv[1], ip.size-2

And the raw output:

jcuff@jcuff-virtualbox:~/netaddr$ wget -qO - | grep -Eoh "[0-9.]+{4}/[0-9]+" | xargs -I % ./ % 8190 16382 32766 65534 16382 65534 32766 16382 131070 65534 262142 262142 131070 131070 131070 131070 131070 131070 131070 65534 65534 65534 65534 16382 16382 65534 32766 65534 65534 32766 16382 4094 32766 16382 32766 16382 65534 65534 65534 131070 65534 16382 16382 16382 2046 65534 65534 65534 65534 65534 16382 8190 8190 2046 16382 131070 65534 32766 65534 16382

I make no apologies for the abuse of xargs and python in the making of this movie!

Update: this has been done before, but never with such epic one liners ref: :-)

Saturday, March 9, 2013

of the pulling of plugs and dead fios connections...

Oh no!  The internet is down!!!

So we have had FiOS for about five years now. It's been great until today. We have a business line, pay good money for it, and it has worked mostly fine, and I've never had to call support until today. More of that later on...

First sign, the TiVo was not connecting... rotroh! How are we going to survive!  I thought nothing much of it, there were after all multiple recorded episodes of Bearing Sea Gold to be watched! :-)

I did eventually surface, and do the regular reboot house routine - power off wifi, pull the little green glass fiber optic. Doh! Still nothing much going on there, still dead, they are probably working on something, no biggy. Went shopping and decided to generally get on with my life.

Came back from the shopping mission and started to look at why things were busted. Very odd, the wifi/wan box actually had an IP address, but things were very still much fail, IPs could resolve, but traffic was like molasses or non existent.  This *has* to be an upstream problem I thought to myself...

Decided to call Verizon - in retrospect that was my first big mistake.

An hour plus of back and forth and many powering off and on of "the router" resulted in nothing more than the technician managing to release my DHCP address. I knew I had IP connectivity, that was not the issue, the network was clearly broken...

I'm not a CCIE, but I know that this response from a ping ain't right! Me trying to explain this to the technician was probably worth hearing, and could make for a good comedy sketch at some point, but I digress... :-)

jcuff-air:~ jcuff$ ping
PING ( 56 data bytes
Request timeout for icmp_seq 0
64 bytes from icmp_seq=1 ttl=250 time=120.565 ms
64 bytes from icmp_seq=1 ttl=250 time=122.475 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.661 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.671 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.677 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.684 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.693 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.699 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=122.705 ms (DUP!)


64 bytes from icmp_seq=1 ttl=250 time=133.318 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=133.322 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=133.326 ms (DUP!)
64 bytes from icmp_seq=1 ttl=250 time=133.422 ms (DUP!)
Request timeout for icmp_seq 2
--- ping statistics ---
4 packets transmitted, 1 packets received, +73 duplicates, 75.0% packet loss
round-trip min/avg/max/stddev = 120.565/128.757/133.422/3.811 ms

Ok, so clearly this is wrong.  What really got me (as I was clearly reaching the end of my tether) at the end of a very long phone call to Verizon, having been passed through five departments, each separately asking me for my details, then each also could not find them!  That part alone was particularly awesome, I just do so love repeating myself!

Then finally the awesome service desk tells me...

"Apple" products are not supported!

I hung up.

A nice cup of tea and a sit down later, I decided to take matters into my own hands....

First up... this bad boy:

I'm clearly throwing all caution to the wind here, I'm not qualified... never have been. "Telco Use Only Do Not Remove"... well it is in my house, so I'm pulling the plug.

Next up, I pull the wire on the battery, the machine is beeping quite a lot now because of the removed "Telco Use Only" plug!  I picked the red wire you can see here, hoping it will stop the beeping!

Gave it a tug, and all the lights went out.  I also pulled the fiber optic just incase for added awesomeness.  I'm not qualified, but I've been known to know a little bit about how computers and networks "work".  Then I went off to finish my tea... and left this thing to understand the jolly good lesson I'd just taught it!

As I drink my tea, I'm thinking about how to make double sure that this is going to work.  So I plugged a laptop right into the network jack on the terminal adapter, (by passing any possibly crappyness in the home network, I did wire it after all!) quickly cloned the MAC address from the airport express... I'm not going back to call them again to release the MAC!  ifconfig to the rescue!

jcuff-air:~ jcuff$ ifconfig en0 ether aa:ff:ee:ff:ee:aa

Ok - now time to put the battery back in, reconnect the glass fiber connection (green), plug back in the "naughty boy - do not remove!" plug back into the wall...

Oh look, see what on earth do we have here?  Oh yes, a fully functioning internet!

jcuff-air:~ jcuff$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=250 time=35.918 ms
64 bytes from icmp_seq=1 ttl=250 time=40.758 ms
64 bytes from icmp_seq=2 ttl=250 time=39.774 ms
--- ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 35.918/38.817/40.758/2.089 ms
jcuff-air:~ jcuff$ 

Disconnected the laptop, plugged the Airport Express back in - all better!

Something in that terminal adapter (Verizon's equipment) clearly got messed up, not that Verizon could tell me.  They were much more concerned that I had an unsupported "router", when in fact it was their equipment that was funky.

Hope this helps any other wayward souls on the internet.

Pull plugs first, ask questions later :-)

(c) 2018 James Cuff