A million-dollar engineering problem
segment.com
segment.com
He contacted the developer who said that they were shutting it down because the server costs were higher than the money they were making.
They were spending 5k a month on AWS crap and claimed it was impossible to get any lower.
He helped them consolidate everything onto a single rented dedicated server costing 400 a month. Now the service is profitable, and will stay up.
It runs way faster on the single server. It also has required less maintenance after the move too.
This kind of shit is everywhere. At this point simply not using AWS is a competitive advantage.
The 50%+ profit margins have to be coming from somewhere. AWS is not made of magic, it's made from largely the same PC parts you buy on newegg
Charge more than what it costs you. That's how to make money.
if anything its a diversion from fixing what is broke or even admitting to it within some organizations
So, if you provision an x1.32xlarge with 128 vCPU and 1.92TB of RAM, you get a single, dedicated host with that much CPU and memory. Nobody else gets it - it's dedicated to you 100%.
The profit AWS is making is purely due to datacenter efficiency and being able to automate their operations at scale.
What is a vCPU?
As soon as 32GB DIMMs drop enough in price, I would expect them to do exactly that. You can configure a Dell R930 with e7 Haswell CPUs online, if you want to double-check it. Not sure if the R930 can go to 8 CPUs (which the e7 Haswells CPUs support).
That's what they want you to think, but a lot of it comes in the form of ripping you off for bandwidth to actually get data out of EC2.
Use the right tool for the job.
Lab 4 is a beast with more lives than <insert metaphor>. The moment you think you've finally written your distributed system correctly, the unit tests will prove your service fails during XYZ network partition topologies. It's very worthwhile to be forced to think about issues like that and to design distributed systems for correctness.
But to address your question more directly, it's generally just a matter of scaling your service as much as possible on a single server. The server has finite resources (CPU, Memory, network, disk) so you either know how your system consumes those resources (because e.g. you wrote the service, and you know it uses O(n) memory w.r.t. the workload) or you graph your usage over time and try to predict when you'll exhaust your available resources. At that point you can usually think of some straightforward optimizations, which keeps everything on a single server. But eventually you might run out of resources with no obvious path to optimize it, so what then?
It depends entirely on your service, but typically you can just use off-the-shelf software to scale to multiple servers. For example you could set up three servers, each running Redis, and have Redis keep a list of "work to be done." Then your central process just farms out the workload to each of the three servers round-robin style, for example.
But at that point your service becomes a lot more brittle, e.g. you'll need to set up a failover solution so that your cluster can survive partitions and outages. (Redis uses Sentinel for that.) So it's worth keeping everything on a single server for as long as possible, if you can work out the optimizations to do so, since it's so much simpler with only one server. (HN is still running on a single core and serving 350k daily uniques, I believe, which shows just how effective it can be to keep your architecture as simple as possible.)
My question is learning about design ideas like having Redis keeping a list of "work to be done" and such. Using modern tools to combat 'modern' problems. Is it just something you figure out after knowing the fundamentals (i.e. when you can identify a problem you know what the solution needs to be)?
If it sounds mysterious, think of it this way: Imagine you were thrown into a room with a computer, internet, and endless food, and the only way out of the room was to solve this problem. I bet you'd figure it out within a week or two, or a couple months max. (If only to go have a shower.)
One thing to watch out for: Solving modern problems can be pretty unsatisfying. Before you experience what life is like at a modern company, you tend to think of them as functional, orderly, and planned. Real companies are almost universally dysfunctional, disorderly, and haphazard. It's very rare that a plan is conceived, followed, and deployed without growing some warts and throwing in some hacks to get it done.
So I think you should enjoy this time, where you're free to think of thought-problems like "What's the most correct and extensible way to solve this problem?" instead of being forced to solve them on a time crunch.
Once the company grows big enough, yes, then it might make sense to go off AWS (or not - see: Netflix).
I'm thinking of services, say the automated robo-built sadwiches, or the Easy 401 service, or the luxury shoes startup (all real YC-accepted companies), where the core business proposition isn't necessarily dependent on having a huge infrastructure.
That's something that should be applied almost universally. :)
If they can indeed fit their footprint in one single server, then it should be fisible to just host the server at someone's home with enough upload speed, no?
I think the real issue is that people assume all workloads are public cloud workloads. The bigger and less dynamic your workload the less that is true.
Seeing the opposite trend.
Because your own machines are so expensive and annoying to manage, you only get 500GB memory 40 cores servers. You don't optimize and you run stuff randomly on whatever seem available.
Whereas in the cloud, you put VMs per role, with appropriate sizing. And when someone asks for 5 machines with 16 cores, you can be like, WTF are you running with all that power???
Respectfully, I'm going to disagree. I consult full time on AWS cost optimization / reduction / understanding.
If you blindly run things on AWS without an understanding of the costing model, that'll work for a time. As you scale, you start to realize "oh my god it runs on money."
There are myriad ways around that, but a blanket "never use AWS" isn't going to address it constructively.
At the single instance very small scale, it simply doesn't matter all that much. "Our business failed because our infrastructure bill was $400 instead of $150 every month" isn't that common of a story.
Base load can be effectively migrated to AWS, depending upon how it's built / structured. It's hard to lose money on infrastructure by converting worker servers to spot instances or lambda functions, as a for-instance-- but it's VERY easy to lose months of engineering effort in doing so.
Remember as well: done right you're not just buying services from the cloud, but flexibility as well. Resizing on the fly, bursting, duplicating your infrastructure for a test-- these things add value.
Those marginal gains could potentially pay for a dozen engineers...
It depends. I have a toy service that exists entirely as an autoscaling group. That's pretty dynamic!
Counterpoint: Mainframes.
A lot of teams rent space from places like OVH or Hetzner because the raw power is so much cheaper, and they already have the talent and tools to scale and manage a computing fleet (people like to think it's harder than it actually is).
Step 1 is always "figure out what you've got, and why it is this way."
As you grow, start adding project tags to things. Automatically tag resources with the IAM user who creates them. Have an "untagged resources report" that goes out on a schedule.
Build with an eye towards "when someone freaks out in a year about the bill, what questions will they have, and how can I best position Future Me to answer them?"
But that's not what the commenter was saying, of course.
More like (paraphrasing) "before you go full-hog on AWS, do some simple math first." Which an amazingly high percentage of people neglect to do, these days.
Your time is valuable too. It could be spent developing something novel instead of messing around with server configuration.
† About the monthly you-know-what bill now well into 5 figures, and climbing.
I had a coworker who was turned off of AWS by clicking the "Dedicated IP" checkbox when deploying a CloudFlare distribution with SSL.
One month and $600[0] later he swears up and down that AWS is the devil.
You can spend an amazing amount of money on AWS by accident and/or without need. Hourly pricing is a huge footgun. Best to run everything through the "Simple" Monthly Calculator: https://calculator.s3.amazonaws.com/index.html
"If you have content where you can't put a cache in front of it, and it drives significant bandwidth use, then AWS is not a great option"
Data driven applications on AWS are already expensive because of the high traffic costs, but storing/serving media on S3 single handedly lets your bill explode. For everyone who feels like the statements above are exaggerations, just check out their actual prices (https://aws.amazon.com/ec2/pricing/on-demand/) in comparison with a regular CDN (https://www.stackpath.com/pricing/).
Curious, have you ever consulted a client not to use AWS? As in "your cost optimization is going to be not using AWS and using $x instead"?
That said, clients who come to me already have a significant investment with AWS. Getting rid of that is a high bar in terms of engineering effort.
That said, I've no financial incentive to recommend one provider over another. My clients pay me, the vendors do not.
We've pushed clients to competitors' products a few times, I was young and thought that was silly. However those clients spread the word about us and we didn't even have much of a marketing department, it was all word of mouth. Gaining their trust was gold and a really good long term investment.
Generally most of the time the best approach is to create solutions that can scale out independent from the HW / infrastructure they run on. With frameworks like K8s / Docker / e.a. this is now relatively easy.
With that for example you can start of with a few small cloud machines / docker containers. When you get continuous load - migrate some of them to 1-2 dedicated machines. Same with peak load - just spin up more images.
All that of course depends on what kind of application you are providing. If you are running a data intensive apps you might start directly with a dedicated machine.
Easy in, expensive out. One cost with cloud services many forget is the cost to get out again. Have a look at the AWS / Azure price-lists.
Well, actually it doesn't.
RAM and Xeons are expensive.
- 1U single socket Supermicro Xeon E5v4-2630 10core+1GTX1070 GPU = 1500EUR
- operation costs (power+cooling) over 3 years = 1500EUR
- cost of 2 hardware admins 160k/year
- renting local rack space 15EUR/U
This equals about 145 servers for 3 years for us for 1 Million. The setup is highly optimized for _one_ set of data crunching tasks, not DB. We do not need much ram, or network but require a specific CPU/GPU ratio.
This is by far the most expensive item in your estimate, and I'm sure that you don't suddenly need to hire another pair of admins when you buy a single Xeon blade.
Once you factor this fact in your estimates, you'll realise that the unit cost of each server is, unlike your estimate, negligible.
That's about the upfront costs of servers ONLY.
Ignoring cooling, all personal costs, electricity, networking gear, network storage and future maintenance.
Figure a 10% quantity discount and you are looking at at least 200 of those for about $1 million per year.
For 500€ a month, it's possible to buy your own 40 core blade with 256gb of RAM. In fact, it's possible to buy a pair of those servers.
Came here to share my story, which is very close to what you describe.
tl;dr: Moved from AWS to colo in desperate attempt to make balance sheet more attractive. It worked.
Before I took over the engineering bits at this plateau/failing startup, they were all in on AWS. Monthly costs were running at around £3k. Which is not much, but since the revenue was tiny, the costs of hosting was "considerable". After a monumental effort on my part to try to make things more efficient and streamlined, I eventually run out of motivation (but that's another story) so I expressed my wish to leave to the founder and he finally agreed to my years old suggestion of going lean-and-mean and in one last attempt to make the company more attractive to one last investment round (E by then). Make it or break it, as the say goes.
On that same week I came across a HPE "Buy One Get One Free" offer (similar to this one https://www.serversdirect.co.uk/pdf/BOGOF-Gen9-Servers.pdf). Then found guy who was re-selling colo space at a under-used datacentre in London. Since I (sysadmin/DevOps/InfoSec/Backend engineer Jack-of-all-trades master of none) was the person who would end up managing the new metal, I picked a location within an hours drive from home.
And so it happened.
2x 1U HPE proliant servers with decent CPU and 32G of RAM. And 6x Samsung 850 SSDs off Amazon. Total bill for the hardware (BOGOF refund included): £2600 ish.
Post migration, monthly hosting costs: £50 for the colo; £50-ish AWS S3+CloudFront (10M assets would increase the SSD storage costs too much); £40 in taxi fares when I visit the DC once a month for kernel updates.
And just like that, we broke even the very next month after the last "big" AWS bill. Our product wasn't all that exciting, but 2 months later we found a buyer who was happy to snatch this "non loss making" operation.
3 months after the acquisition, they had already migrated the whole thing back to AWS and the HPE proliant servers were gathering dust in their office.
If RDS saves you 30 minutes a week I'd be surprised.
We made do for quite a while on a single colocated database with 32 GB of RAM and a few fast SSDs (for the time, which was about 6 years ago), and a few multi-TB archival drives, but disk space is a concern since our compressed innodb tables are well over 100GB now. I set up a Google Cloud SQL instance (the largest possible at the time I believe, 104GB RAM, and enough disks to hit peak IOPS) a few months back in preparation of migrating the data store to it, and found it wholly inadequate for our needs prior to even getting it going.
First, the second generation instances don't support being a replication slave to a non Cloud SQL instance, making migration a pain. Second, just running through the replication logs on a client and piping it to a connection to the cloud SQL instance showed that the cloud SQL instance was just barely able to keep up with the insert and update traffic from the replication log, even while handling no other queries. Catching up the the master would take over a week, even though the backup was from less than 48 hours prior.
We signed up for an actual hardware server from Rackspace at about 2/3 the cost, but with 128 GB of RAM (which I can request expanded), and nice hardware RAID 10 of fast SSD drives, and tons of logical CPUs. It's appropriately faster compared to the original database server, to the degree you would expect from from stats quoted. It fits our needs, because really I just don't want to manage the hardware anymore (this the decision not to deploy more hardware in the local datacenter we are colocated at), and that's covered.
On demand spin up/down of resources and per-minute billing is nice, and I've used it to good effect for non-database resources before, so I understand the versatility of it and how it can really enable some new types of usage and am a fan of that aspect, but I just wasn't prepared for how substandard the DB offerings are if you actually have any sort of load. At this point, the only good thing I have to say about the higher end database offerings is that they were quick to destroy so I didn't get billed anymore. :/
Disclosure: I work on Google Cloud and Cloud SQL
You put bald tires that are over-inflated on a Porsche and you're gonna have a shitty experience. Sure, bare-metal is gonna have performance benefits over AWS and at times might be cheaper -- but that isn't the only thing an eng organization is looking for.
tl;dr – you can build systems on AWS that perform well and are reasonably priced.
This is off topic, but bald tires have better traction than grooved ones in dry conditions. (But the slightest bit of rain and they will not hold.)
Also tire inflation does not have a strong correlation with traction (there is some, but it's not large), so it's not so obvious that over-inflated means a bad experience.
But yeah, AWS generally is expensive, which is part of why it's making so much money.
It definitely makes business sense to try to avoid locking yourself in to AWS but at the same time it's a good place to ramp up or test your business ideas without needing to invest a lot of money in servers, real estate etc.
[You can probably substitute any other cloud provider for AWS here]
The way you wrote your comment about using a dedicated server implies that there are no other viable cloud providers besides AWS. That is the problem, people do not know or do not acknowledge the existence of a number of other cloud/VPS providers that, in most cases, would work perfectly fine for their startup, and be a massively better value.
Such as Digital Ocean, Linode, or many small relatively less well-known providers that are perfectly fine like UltraVPS etc.
Sure, some few people do actually need DynamoDB or some other ultra-scaling AWS service, but people who just need VPSs can get a much better deal elsewhere.
While it was obviously a good trade off for this company, it seems silly to then extrapolate that all companies would benefit by getting rid of redundancy and scalability.
AWS loves startups that could end up being huge customers so they're willing to slash bills upfront to help you get to growth stage; not only will they assign you an account rep but they'll have a rep whose job it is to build a good relationship with your VC. Speak to your account rep. Have your VC speak to their Amazon rep. Push them to cut your prices.
I've known startups which have cut their monthly bill by six figures going this route. AWS doesn't want your startup to fail and on the margin these resources cost them close to zero so they're willing to deal, make use of it.
You're the ideal case for this, not only will you be a large customer in your own right if you succeed but you have a multiplier effect in that your own clients become heavier users of AWS because of your product encouraging users to move large amounts of data from Salesforce, etc. into AWS.
I don't what level the rep you're dealing with is, but if you're not doing so already I'd strongly encourage you to build higher level relationships with AWS.
They're giving people what is essentially a loan, which they are uniquely able to give, to help them start a business, in the hopes that this will be an even bigger business. This is almost the definition of a win-win.
Customers are free to leave at any time or work with other providers, but they choose AWS because they give them more value.
By pricing it in to the discounts in the first place. So smaller discounts. And by making sure their offerings are priced competitively to comparable products.
>This is almost the definition of a win-win.
Not long-term for the company that gets lured into this trap. Just like with Cisco/Oracle, companies will waste millions of dollars once they are cornered into a situation like this because the switching costs are so high even though there are plenty of other alternatives.
Incidents like this are generally why rate limits exist, which they don't currently have [0], but perhaps they'll consider a burst limiter in place to dissuade automated tests but not organic human load spikes.
Unfortunately there doesn't seem to be an easy way to fix the per-user ID write bottleneck, short of adding a rate limit to the API – which would push backpressure from Dynamo to the Segment API consumer. Round-robin partitioning of values would fix the write bottleneck, but has heavy read costs because you have to query all partitions. They undoubtedly performed such analysis and found that it didn't fit their desired tradeoffs :)
Great post, very informative. Thanks for sharing! Also, love the slight irony of loading AWS log data into an AWS product (Redshift) to find cost centers.
[0]: https://segment.com/docs/sources/server/http/#rate-limits
We currently have an internal project underway to detect hot keys in our pipeline and collapse back-to-back writes before they're written out to DynamoDB.
It's difficult to apply throttling on these conditions synchronously within the ingestion API (i.e. return a 429 based on too many writes to one key) because of the flexibility of the product: that workload is perfectly acceptable for some downstream partners. It also gives me pause from a reliability perspective. We try to keep our ingestion endpoints as simple as possible to avoid outages, which for our product means data loss.
If you don't mind answering: for your warehouse offering, do you pull data from some services (e.g. Zendesk, SFDC), have them push it to you (which is what I interpreted your "downstream partners" comment to mean – though perhaps those are "upstream partners"), or a mix of both?
The basics is to have less machines but more powerful. It helps to handle the targeted bursts.
The advanced is to have a layer of queuing before the ingestion, where you can do magic with distribution rules, rate limiting and dropping peak traffic.
> The advanced is to have a layer of queuing before the ingestion, where you can do magic with distribution rules, rate limiting and dropping peak traffic.
And batch loading – don't forget batching!
I mean to have bigger servers for everything. For instance, a farm of 4x 10cores servers is likely to process data more consistently than 10x 4cores servers.
We are forced to pay extremely large sums of money to upgrade our infrastructure as any purchase requires a redundant piece as well.
For example we have used 90% of our SANs storage, our IO is suffering and now were looking at purchasing two $10k SANs to upgrade. In the meantime, we have probably spent over 10k worth of development time to compress, clean up, and remove any data we don't need. We will not get the weeks of development effort back, we will continue to spend more money on hardware, and we will continue to suffer to delay projects because of poor choices.
If we had AWS, we could have written an entire sprints worth of work (also ~$14k worth of IT time) and moved on with our lives.
Clearly, some companies let the budget keep growing, but for most companies AWS flexibility is worth its weight in gold.
Colocation provides a SAN in the form of calling up a datacenter storage company and having some consultants install you a SAN.
What are you going to do to get similar functionality on OVH, Rackspace, or Softlayer?
As part of this process, we looked into AWS and similar products, and with a naive 1:1 move it would be 3 times more expensive than getting a hardware deal with ramp-up (make a deal for X, buy 20% * X upfront, then buy the rest as needed). Implement some better scaling up and down might have decreased the cost to only a 2x multiplier.
Having your own hardware is not a walk in the part, and you need at least one experienced sysadmin to help with server setup, but I feel that for a steady company the cost benefit alone is worth it. We still use a CDN on top of our setup to alleviate pressure to our servers, but otherwise everything runs on our own hardware.
I suspect you haven't priced out AWS storage (and the bandwidth to actually access the data with frequency). If the cost of a SAN was hurting your company and you had to look to reduce data usage, AWS will absolutely wipe you out.
Give me what I save you in 2 months and I'll have a good business :)
Having said that, all the cost savings initiatives I've spearheaded are on my resume and LinkedIn profile and I take great satisfaction in optimizing those environments to save the client money.
I decided that all of my personal projects will be GCE. It is much more cost efficient already and Google will soon allow me to commit to future usage and pay my commitment as I go (Right now AWS forces you to pay upfront to get the same discount (~50%))
You're locking in pricing, and opting out of both newer instance classes and future price reductions during that time period.
Generally, they're only useful for "that database we WILL NEVER MOVE," or if you're writing portions of your cloud spend as CapEx and want to amortize depreciation.
I used that exact same model in Conversion Rate Optimization - get your conversion rate up, give me 30% of what we improve.
And built that into a 20+ person digital agency billing millions of dollars a year before being bought out.
Exactly how I did that and you can to:
(1) Wrote topical, detail rich posts similar to the parent here about problems I was solving in CRO for a handful of customers, never disclosing confidential customer info.
(2) Marketed those posts strategically. EG I wrote one about "Which trust symbol gives you the highest return on conversion rate." and then literally just bought Google Adwords of people searching for that question! StackOverflow and other forums also are great ways to market by answering questions (free + put your details in contact info) or running ad campaigns specifically on those topics ($5k+).
(3) Turned the best performing / most viewed posts into "pitches" for speaking gigs at materially similar conferences, most were accepted and I became an "authority".
Every post / conference / etc had a little "Want us to fix it for you? Full service, performance fee model." banner or mention.
Work poured in after that and we were lucky enough to be very choosy.
If you can SAVE large enterprises money and are willing to do it on a performance basis you've got a business.
One of our customers bought the entire company to get a hold of the core team + essentially continued the "30%" deal as a long term incentive as convertible equity.
Was a good run, and reinforces my post of if you can bring measurable / substantial value to large enterprise companies amazing things can happen.
Large enterprise have fun accounting terms like "capitalizing an acquisition", eg they don't buy you out of cash flow. And can even carry debt on the purchase / incentive programs etc that not only make you more valuable to them, but create incentives for them to buy smaller companies.
Happy to answer any more specific questions.
Is it copywriting? Is it UI/UX? Is it analytics?
Or would it be fairer to say CRO is holistic, requiring a multitude of skills?
But started with very basic web design skills at first.
From the start key "skill" for the pitch / and our clients was we had the BANDWIDTH to focus on implementing testing as a regular / rigorous process for them.
EG most - even big cos - wind up with their good web dev resources completely tied up with 100 other things.
And 10 departments competing for their attention.
I came in and said we can do this, full service and you just have to approve the tests and give us a dev environment.
But started with just basic web design skills / willingness to read the multitude of good resources / books / blogs / thought leaders on CRO an apply their ideas.
EG - Common CRO theme - "try different, high-contrast button colors on your call to action"
Ok, I can do that.
- Take existing page
- set up optimizely or VWO (at the time we used home brew or GoogleWO!)
- make some really great buttons (or outsource on elance for $10)
- get client buy in
- set up the test
- ensure production readiness / testing
- go live
- provide nice reporting format for client weekly that lets them stay involved and see results, and have confidence in your ability to execute.
- prepare next test while first one is running, and remember that a huge % of your best ideas will fail, be agnostic to results but be statistically honest and educate clients under same process / instruction
Simple example, but you can ramp the complexity up from there.
Like "better to have this "sign up now" button go to another page w/form or pop a modal window w/form?"
and on down the list, the CRO blogs / experts / etc have 1000 ideas.
And over time got better about understanding what did / didn't work across clients.
So my win rate crept up from say 20% of tests significant win to 50%+ out of gate.
And every person on my team I hired because we wanted to run a test that I / we couldn't implement ourselves :)
What's your specific interest / skill set that you're trying to adapt over?
Would love to start freelancing this stuff but it seems like it needs so much personal branding
This turns into a fun parlor trick when I can estimate a client's bill based upon the story they tell me!
Gotta love the Australian dollar. The Australian economy is solid - about to set a world record for longest continuing period without recession, including the GFC years - but the AUD swings around like a mad animal.
Remember that he has to charge at least $1000 a day. He's more expensive than your entire bill.
In this case it's not "save us a few grand" that they're asking for-- the real ask is "help us analyze and forecast our spend as we continue to grow." Identify the knobs and dials that impact infrastructure costs, devise a costing model that states "each additional user costs $X to service," identify what makes sense to arbitrage between AWS and other providers / on-prem...
If I'm being honest, "lower the bill" is where it starts, but not nearly where it ends. :-)
That doesn't change that they don't have the funds to pay the fees though.
Something I've learned is that flat fee pricing makes the most sense-- while tempting, the other models are off-putting.
Hourly is a great way to starve to death, and "percentage of savings" grows difficult to quantify. "Okay, you just recommended the following reserved instance purchases. Is this really the best for us, or does it boost the number you're taking a percentage of?"
It's very easy to end up misaligned with your clients as you go down that path...
My bills are so optimized you wouldn't make a penny :p
For example, if I need 16GB of memory and 4 cores here are my options:
* AWS (t2.xlarge) $137.62
* OVH (EG-16) $79
* So You Start/OVH (SYS-IP-1S) $42
* Kimsufi/OVH (KS-3B) $29
* Hetzner (EX41) €46.41 [Lowest cost model is 32GB of ram]
* Joe's Data Center (No model name) $45 [Duel socketed L5420 which is 8 cores]
That's a crazy price difference and, unlike frmo what I understand about AWS, you don't need to pay for bandwith for most of these companies or they have some crazy high limit. IIRC it's common for 20TB to be the standard (FREE) bandwith limit. You're also on real hardware, not a VM.Unfortunately not all of these are perfect systems. There are issues with them. Some have slower CPUs, some have slower disks, some are in other countries but you can just pick the ones that suit your need for whatever you have to run. You can also use VMs that are far cheaper then these dedicated systems. If your workload is under 50% duty cycle on a CPU and under 4GB of memory you don't need a dedicated server. Buy a VM from one of these companies:
* RamNode (8GB SVZS) $28 [Fully SSD storage, very fast network]
* OVH (VPS CLOUD RAM 2) $22.39 [12GB(!) of ram and 2 vCores]
* Linode (Linode 4GB) $20
These are all VPSs but they will get the job done and are cheap enough that you can build something great on a budget.This is just from a few minutes of remembering when I had to buy my own hardware. I'm sure this isn't an exhaustive list. You can usually find information on the web hosting talk forums and on a site called low end box. I don't have links on hand but they're worth a read.
I would not want to host my business on So You Start, Kimsufi, Hetzner, and especially not Joe's Data Center. I have personally used Joes DC and they have had numerous outages in the past. Hetzner is known for terminating you for any sort of "DOS" like traffic, including high PPS. To add to that, those providers (except maybe OVH?) don't let you scale up and down with automated APIs.
1) Most problems can, but shouldn't necessarily be, solved with adding more servers.
2) SYS & Kimsufi are just OVH resellers. Same datacenters just the last generation of hardware under a different brand.
3) Hetzner is great for if you want to serve up content from the EU. Great ping times all across there. (Your friends over the pond will thank you)
4) OVH is a huge, and very reliable, hosting company. I don't think there's anything wrong with them. They also do supply such an auto-scaling API.
5) You don't necesarily need to run mission-critical systems on a traditional hosting solution to see big savings. Move your high-compute/high-bandwith programs onto a dedicated server and save big. This is really great for batch analytics type systems where after a day of operation, you dump a backup file and want to pull some data out of it for the morning. It's great for dev systems and thousands of other non-mission-critical systems.
One of my clients on a dedicated server has never gone down. The site is blazingly fast, barely touches 5% CPU and pages have sub 50ms response times. Deploys take 10 seconds or so, I could make it faster but it's not really worth the cost/benefit.
My client on Azure, with a significantly lower visitor count, pays 3-10 times as much, the site is sluggish, takes a long a time to spin up after deploys, hangs ocassionally, we've caught the whole site being offline a couple of times then it mysteriously starts working again with nothing in the logs, had a deploy to one site take down other sites and on top of that there's a 3-5ms delay between the database and website which causes all sorts of performance problems when a page makes too many DB requests.
They've had to "scale up" to premium database in the past to handle loads I know a much cheaper dedicated server would have handled without even thinking about it.
On top of that, Azure's management portal is super slow, regularly fails to execute commands and is incredibly frustrating to navigate and use.
The claimed machine you get on cloud aren't anything like as performant as supposedly similar machines on dedicated.
I'll admit I've generally found AWS to be significantly better than Azure, but still very expensive.
And AWS went down a couple of weeks ago too.
Yea that's something I don't get too. With all of that IPC going over amazon's network for all of their services how much time are programs wasting sending and waiting for messages from other amazon services?
I never really thought about that. If someone could measure this it would be interesting.
We have a test page that runs 100 "SELECT 1" SQL queries ON THE SAME CONNECTION between an Azure website and an Azure database and it takes a whopping 250ms to complete at best. That's literally all it does. And their infrastructure is so bad that it'll vary from 250ms to 600ms in the space of 20 seconds in peak periods. That's damning, cloud infrastructures are there to part you from your cash, nothing more.
It's ridiculously bad, in my opinion no professional should EVER recommend Azure. My client is enamoured with telling people the system runs on Azure, with its "secure" network, nothing I've told him makes a difference, but he'd have a much better service if he moved it off Azure.
Because we develop with the entity framework it's quite easy to muck up and forget an include or two and then suddenly the queries spawn a hundred or two hundred basic SELECT queries to populate a `Order.OrderItem` or something as trivial. On a standard dedicated server setup or even your worst 5 year-old crappy dev laptop that's a ms or 2 extra, but on Azure it's performance death.
There are advantages to using Azure, I admit, the easy deploy from github for example, but that's more because setting up deploying from a repo to IIS is such a bad workflow at the moment and the IIS management too. They don't want to make it easy. With other clients I've setup moderately complicated deployment scripts, and once the initial work is done, it's much better than Azure, you run a bat, boom, deploy much faster than Azure manages. 10-20 seconds without even pre-compiling the pages, Azure will take 5 or 10 minutes to finally get round to doing it and woe betide you doing it at peak times as it will use up your memory allocation and simply hang for 20 minutes while you frantically try and restart it while the azure management portal has a massive spaz (yes, we unfortunately deployed a serious bug, fixed it, tried to re-deploy while under heavy load, cue website down for a ridiculous amount of time while their management portal threw a ton of weird and inscrutable errors before we finally managed to restart it).
One of your clients... where? Without even giving a location, this doesn't even qualify as 'anecdata'.
You can choose to run your DB servers on top of generic compute instances in Azure or any other cloud provider. You aren't stuck using their database services.
> The claimed machine you get on cloud aren't anything like as performant as supposedly similar machines on dedicated.
This is true, I don't think anyone will dispute that.
With Amazon you have so many options when it comes to storage, compute power, load balancing... They have a huge portfolio of products and you can get everything in one location from one vendor.
It used to be different, but today their most important offerings have open source equivalents. They are essentially off the shelf, because for your own projects there is no need to care about abuse or noisy neighbors. Most importantly, though, it's going to be cheaper and you still will be able to use cloud where it shines.
Seriously? What about S3, RDS, VPC, IAM? The engineering $$$ (in time) to set up and maintain open source equivalents of these would not be cheap.
Fortunately, we cache everything (including failures) with Redis, so the actual cost is tiny at most, but if you are not caching failures as well as successes, this can result in unexpected and really hard to track down cost spikes. (disclaimer: AWS cert SA, AWS partner)
Segment's trick to detect and record when throttling, and using that as a template for "bad keys" (which presumably are manually validated as well) seems like a great idea as well, but I'd suggest first caching even failure calls on logins if possible, as that probably would have mitigated the need to ever hit dynamo.
PS the name 'project benjamin' for the cost cutting efforts.. pure genius.
Few months back I have start a company for that exact purpose : helping you decreasing you AWS bill. https://wizardly.eu/
The focus is around reservation, unused resources and tracking cost evolution on a day to day basics.
I don't get that much traction ( I'm not a marketer and it's my first SaaS project, still a lot to learn in that area). I'm looking for more users feedback, if you willing to invested few minutes in my project that would really helpful. It's also completely free now.
As the article say, their is no silver bullet. Specially if you need infrastructure changed. But it's possible to have an interesting cut by using all the AWS pricing options.
Making teams aware and responsable of their costs is also making a big differences. Often, people creating and managing infrastructure have no view of what it is costing for their company.
My gut feeling is that you have to get to an extraordinary size to realize any meaningful savings, but that's primarily based on Dropbox's migration off AWS (https://www.wired.com/2016/03/epic-story-dropboxs-exodus-ama...).
It depends on what your service looks like: CPU intensive, Memory Intensive, Storage intensive? (In reality some unique mix).
You probably won't see a huge savings year one, as you'll be spinning up a lot of new things and have a fairly large CapEx expenditure. Now if your growth pattern is steady/predictable then you should be able to plan out your hardware buys or do a hybrid solution to handle traffic bursts.
One of the nice things about running your own hardware is that there are some costs that are easier to control. Don't need new hardware? Don't need to spend on new hardware for example.
You also have much more control over your environment so you are able to really optimize your code, and infrastructure so that you don't need to scale as large system wise.
But, back to the question on how to model it? You just gotta dig in, and make some educated guesses about performance,test and repeat.
As a for-instance, I was asked this exact question a year or so ago about an on-prem object store instead of S3.
The break-even price to go multi-region was ~15PB on paper; that included DC space, hardware, software (build vs buy was another factored discussion), and the staff to run it.
That assessment was delivered with the caveat that their uptime was not going to approach S3's by any stretch of the imagination-- and their infrastructure outages weren't going to sync with "most of the internet's."
It's a complex topic, and there are many hidden costs...
The entry cost is £500 per day or $1000 for an engineer.
5 hours on the phone to find the hardware and agree on the order with DELL + an afternoon with customer support because they shipped the servers without hard drives + your project is delayed by an entire week because you don't have the resources => 1 day + 1 day + half a week.
These things would have been 5 minutes on a cloud.
Much of what allowed us to implement these savings quickly with a small team was the flexibility afforded by cloud infrastructure. Poor decisions are easy to reverse, but in a bare metal world you better be damn sure what you're doing, which slows down the decision-making process and seriously complicates experimentation. The number of people who know how to build out datacenters at the scale of thousands of machines is vanishingly small.
We'd also need to replace IaaS services like ECS, ELB, ElastiCache, RDS, and DynamoDB. There are certainly off-the-shelf replacements, but we'd need to build-out the expertise within our teams to operate these systems. We're talking roughly a dozen or so engineers working full time for many, many months to get these systems in place from scratch, on top of the even larger effort to design and build out datacenters. I'd much rather plow those cycles into efforts like expanding to multiple regions and improving reliability of internal services. That's a much better return on investment for our customers.
Right now we're in the sweet spot for the cloud. We're way too big to run on trivial amounts of hardware, growing at a rate that makes it difficult to stay ahead of demand in a datacenter-centric world, and too small to justify investing in a scalable hardware build-out.
+1. If your entire environment is steady-state, it may be worth considering a migration to bare metal.
That said, you can expect:
* Worse uptime
* A fair bit of retraining / hiring different skillsets
* A loss of engineering focus as they work on the migration instead of feature expansion
It can make sense economically, but that discussion goes well past "the monthly AWS bill."
http://firstround.com/review/the-three-infrastructure-mistak...
Keep a look on your bill because you don't want to run anything. But take advantage of having no hassle for your first years.
Disclaimer: I am NOT affiliated to Google in any way.
You might have to stub out some things using e.g. Cassandra or another open source alternative; just use a Docker or VM image without the production redundancy.
You did admit, that you have no idea how much performance is being dropped on the floor due to not using dedicated hardware. So why not test it?
My belief: you would find you are paying AWS far more than they are actually worth.
Your post seemed to indicate that you hadn't done any calculations for the bare metal server with your own vms scenario. But clearly you have, if only mentally.
Business rule => You gotta optimize for your cash cows. ;)
"Monthly Tracked User, or the sum of logged in plus anonymous users that access your product in a given month. "
P.S. I understand that you have volume discounts.
That's great, but now I'm wondering how many engineers were paid for three months of full time work to save $1 million/year on AWS, and how much it costs the company to pay those engineers for 3 months.
It's also interesting to wonder about how much growth your startup could have managed if it had had three additional months of work from those engineers.
Maybe I have a different view, but I've been avoiding running the same service on the same instance. If I'm running multiple services, I'm doing it for HA, and if an instance goes down, you could lose all your services. Why would you run the same service on the same instance?
A shameless plug is I built a small visualization for the AWS detail log to help understand the cost drivers. All it is loading the data and visualizing it across a few dimensions but might come in handy for others - https://github.com/dangoldin/aws-billing-details-analysis
the rest of the article was fine.
Shameless plug: https://trackit.io/
I only recently started working (and web browsing) from an enterprise network, so maybe this has been done before, but it's my first time seeing it and I thought it was really interesting.
Edit: To be clear, I'm not intrigued at the little guy himself, I'm intrigued at how personalized it was.
I went back and clicked on it this time and it then says "Our scoring models shows (company name) could be a good fit for our business plan. Want to schedule time to learn more?"
You're right it's Drift. I'm the CEO. Love working with Segment, Mixpanel, Clearbit and other great companies to deliver a personalized experience on their sites like in this example.
Challenge: there's a race condition because the enrichment & scoring takes a little while, but the chat widget checks the drift database at the same time.
Source: I'm part of the team who built this @Segment
From the link. It seems unlikely that people would/could build applications in the modern world from scratch in assembler. Start with reimplementing the entire HTTP parsing engine and go from there? No thanks.
I have a very basic "Docker 101" question here.. Can someone explain how you might get to >100 containers on a given instance? That seems to imply that there are multiple containers of the same microservice running on one machine. Why would you pack duplicate containers like that instead of using one larger container?
Microservices that are scaling horizontally to handle concurrent requests, etc.
Depending on how seriously your architects take the "micro" in microservice, you may easily get to 100+ unique microservices/processes each running in their own Docker container.
"You cannot run two containers of the same service on a single host because they will collide and attempt to listen on the same port. (no bin packing)"
So, what's the sense in doing that instead of one bigger container?
It definitely depends on the use case, but I could imagine more, smaller units allowing for more granular (and therefore a bit more cost-effective) scaling.
I wonder how it felt when they discovered how much money they'd burned on such a dumb little bug. I'd feel like throwing up.
- buy a SaaS company which hosts all its infra on the cloud
- move everything to bare metal
- double the company's margin
- profit
I'm surprised not more people are price/performance sensitive. My goal is to get a system up to 10K table inserts/second on a free Heroku instance, we're already doing on low end hardware 1750 table inserts/second across a federated system. But price tuning is one of the most important things when engineering for high load, as well.
Glad to see articles like this. :)
One thing I'd like to see in the future is scaling actions that supported multipliers, as well as metric math support (scale service to request_count/acceptable_requests_per_service).
We settled on constant increases/decreases using queue depth thresholds but ideally ECS would support feeding multiple metrics and doing some basic math to figure out how much we're currently process, how long it would take to flush the queue, and how many more containers we need to drain in a timely fashion.
ECS is pretty dead simple (just run an agent on the host) and while it doesn't offer nearly the same feature set, it's really good operationally.
Some people here are tinkering with it for some non-core services.