author Jake Morrison

I have been looking into the best way to deploy Elixir in the cloud. As part of that, I have been building various AMIs with only the minimum needed to run an Elixir app.

Nerves is a framework for building embedded systems in Elixir. Instead of running a general purpose …

author Jake Morrison

The goal of benchmarking is to understand the performance of our system and how to improve it. When we are making benchmarks, we need to make sure that they match real world usage.

In my post on Benchmarking Phoenix on Digital Ocean, changing the concurrent connections and network latency had …

author Jake Morrison

This is a gentle introduction to getting your Phoenix app up and running on a $5/month server at Digital Ocean. It starts from zero, assuming minimal experience with servers.

author Jake Morrison

Just for fun, I decided to benchmark the performance of the elixir deploy template running on a $5/month Digital Ocean Droplet.

Following Saša Jurić's post, I set up wrk on my Mac and on some Digital Ocean instances in the same data center.

I made a simple request function …

author Jake Morrison

GenServers are the standard way to create services in Elixir. At it's heart, a GenServer is a separate process (thread) that receives messages, does some work, manages state, and sends responses back. If that's what you want, great. It's important to recognize, though, that a GenServer only handles one request …

author Jake Morrison

Figuring out how to deploy your Elixir app can be confusing, as it's a bit different from other languages. This post describes how we deploy apps with the reasons behind our decisions.

We have created a working example template which puts all the pieces together to get you started quickly …

author Jake Morrison

Database migrations are used to automatically keep the database in sync with the code that uses it. Elixir apps should be deployed as releases, supervised by systemd. Here is an example of how to run migrations when deploying Elixir releases.

It's tempting to automatically run database migrations when the app …

author Jake Morrison

We normally deploy Elixir apps as releases, supervised by systemd.

After we have deployed the new release, we restart the app to make it live:

sudo /bin/systemctl restart foo

The user account needs sufficient permissions to restart the app, though. Instead of giving the deploy account full sudo permissions …

author Jake Morrison

When your app is running behind a proxy like Nginx, then the request will look like it's coming from Nginx, i.e. the IP will be 127.0.0.1. Similarly, If Nginx is behind a CDN, then all the requests will come from the IP of the CDN.

In …

author Jake Morrison

It's common to run web apps behind a proxy such as Nginx or HAProxy. Nginx listens on port 80, then forwards traffic to the app on another port, e.g. 4000.

Following is an example nginx.conf config:

user nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid …