Fun with EC2 Spot Instances

riemann

Newbie
Joined
Apr 14, 2012
Messages
18
Reaction score
9
Hey guys,


I just thought I would share with you some fun I recently had with spot instances, with some code that you can use if you want.




So our fav cloud srvc provider typically offers micro spot instances for $0.006/hr. The cheap rate is because it's unused capacity and therefore unguaranteed. So it's fine for a service that doesn't need to be 9's reliable, such as this story:


A friend wanted to win a "Voting" contest, and the only thing that protected it was uniquing IP addresses on the votes. So I summoned up a cluster of spot instances, ssh'd into them and curl'd the contest link (yes, you literally _just_ had to click the link... this type of systems architecture is common, as great programming ability is rare.). I used different User-Agents with my curl, combining Mac, Linux, and Windows OS's with Chrome, Firefox & Safari

/E3LAT6C8 on pastebin daught calm.

Enjoy




BTW, I I welcome lots of code critiques... A lot of this logic can be improved. This particular code also leveraged non-spot instances, so beware. YMMV and all that.




And, any nubs that want, ask me questions! I need to make my postcount 15 so I can PM about some of my purchases in the forums ;p stupid rule, but i mean, benefits the community... i hope.


Anyway, if you guys think this kind of thing is cool, post your other ideas in the thread!
 
Last edited:
How many votes where you able to generate (ip wise)?
 
Bro, still this is not clear to me as I think, could you explain me little bit more ?
happy to take all the time in the world, what do you understand about it?
 
They have around 1.2 million public IPs for the US instances now, with about half in the 23.20.0.0/14 and 107.20.0.0/14 ranges. They update the list in the dev forum every so often. Also I'm not sure if the full range is available to micro instances.

How many ec2 hours did they end up billing you for?
 
They have around 1.2 million public IPs for the US instances now, with about half in the 23.20.0.0/14 and 107.20.0.0/14 ranges. They update the list in the dev forum every so often. Also I'm not sure if the full range is available to micro instances.

How many ec2 hours did they end up billing you for?

My bill came out to around $200. But initially, I was using regular micro instances, not spot instances, so it was more expensive. I called them up to complain so it was actually free.
An improved version of my script would track the bill, client-side. And only use micro spots, basically being $0.006/unique ip.

There are other service providers, like digital ocean - they are releasing a new api this week - who operate at $0.007/hr and dont bill you for partial hours...
 
Alright, guess this post isn't as popular as I thought it would be, cheers!
 
Anyone have any ideas how I could repurpose the code base for SEO? :)
 
Alright, guess this post isn't as popular as I thought it would be, cheers!

I didn't know you could get 20.000 ips for 200$, this is awesome and it gives a lot of ideas.
 
That's a pretty awesome idea, I didn't know you could get them so easily. Thanks for sharing.
 
Back
Top