Hacker News new | ask | show | jobs
by twobat 2396 days ago
Why did try to scale when you had no customers?
2 comments

I guess I wasn't perfectly clear. The technology was to scale the customer's wordpress installation when certain metrics were met CPU or RAM > 75%, clone droplet and load balance.

The technology was basically an a beefy server for NFS, a beefy MySql server, and a beefy load balancer. When you started hosting with us, you paid $50+/mo and got what felt like a standard WordPress install on a dedicated digital ocean droplet, when metrics showed that you were hitting the scale threshold, we would create a new droplet run an initialization script to mount NFS, set up the nginx server, and then attach it to the loadbalancer.

When the combined CPU or RAM droped below the initial scale threshold, it would drop one VM from the load balancer at a time keeping it provisioned for an hour in case it needed to scale again.

Worked amazingly well. Sure the load balancer was a single point of failure, but in the 10 or so months that it was running, we never had a second of outage based on pinging the websites.

Now that is very cool! I've always wanted to try something like that.

What was it written in?

The main application I left hosted at Azure. It was an ASP.Net MVC app.

I used the Digital Ocean API to provision infrastructure, and SSH to remotely login and run the initialization bash script. The init script configured nginx, NFS (maybe it was SMB, i dont rmember now), a cron job to minutely heartbeat statistics back to the MVC app.

There are so many better ways to do it now, though. Off the shelf load balancers with letsencrypt and an api, hosted dns, managed & clustered databases, monitoring api. It would be a lot simpler today than it was just 2 years ago, let alone 7.

These days you can do it (relatively) easily by using wordpress docker image on kubernetes (or any other container platform). e.g. using Traefik for load balancer, a mysql container or an external mysql db instance (aws, google and do now offer managed mysql), and storage provider that can be mounted from multiple nodes (nfs, glusterfs, ceph, etc) and you're done! You can throw in an sftp container that mounts /var/www so you can manage the wordpress installation using an sftp client.
If you want to offer a completely automated process, auto-scaling is important. Otherwise it'll fail as soon as the first customers come in.