We frequently get asked what makes our AWS cost optimization so good. AWS cost management feels like it should be easy, and we talk to a lot of folks who think they’ve done a good job of it. The fact is, we’ve yet to see anyone who’s not wasting at least 40% of their EC2 bill. Let’s walk through it on our platform, and it’ll make sense why.
Fitting an Instance
It all starts with knowing what you’re actually using, resource-wise. Figuring this out as a human is surprisingly hard. For Sunshower, we look at the past month of a virtual machine’s life (if we have it — that’s our default) and sample every minute (by default, but it’s adjustable). After smoothing the data, that’s how we discover, in this case, 1 CPU (of the 8 they’re paying for) and 10G RAM (of the 30 they’re paying for) are actually being used.
In the screenshots below, you can see the resulting “shape” of the workload on the virtual machine. First, on the left: current vs utilized. The grey is what they’re currently paying for, and the purple is what they’re utilizing. Frankly, it LOOKS like a pretty good fit.
To compare, let’s look at the screenshot on the right: optimized vs utilized. There’s our purple triangle of utilization again. This time, you’ll see the optimized fit we found in blue. Even though the blue section looks a lot bigger, it actually reflects a substantial cost savings over the original, grey fit on the left.
How is that possible? The thing you’re really paying for, in most machines, is CPU and Memory. So, the closer a fit you can get on those, the better. In the image on the left, you can see that the majority of the overprovisioning is taking place in the most expensive areas of cloud spend: CPU and memory. Tightening that fit up in CPU and memory, like you see represented in blue in the image on the right, might look like an incremental change from the image on the left, but in reality it adds up.
Whether it’s choosing the wrong instance size, not fully understanding cloud pricing options, leaving unused resources running, or locking yourself into inflexible reserved instance contracts, there are lots of ways to end up with a cloud bill that wreaks havoc on your financials.
What can you do to keep cloud costs down and reduce your part of the $14.1 billion that will be wasted on cloud compute resources in 2019? You can avoid cloud waste by adopting smart cloud cost optimization strategies. Here are a few good places to start.
1. Don’t Over-Provision Your Cloud Infrastructure
Remember when there was that great deal on strawberries so you bought a bunch because you thought you’d surely eat them? And then you never did? Just like it’s hard to figure out what you’re really going to eat in a week, it’s hard to figure out what resources your software really needs in order to run. You can use a monitoring solution to determine what your resource utilization actually looks like in production, determining how much of critical resources like memory, CPU, disk, networking and more you’re using. Then, it’s a matter of aligning that with an instance size (which unfortunately sometimes feels more like blindly buying strawberries in bulk than reaching for a pre-packaged pint, considering the sheer number of options per cloud service provider).
2. Turn Off Idle Cloud Infrastructure
The main cause of idle capacity is leaving non-production machines up and running 24/7. Consider spinning down build, QA, demo and development environments during off hours. You can schedule them to turn off when your night owls leave and turn back on before the early birds come in. On the production side, use auto-scaling groups to help meet peak demand times. And of course, be vigilant that as people and products come and go you’re monitoring what systems are actually being used.
Cloud over-provisioning is a lot like like buying strawberries in bulk.
I know that sounds weird, but hear me out:
I once bought a huge tub of strawberries at Costco. Sure, there were way more strawberries than I could probably eat, but they were such a great deal– just a little more expensive than a small box of berries at the grocery store. The lure of the deal was strong, so I caved.
What happened next? I ate a few berries out of the tub when I got home, promptly put them in the crisper drawer, and completely forgot about them. The next time I opened the drawer it was like a scene out of Avatar — a mysterious new greenish-blue ecosystem, composed of fuzzy, strawberry-shaped blobs.
Bulk strawberries sound like a great deal, but only if you’re going to, you know, actually eat all those strawberries.
We all pay for stuff we don’t end up using. Whether it’s those strawberries slowly creating a new ecosystem in the fridge or your company’s public cloud infrastructure, that waste can seriously add up. The moral of the story? It’s never a good deal if you don’t use what you’re paying for.
As cloud computing continues growing in popularity, more and more companies are turning to the cloud for their computing needs. But if you’re spending any money on a cloud service provider, it’s pretty darn likely that some of those funds are being lost on overprovisioned or underutilized cloud infrastructure. (Think: the proverbial untouched, moldy strawberries in the fridge.) It’s human nature to buy more than you need “just in case,” and this applies to cloud infrastructure too.
At Sunshower.io, we talk to a lot of people about their cloud infrastructure usage. In our professional lives, we’ve dealt with the confusion caused by different cloud vendors, including confounding billing methods, lack of insight into the infrastructure you’ve built, and just throwing hardware and money at the current problem and hoping it’ll fix it. Understandably, the question we’re most frequently asked is the one that’s most mission-critical: How did my cloud bill get like this and how do I get it down?
1) You Forgot About Some Infrastructure
“Cloud sprawl” is extremely common, and happens when you’re running more cloud instances than necessary. It’s easy to see how this can happen—running workloads that you’ve forgotten about and unused and idle workloads are all key culprits. In a complex cloud ecosystem, it can be tough to keep watch over everything running in the cloud. Monitoring and controlling those workloads is key to making sure you’re not over-spending on the cloud. If your company isn’t using auto-scaling, you might be running instances 24/7 that aren’t always performing a necessary function. Running instances that you’re not using is essentially throwing money away—like going away for the weekend and leaving all of your lights on.
2) You Bought Too Much “Just In Case”
Overprovisioning refers to buying more cloud compute resources than you typically need. It’s important to tailor what you buy to actual usage, because it really adds up. The first step is figuring out what you’re actually using, which monitoring and cloud cost optimization tools can help with. If this process is overwhelming, there are vendors you can work with to help you sift through your options and make the best possible choices. Without good cloud monitoring tools, it’s impossible to see what you’re wasting. Only then should you start looking into what to buy instead.
3) You Drank The Vendor Kool-aid
The custom services provided by cloud service providers are tempting, but the cost can really add up. Even worse, it removes your ability to migrate to other cloud providers, so it’s hard to pivot to more cost-effective solutions over time. As you build your cloud strategy, try to avoid locking yourself into a relationship with a single cloud service provider. Don’t tie yourself to a single vendor because it’s convenient—make sure that you’re allowing yourself the flexibility to change providers and adapt new strategies when costs start to increase.
The heart of the Sunshower.io cloud management platform is a distributed virtual machine that we call Gyre. Developers can extend Gyre through Sunshower’s plugin system, and one of the nicer features that Gyre plugins provide is a dependency-injection context populated with your task’s dependencies, as well as extension-point fulfillments exported by your plugin. For example, take (part) of our DigitalOcean plugin:
The details are beyond the scope of this post, but basically Gyre will accept an intermediate representation (IR) from one of its front-ends and rewrite it into a set of typed tuples whose values are derived from fields with certain annotations. The task above will be rewritten into (ComputeTask, Vertex, TaskResolver, TaskName, Credential). This tuple-format is convenient for expressing type-judgements, especially on the composite and recursive types that constitute Gyre programs.
As a cloud management platform, we understand that it’s tough to get started on the cloud. There are so many options, and confusing pricing structures can make the whole process seem overwhelming. Fortunately, there are lots of great programs dedicated to giving startups access to the resources they need to be successful. (Yes, even free cloud credits!) Before locking yourself into a relationship with a cloud vendor, check out these seven discounted startup programs. Applying can give you a great chance to play around with that cloud’s processes and pricing structure without spending more than your budget can handle.
The credits and perks you’re offered from AWS Activate depend on which package is the right fit for your startup. The Portfolio package includes $15K in AWS credits over 2 years. The Portfolio Plus package gives you access to $100K in credits over 1 year. (AWS business support and training are some of the other perks of Activate.) The Portfolio and Portfolio Plus packages are available to startups that are associated with an approved accelerator, incubator, or VC Fund.
If your startup doesn’t qualify for AWS Activate but you’d still like to get hands-on experience with AWS, you’re in luck. AWS also offers a free tier, which gives new uses free access to over 60 of their tools for 12 months. It’s a great way to learn and experiment with AWS — just be careful to stay within monthly limits!
Create@AlibabaCloud offers qualifying startups $2K to 50K in credits. You maybe eligible if your startup is a) registered outside of China, b) been in business less than 5 years, c) has less than $500k in annual revenue. And, bonus, you get priority if you’re not on Alibaba Cloud yet.
Google Cloud offers new users $300 in credits for a year at https://cloud.google.com/free/, but you may also be interested in their three Google Cloud for Startups programs. You may qualify if you’ve raised no more than a Series A and are less than five years old, getting $3K to $100K in credits for the year.
Build and scale your startup using the Hatch program and receive 12-month access to the DigitalOcean cloud with up to $100K in credits. Hatch also includes technical support and mentoring, along with a host of other tools.
Hatch program isn’t for you? DigitalOcean is also currently offering a $100 credit over a 60 day free trial period. There’s no affiliation with an incubator or accelerator required for this one, but it’s for new users only.
There are two options here. The first program is available to all startups, and includes $200 in Azure credits over 30 days. The second program is available to startups who meet their qualification criteria (company should be less than 5 years old, offers technical solutions, less than $10M in annual revenue, under $20M of funding, and associated with an accelerator or incubator), and includes up to $120K of free Azure cloud services over 2 years.
Oracle’s startup program bills itself as an “acceleration program,” so the application requirements are a little different from some of the other programs. Affiliation with VC firms, incubators, or accelerators isn’t required, but they’re interested in funding companies focused on “transformational technology.” If this describes your company, Oracle Global Startup Ecosystem could be a great opportunity to access free cloud credits, mentorship, training, and support.
IBM offers two tiers of support to startups. The Builder program includes $1000 a month in cloud credits over the course of a year, and doesn’t require affiliation with an incubator or accelerator. The Premium program supports companies involved with an approved accelerator or incubator that are focused on developing “innovative technologies.” If you qualify for the Premium program, your startup could receive $10K a month for a full year.
Before You Apply
There are lots of great opportunities out there for startups looking to get started on the cloud. Keep in mind, though, that most of the programs on this list are only available to new users, and some require your startup to be affiliated with an approved accelerator or incubator to qualify. Please check with the individual vendors to verify program details and eligibility before applying.
Once you’ve gotten started on one of these discounted startup programs, you’ll have the tools you need to start experimenting with the cloud. Sunshower.io can be an important part of that plan, too. When you’re just starting out on the cloud, the learning curve can seem pretty steep. Sunshower.io has the right tools to help you easily and intuitively manage the entire lifecycle of your cloud infrastructure. Our drag-and-drop deployments and unbeatable optimization algorithms are all designed for simplicity and ease of use. Whether you want to deploy software on the cloud, track workloads, or view all the spiffy new infrastructure you’ve built, you can master the cloud with Sunshower.io. From cloud resource management to cloud cost optimization, we’re here to help your company succeed by demystifying cloud computing so you can focus on what matters — your business.
As an artsy, outdoorsy type and a middle school humanities teacher in my mid-thirties, I am the last person you would expect to see in the role of intern at a cloud management platform like Sunshower.io.
Perhaps we can blame Marie Kondo for my transition into web development: I started off cleaning my house and by the time it was decluttered I had a new career plan. More likely we can point our finger at a bottle of wine and a dead-end career in education. Together, they conspired to make me complain to my sister and brother-in-law over dinner about my professional woes. (My sister and brother-in-law are the CEO and CTO, respectively, of Sunshower.io.) By the end of our meal, he had suggested I go into tech and she had given me an internship.
That was four months ago. The past few months have taught me a few lessons about tech and life:
Lesson #1: You have to start somewhere, and you’re not going to learn it all in a day.
I started with Sunshower.io knowing the bare minimum of the tech it takes to keep a 21st century classroom running. I certainly did not know about IAM, AWS, EC2 management, or cloud cost optimization or why one would care about any of it.
Lisa and Josiah showed me crazy computer things that I had never seen before: pug, github, git, command terminals, Docker, and dev environments. We like to call this steep learning curve “Depends for the deep end” because, sometimes, you end up over your head in code and it’s so scary you want to pee yourself.
Honestly, needing Depends for the deep end is not only okay but expected. Lisa started off her software engineering career with a wee bit of CSS and HTML and a master’s degree in public communication and technology. Josiah was a math major. They both taught themselves everything they needed to know (using life lessons 2 and 3; see below), and they still have days where they have to ask each other questions or take brain breaks to figure out solutions.
Where does this leave me? Having a lot more patience for the learning process. Whether you learn a little bit every day–or, per the Sunshower.io experience, a lot in one day–you will start stockpiling an impressive amount of know-how.
Lesson #2: When in doubt, look it up online.
While Sunshower.io’s people look out for each other, it is also a culture of rugged individualism. When you are working for people who built up their skill set from scratch without help, there is minimal patience or time for hand-holding.
You have to learn to find answers on your own. And you will.
Lisa broke me of the habit of asking too many questions early on. When I would ask her something easily answerable, she would ask what I thought or whether I had looked it up. Pretty soon, I would answer my own questions before she could reply, and finally I stopped needing to ask. Except for unanswerable structural questions, that is, which leads us to lesson 3.
Lesson #3: If you can’t find it online, ask.
For a newb, solutions are easy to find online. However, when you are collaborating on projects like Sunshower.io’s visual modeler, distributed virtual machine or cloud optimization machine learning algorithms, in the end you often HAVE to ask about the factors that might be standing in your way.
Lesson #4: Be patient. Tech is a rollercoaster of successes and failures.
Some days, your code will work perfectly. You will build something awesome and post your progress on social media. Your dev environment will load perfectly, and you can check off your to-do list in an hour.
Other times, you will run commands in your terminal, and it will take hours and still won’t work. You will run tests through your IDE, and it won’t work…and won’t work…and won’t work.
Lisa taught me that a big part of tech is being comfortable with the failures and dead-ends. Your code won’t always work. And that is okay. Maybe tomorrow you will ask the question that leads you to the solution you need, or perhaps the quick-fix to your broken code will dawn on you at a gloriously random moment.
So pour yourself a cup of coffee, sit in front of that computer screen, and buckle your seatbelt. See where today leads you.
Lesson #5: Have a dog close by.
Between the three founding members and me, we have three dogs, and they are always close at hand. When Sunshower did its QA night, during which we ran the web application with three people clicking buttons simultaneously, we ran tests while dogs roughhoused in our laps and under our feet.
Lisa and Josiah’s mini aussiedoodle Fran forces them to take breaks. Lisa’s brain breaks involve playing with Fran on the floor, and Josiah takes Fran for long runs before he starts working for the day.
In addition to forced breaks and relieved tension, dogs simply remind you not to take tech or life in general too seriously. Having a dog roll over on your laptop keyboard or drool on your computer screen reminds you that, no matter how important your tech projects are–and they are–they are just tech projects.
When the going gets tough, rub that belly or scratch those ears. You’ll figure it out. We promise!
Lesson #6: I will never, ever work as the chief of anything for a company. Ever.
Despite what I knew about Lisa and Josiah’s work days, I tended to romanticize what they did. Work all night? Sleep until noon? Take breaks when you want? Code your way to your dream life? Yes please! Sign me up!
I did not truly comprehend their daily grind, and I seriously questioned their love of cartoons as entertainment (really guys?), until I started working with them. Their work days start at ten in the morning and go until midnight if they are lucky. Josiah has been known to pull multiple all-nighters a week while tackling infrastructure projects. Lisa had chronic shoulder and forearm pain from typing for 14 hours a day that was only cured by throwing down over $80 for a split keyboard.
However, these epic workday ultramarathons have paid dividends. This week, they came in second place in the pitch competition at Fort Collins Startup Week. They have six clients and more in the wings. It is commendable. Truly.
And I would not wish it on anybody.
Lesson #7: Tech is about people, experiences, and services.
Tech is not just about the code you write or the tests you run. It is about connecting with Lisa and Josiah about their QA needs and with Tif about blog posts like this one. It is the Sunshower.io home office: a north-facing former bedroom in their Fort Collins home, the window opening to farmland. It is the late-night walks that help you work out your code, the new people Lisa adds to LinkedIn, the friends I have made through tech meetups. It is the hundreds of hours spent on a service that can save companies thousands of dollars on their monthly AWS bill. It is the scrappy tech stars working long hours to bring their services to life for future clients. Code is only the beginning.
Sunshower.io’s optimizing algorithms help you save time and money on the cloud. There’s no upfront cost, and our results are better than our competitors. It’s cloud computing optimization unlike anything else out there? So how do we do the thing?
Imagine you need to rent a storage unit — you have a bunch of boxes, but nowhere to put them. No problem! There are a ton of companies out there that will rent you a storage space. You do a quick search, and find over 30 self-storage companies scattered across town. You don’t have time to talk to everyone to compare prices (who does?), so you call a company whose name you recognize. You’re not exactly sure what size storage unit you need, so they talk you into renting a 10 x 20 unit, “just in case”, at which point you end up with a storage unit that looks like the photo above.
End result: you’re paying for a lot more than what you need. Sure, you could move to another facility, but who wants to negotiate with another company, then give up their whole day to move a truck and switch facilities? Easier to stay put, and keep that extra space.
Buying too much “just in case” is a very common things for companies on the cloud, too. Why?
There are an overwhelming amount of cloud service provider choices
There are an overwhelming number of options on each of those cloud service providers
The UIs of cloud service providers are confusing
It’s hard to know exactly what you need and what you’re using
That’s where Sunshower.io comes in
When you work with us, we securely run metadata about your resource usage through a proprietary algorithm designed to find the exact right fit for your cloud compute needs. We use machine learning to calculate millions of data points, factor in fluctuations in data usage over time, and come up with a cloud plan that ensures you aren’t overpaying “just in case.” We find you a fit so good, we can save our customers 40% or more on their monthly cloud compute bill.
(Think Cinderella’s glass slippers, with good arch support and just enough wiggle room for your toes.)
Over time, this kind of cloud savings can be game-changing. Just imagine the decisions you could make even with an extra 20% of your monthly cloud spend back in your pocket, like hiring another engineer, or launching a great social media campaign. And that’s what we’re all about at Sunshower.io: helping you focus on what matters — your business.
To that end, we’re excited to announce our just-launched AWS EC2 optimizer
If you’re currently using Amazon Web Services EC2 for your cloud infrastructure, our service (colloquially known as Anvil) has been specifically tailored to analyze your data and come up with a better cloud usage plan to help with AWS cost optimization. The bottom line: Our AWS cost optimization can help you save money on AWS with just a few clicks.
Not using AWS EC2? We promise you won’t be left out. We’re launching AWS RDS optimization next, and we’ll be releasing optimizations for more public clouds as we go along. (Google Cloud and Azure are next up on the list, but let us know your needs and we can re-prioritize!)
Because we need a snappy way to refer to what we do, we call ourselves a ‘cloud management platform.’ But that undersells it. Why? Because cloud management platforms and solutions are for the big guys — the ones with IT budgets the size of small countries, or at least small counties. Twee though it may sound, we want to be the great equalizer for cloud computing, supporting engineers of all stripes.
Why does this matter?
More and more, engineers aren’t coming from a Computer Science background, they’re coming from code academies or more ad hoc backgrounds (hello, yes, I majored in journalism). And even when they are, cloud computing isn’t really taught in schools. So you wind up in a job, and suddenly you have to figure out how to deploy things. Or you start a company, and you realize “wow, I can’t just have this run on my localhost.” Or maybe your infrastructure is in the cloud already, and you realize you just wasted $200 on an instance you forgot about. Or your infrastructure is in the cloud and costing you the salaries of three good engineers a month, and you have to figure out how to keep the engineers and not the cloud cost.
And so the Googling and Stack Overflowing begins, except half the information is out of date because things are always changing, and the numbers are almost always wrong because cloud service providers are constantly changing their pricing structure. And don’t even get me STARTED on how or if you should containerize your software.
It is in these moments that you wish that there was a cloud management system that could just do the thing for you — help you pick a cloud, help you migrate across clouds, help you deploy with Docker just like you had been with machine images, help you with cloud cost optimization.
And that, THAT is our why. Because no matter how new or how senior, there will be a moment when you don’t have the support you need. We didn’t pick the name ‘Sunshower’ because it was cute and fit with the cloud theme (okay, we kind of did). We picked it because dealing with the cloud shouldn’t have to be so dang hard. It should be able to be easy, and rewarding, and maybe even fun.
Testing UI components is one of the more difficult parts of QA. In Stratosphere (one of the key components of our cloud management platform), we’d been using Karma + Jasmine, but the browser component had been complicated by the fact that providing a DOM to tests in a fast, portable manner subject to memory and speed constraints can be pretty challenging. Sure, initially we did the PhantomJS thing, then Chrome Headless came out, but writing UI tests just never really felt natural.
Then, last week, we decided to open-source our component framework, Aire, built on top of UIKit+Aurelia, and that created an exigent need to fix some of the things we’d been limping along with, most importantly testing. The success of OSS projects depends on quite a few things, but I consider providing a simple way to get contributors up-and-running critical.
Internally, Aurelia uses an abstraction layer (Aurelia PAL) instead of directly referencing the browser’s DOM. Aurelia will (in principle) run on any reasonable implementation of PAL. Aurelia provides a partial implementation OOTB, Aurelia/pal-nodejs, that will enable to (mostly) run your application inside of NodeJS.
Our project structure is pretty simple: we keep all our components and tests under a single directory, src:
At the top of the tree you’ll notice jest.config.js, the contents of which look like this:
Basically, we tell Jest to look under src for everything. ts-jest will automatically look for your Typescript compiler configuration, tsconfig.js in its current directory, so there’s no need to specify that.
Our tsconfig is pretty standard for Aurelia projects:
If you just copy and paste our tsconfig.json and jest.config.js files while following the outlined directory structure, everything will Just Work (don’t forget to npm i -D the appropriate Jest and Aurelia packages.)
At this point, you can use aurelia-test to write tests a la:
Now, you can run your tests with npx jest:
firstname.lastname@example.org test /home/josiah/dev/src/github.com/sunshower/aurelia-aire/aire
Test Suites: 4 passed, 4 total
Tests: 12 passed, 12 total
Snapshots: 0 total
Ran all test suites.
Enabling support for complex DOM operations
At this point we could successfully test Aurelia + UIKit in NodeJS.
The final piece
All of our component views are developed in Pug, and I didn’t like that we’d be developing in Pug but testing using HTML. The solution to this turned out to be pretty simple: adding Pug as a development dependency and creating a pretty simple helper function:
With that final piece in place, our test looks like:
The benefits of writing tests in this way became apparent the moment we cloned the project into a new environment and just ran them via npm run test or our IDE’s. They’re fast, don’t require any environmental dependencies (e.g. browsers), and allow you to run and debug them seamlessly from the comfort of your IDE. But, perhaps most importantly, these are fun to write!