Heroku Isn't for Idiots: developer time and comparative advantage
rdegges.com
rdegges.com
A lot of time spent debugging this custom stack that was supposed to be seamless.
Another client was (boxes running on a hosted server provider),using Erlang, Riak, some Rails, deployed w/Puppet. Comparable data volume; similar "Rails w/Dynamo" architecture, but -- much, much less magic. Much smaller operations bill, less time spent working around cloud platform issues, like inconsistent IO, expensive Amazon charges, lack of visibility into what is happening behind the scenes, etc.
In some cases, Heroku is great; for us, particularly prototyping. But it's not always so clear when it's better to just boot some boxes and deploy some puppet or chef.
What!? Swap is considered equivalent to RAM?
From my experience, a single Heroku dyno performs better than a micro EC2 instance (613 RAM) but significantly worse than a small EC2 instance (1.7GB RAM). The first Heroku dyno is free, making it ideal for small sites, but as soon as you want to add anything outside of Heroku's sandbox, the prices are extremely inflated compared to AWS. For instance, adding an SSL cert to a Heroku app is $20. A small EC2 instance costs as little as $17.69 a month with 3 year buy-in (this is the average monthly cost with a 3 year heavy utilization reserved instance). Even if you pay monthly for an on-demand instance ($57.60/m) it's still much cheaper than Heroku considering you can comfortably run several services such as Redis, PostgreSQL, and Resque workers alongside your app. Each of those services will cost extra on Heroku.
Of course, the trade off is the relative ease of deployment. Heroku is the easiest place to deploy, until your app grows more complicated. AWS is 2nd easiest, until you need even more control over hardware configurations. The most difficult deployment is on your own hardware, but it should also be the cheapest option.
I was consistently hitting the 512MB "limit" immediately, even with lightweight processes (not sure how tbh), and I frequently would see processes complaining that they were at 450% or more of their memory usage.
I'm pretty confident that Heroku virtualizes EC2 instances which potentially makes them more resource strapped than they appear.
Combined with limitations in how their dyno instances work, like the inability to have more than one slug version deployed at once to take advantage of Heroku's routing fabric for hot-deployment, I only recommend Heroku for early-stage systems. Thankfully it's not very hard to migrate off of and still offers an awesome time savings in the early stages - it's just not something to build out on IMO.
How were you monitoring the memory? Oo
I'm curious to know as I actually run a ton of stuff on there, and haven't had any sort of memory issues (even with high usage background tasks).
Right now they have to provision an ELB to sit in front of your app to gain that extra IP.
The cpu specs are disingenuous as well. A heroku dyno may run on an intel xeon cpu, but I would never say a dyno "has" a 4 core cpu.
Sorry if that gave off the wrong impression :o
In the interest of choice and healthy competition (and also in my own selfish interest, per the disclaimer above), I will point out that the arguments in this article apply to all good PaaS providers, of which there are plenty. As an insider in this particular crowd of vendors, I can tell you that the competition is fierce and it is entirely focused on delighting hackers - a trend which everyone here should be excited about.
- cloudfoundry.com/appfog/stackato/tier3 are competing deployments of the cloudfoundry open-source project by VMWare
- phpfog, pagodabox, orchestra: php-only
- engine yard: ruby-only, also the leader in revenue, probably by a wide margin ($28m)
- dotCloud: first multi-language paas, with a bunch of database services as well
- Openshift: previously Makara, now part of Red Hat. Also available open-source
- Djangozoom: django-only
- Nodejitsu, nodester, no.de: nodejs-only
- Cloudbees: Java only
- Azure: solid .Net stack, impressive database service. Didn't use it directly but I've heard it's a great product.
- AppHarbor: an alternate .Net provider
- App Engine: much more restrictive than the others, but super cohesive and a great product if you don't mind the straightjacket
phpfog is now appfog, and is cloudfoundry based. djangozoom is now appsembler also cloudfoundry based.
all of the cloudfoundry based systems are multi-language, multi-db capable.
openshift has no makara code remaining. its a fresh impl. its basically a simpler version of cloudfoundry. also multi-language, multi-db pass.
Heroku is great if you can fit your app within the free tier and great if you're happy to spend a few hundred bucks a month, but in between those two I'm often better off with on or two $20/month 1GB VPS.
"Heroku is Just Unix"
No. Heroku is not "Just Unix". This statement is completely 100% wrong. To claim that what Heroku or any other PaaS does is "just VPS" or "just Unix" is so far off. People vastly underestimate how difficult it is to run a PaaS and how much technology it takes to pull it off at scale.
I speak from experience, having built one PaaS from scratch and having used CloudFoundry to build a second one. The technology to get "just unix" into a fully managed, n-tier, scalable system is incredibly complex.
I have heard people complain that CloudFoundry is overly complex, but these people judge a piece of open source code that does something that for so long has been hidden behind the curtains. Heroku is at least as complex if not more so, you just never see that part of the equation because you don't have to.
Well, I'll take the blame for this one. I often say this (in a positive light, which I believe is shared by the article) as someone who works at Heroku, and I think I said it to someone else (who had not used Heroku) while in the author's presence; other people might say this as well. The reason I say this is because a lot of people expect a lot of unique APIs or locked-in ways of doing things on Heroku, and it can be quite a while -- if ever -- before they find "heroku run bash" and sort of understand how little magic there is that they have to put in their application.
For some people, it makes the idea of getting on and off the platform less scary. I also happen to like that my local machine models the remote environment in broad strokes quite closely.
Anyhow--you're totally right. Heroku is definitely not 'just unix'. I really meant this in a different way than it may seem in the article. I was trying to get the point across that there's really no vendor lock-in, you can easily port your code back and fourth from a physical box or vps to Heroku, with almost no delay.
Thanks again! Incredibly awesome to actually talk with you ^^
It all boils down to the metaphor, and the language that supports it:
PaaS borrows from the Unix metaphor of deployment with primitives like processes, executables, virtual filesystems, sockets and stdout/stderr.
IaaS borrows from the hardware metaphor of deployment with primitives like images, block devices, OS installs, firewalling rules and load-balancers.
The premise of PaaS is that, in a large and growing number of cases, as a developer the Unix metaphor requires less of my time, it maps my day-to-day experience better (As fdr pointed out, the remote platform behaves the same, roughly, as my laptop), and I don't actually need control over the underlying hardware.
Right now I'm running my games on Google App Engine and hosting is about 10% of gross. (Don't know if that's good but it's fine by me). For me, scaling means going from 3 or 4 instances to 20 or 30 in busy times. This all "just works" and I don't have to really do anything.
I've been looking at Heroku because I've been working a little in node and there are some significant advantages to having js on the client and server. (rather than python on GAE)
I was under the impression Heroku would just work too. I may not be an Idiot, but I sure am a n00b.
Is Heroku not for me? Should I stick with App Engine?
1. Rent a cheap box at http://hetzner.com (32GB RAM/59€ per month; 64GB RAM/109€ per month) or http://OVH.ca/.
2. Install Proxmox VE 2.0 from http://proxmox.com/products/proxmox-ve Create virtual instances via RESTful API on demand: http://pve.proxmox.com/wiki/Proxmox_VE_API
3. use chef or puppet.
=> unbeatable price/value and it's up to you if/how you lock into technologies/abstractions/dynos/...
http://reliablesite.net/v4/ their twitter account has big discounts
maybe only 4x more expensive, and they don't charge a monthly fee for a private network.
If you need speed it will cost you more for 15K SAS disks w/ a sizable battery backed RAID controller, but it will be worth every cent.
You don't want to put too many VMs on them or you'll quickly go through your IO bandwidth.
This is the problem so many devs don't understand. You run out of IOPS for your DB and your app is going nowhere. Managing storage in a reliable, fast and cost effective manner isn't easy.
Consumer SSDs are starting to change that, but you will be still struggling to find many dedicated server offerings backed with SSD storage, and there are still questions about long term reliability (4 years or so) which is typically the period your leaving hardware provisioned for to pay it off.
You'll have to know precisely what you want/how to configure the machines, but otherwise its perfect. Exactly what oyu'd expect for unmanaged hosting.
Incero.com
Mind you its all a compromise, if you know that disk IO isn't a factor for your application then servers like that are ideal. I just won't run a large database on it without something like MySQL Cluster using a Memory table. It would require 2 servers, but REALLY good performance, good reliability (just get 2 dual PSU servers in different cabinets).
Most of the arguments against running a dedicated server was a straw man argument. YES High Availability is expensive if your talking an app that fits on a single server, but once you can get most services running with a N+1 reliability making it substantially cheaper.
>His harddrive / memory / NIC / etc fails?
Most dedicated hosting providers have an SLA to replace. Rackspace is 1 hour. If this SLA isn't suitable you setup a cluster.
>He accidentally runs OS updates, and breaks versions of his packages?
Welcome to backups... you should have them. Yes its expensive, yes its a pain in the arse... but you should have them anyway even if your on heroku. Lets be professionals here.
> He wants to instantly rollback to a previous release of his codebase?
Welcome to code deployment tools... Just because your not on heroku doesn't mean you can't have them
>He wants to add another server to handle incoming HTTP requests?
Its called resource planning... You know what those pretty little graphs are for. Again you should be doing this regardless of the service you are on.
> He needs to spin up a database read slave to handle a high amount of read requests?
See capacity planning.
> His load balancer fails?
Fail to wire modules, Clustered load balancers, virtual load balancers on a cluster... many options
> His Fabric script stops working because he renamed his project or reorganizes his application directory tree?
Testing... read about it... It really helps. You can also mess up any codebase by messing with the directory structure and not testing.
> Or one of an infinite amount of other possible problems?
Ok... and Heroku has a bunch of other problems.
edit: fixed typos and Load balancer quote
I don't know shit about load balancers. It's a hole in my knowledge. Eventually, I'm sure I'll get there. But I'm really glad I don't have to learn it right now. Because honestly I have my hands full putting out other fires without having to think about it.
I should be able to glue together my own cloud-based load balancer, deploying my app to webservers on different continents, with a monitored master-slave database set up -- all with freely available open-source software tools.
You still have to implement in app load balancing but this is easy via Hook.io, by the same group.
OpenShift is Redhat's open sorce PaaS. Ruby, node, python, java, php, etc. They run a free service on top of AWS, and you can deploy it on top of AWS, rackspace, hp, or anywhere on top of fedora or RHEL 6.2.
CloudFoundry - overblown, complex design. very heavy making it hard to test and contribute
Openshift - too redhat-centric
Heroku is completely closed source, you can't evaluate for complexity or design, you could never test or contribute to Heroku source code.
I'm curious what Heroku still does that CF can't.
As another person who is building infrastructure on Cloud Foundry like Lucas, I am biased, and don't quite agree with you.
I think from a user perspective, you can do as much with CF as Heroku.
Architecture wise, you can't compare CF to Heroku because its closed source. Heroku could be even more overblown and complex than CF for all you know. And even then, a PaaS by nature is sort of complex.
Administration wise, CF still has a ways to go. It isn't the easiest to deploy and manage, docs need work, etc. But that isn't something that is user facing or comparable to Heroku.
I'm curious what parts seemed overblown or complex?
Anyone have an example of a simple NodeJS worker dyno? The web one is easy, now I'd like to see the other. I've been searching around and haven't found any good examples. Thx.
You can have like, 5 masters, with 5 readslaves each, etc. It's super awesome.
First, please don't abuse the free databases. Second, the free "dev" plan does not support fork or follow, nor do we plan to support those features on that plan in the near future.
Worse, heroku asked for credit card info for account validation, and I never expected that I would be billed when using the free tier service, even when spinning extra dynos. I opened up a ticket and they said that they would look to improve this some point ahead.
Luckily, I only use "virtual" credit cards (specially for "validation" purposes) and mine was expired before I was billed.
This person has obviously never touched Chef. Chef's learning curve is steeeeeep.
git push heroku master FTW!
"I can just set up Jenkins" is the CI equivalent of the behaviour the OP rants against. And you're right, if your time is free. But it isn't free, and just like Heroku handles your security, scalability and lets you get back to work, so too does hosted CI handle machine setup, test speed, optimization and parallelization, without having to manage it all yourself.
Long story short, developers significantly undervalue their time (and sometimes their bosses do too).