Scaling your PHP application with dedicated service nodes

Launching a new application on Amezmo starts off with you providing a domain name of your choice and a new database password. 30 seconds later, you have a full-stack Ubuntu 16.04 server with all the system software configured for you. By default Amezmo installs the standard stack for running a modern Laravel/PHP/Symfony application. Side note: This all happens on Amezmo, so you don’t need to bring your own cloud. Pricing for Amezmo includes server costs.

  • PHP 7.2
  • Redis
  • MYSQL
  • Nginx
  • PHP-FPM

After your server is created, you can the import your application through GitHub. Amezmo has integrated with GitHub so you can easily view your list of repositories from the Git tab on the dashboard. Importing your code only takes a few moments. If you’re thinking, but what about my dependencies, then I have great news. Amezmo has built an extensive hooking system allowing you to run, for example, composer install, among other things. Here’s an example deployment hook and it’s output from https://demo.amezmo.com

PHP Deployment

Scaling

It’s really easy to get started on Amezmo, but what’s next? What if you wanted to scale your application. I also have these same thoughts. Dedicated Nodes are the way Amezmo will solve the scaling problem. The idea is that after you import your application, you’re going to want to horizontally scale out. For example, instead of hosting the database on your HTTP box, you’d want to host the database on a separate, dedicated instance where nothing else is running.

Another use case are PHP Workers. Let’s say we have some background processing requirements. We don’t want to run these works on our front-end box because we do not want a worker taking up memory and CPU resources away from our actual users using our dashboard. Amezmo provides a very simple way for you to spin up “Worker nodes” dedicated to background processing. To be more abstract, Amezmo provides an instance type that you can attach to your primary application server via a private network. In this instance you can run your worker daemons, or any other process type that is long running.

Amezmo handles the daemonizing of your PHP workers for you via Supervisord – You’ll be able to bring up or down these worker nodes without affecting your front end application. The best part about this is everything is automatic. Your worker code, will have a mirror copy of your repository that you imported and it will be running the same exact code as your front end, so directory paths will not change.

Learn more about deploying your application on Amezmo here.