Working with Elixir?

GenServer timeouts or Phoenix LiveView misbehaving? We bring it back.

Elixir code that worked for years can start timing out the day the traffic shape changes, because one GenServer became a bottleneck and the supervisor just keeps restarting it. We trace the mailbox, redraw the supervision tree, and leave Phoenix or the embedded system running the way the BEAM is meant to.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

phoenix-error.log

still failing

What it is

Elixir at a glance

Elixir is a dynamic, functional language that runs on the Erlang virtual machine, the BEAM. It was created by Jose Valim and first released in 2012. It inherits Erlang's processes, message passing, supervision trees and hot code reloading, and adds a modern syntax, polymorphism via protocols, and the Mix build tool.

Phoenix is the dominant web framework for the language, with LiveView delivering server-rendered interactivity over a WebSocket and Phoenix Channels powering realtime features. Elixir is a common pick for chat systems, IoT backends, realtime dashboards, telephony switches and APIs that need to hold tens of thousands of concurrent connections per machine without heroics.

Type
Functional, concurrent language on the BEAM
First released
2012
License
Apache 2.0
Maintained by
Jose Valim and the Elixir core team
Typically used for
Realtime web apps, Phoenix LiveView frontends, chat systems, IoT backends, telephony, high-concurrency APIs

The honest version

Elixir pros and cons

No technology is all upside. This is where Elixir earns its place and where it tends to cause trouble.

Where Elixir is strong

  • Concurrency as a first-class ideaLightweight BEAM processes, message passing and selective receive let a single node hold hundreds of thousands of concurrent connections without thread pools or async hoops.
  • Supervision trees for genuine fault toleranceA crashing process gets restarted by its supervisor, state gets rebuilt from its sources, and the rest of the application keeps serving traffic. Reliability is a first-class design primitive.
  • Phoenix and LiveViewServer-rendered interactivity over a WebSocket gives most of what a single page application provides, without a separate frontend codebase. Latency on a warm connection is well under a hundred milliseconds.
  • Ecto is a thoughtful data layerChangesets validate and cast at the boundary, queries compose into database-agnostic Ecto.Query, and migrations run through the same Mix tooling as the rest of the project.
  • Observability from the ground upTelemetry, LiveDashboard, observer_cli and tracing primitives let you inspect a running production node without adding agents. Few ecosystems make live introspection this comfortable.
  • Deploys with mix releaseA single tarball with the runtime embedded, no Erlang install needed on the target, systemd scripts generated for you. Production deploys stay close to simple.

Where Elixir bites

  • Hiring takes patienceDevelopers with production Elixir experience are not thick on the ground. Teams build fluency internally, which takes a quarter or two before pull request reviews feel confident.
  • The library ecosystem is smallerMature packages exist for most needs, but niche integrations are often a Hex package with two maintainers and a last release six months ago. Writing your own is common.
  • Macros and metaprogramming are powerful and sharpdefmacro, use and __using__ callbacks give libraries a way to inject code that can be hard to trace. A badly behaved macro produces errors that point nowhere useful.
  • Deployments differ from mainstream languagesClusters that use distributed Erlang, hot upgrades and the OTP release model need operators who understand the BEAM. A standard container platform works, but you lose some of the point.
  • Hot code reloading is a trap in most setupsThe capability exists and the docs describe it, but most production teams never configure it properly, and the first time someone tries it on a live node something unexpected breaks.
  • Ecto changesets are their own idiomA developer coming from ActiveRecord or Django's ORM has to unlearn habits. The payoff is real but the first week of pull requests tends to argue about where validation lives.

Sound familiar?

Common Elixir problems we fix

The Elixir problems that bring people to us, and what you have once each one is fixed.

** (exit) exited in: GenServer.call(..., 5000)

A GenServer is timing out under load

A single process has become a bottleneck because every request goes through it and its mailbox is growing faster than it can empty. A pool or a different ownership model fixes it, not a longer timeout.

Work shared across processes that can keep up

max_restarts=3 within 5s

Supervisor is giving up

A process crashing on start, which trips the restart intensity and takes the parent down with it. The crash is a bug the restarts have been hiding until the rate finally exceeded the limit.

Cause of the crash fixed at the source

** (DBConnection.ConnectionError) request was dropped from queue

Ecto pool exhausts under traffic

A pool sized for a demo workload, slow queries holding connections for seconds at a time, and new requests queueing until they are dropped. The pool needs to be bigger or the queries need to be faster, usually both.

Pool sized, queries shortened

Phoenix.LiveView.Socket terminating: :closed

LiveView sessions drop without reason

Clients behind a reverse proxy with a low idle timeout, a mobile network that kills the WebSocket on backgrounding, or a telemetry handler raising and taking the socket with it.

LiveView connections stable across environments

Ranch listener dropped connection: :emfile

Node runs out of file descriptors

A traffic spike or a connection leak pushing the BEAM past the operating system ulimit, which drops new connections at the Ranch listener rather than inside Phoenix.

Limits raised and leaks closed

** (Ecto.ConstraintError) constraint error

Ecto changeset missing a constraint

A unique or foreign key constraint on the database that the changeset does not declare, so the error reaches the user as a 500 instead of a form message.

Changeset handles the constraint cleanly

connection not available and request was dropped

Clustered deploy drops traffic on rollout

A cluster that loses capacity during a rolling restart because nodes come down before draining, or because libcluster takes a moment to reform a healthy mesh.

Deploys roll without losing requests

handover: no release, no docs

Phoenix app from a departed developer

A repository without a release config, environment variables nobody wrote down, and a database that may or may not be the same shape as the schema in version control.

Reproducible builds, documented ops

What we do

Elixir help, from rescue to steady operation

Reach out about one timing-out GenServer, or hand over the Phoenix application and we take it from there.

Rescue
GenServers timing out, LiveView sessions dropping, releases that will not boot. We stabilize production before investigating what the supervisor was hiding.
Phoenix and LiveView
LiveView mount and event flow, Channels at scale, PubSub topologies and the asset pipeline tuned for Phoenix 1.7 and up.
Supervision and OTP design
Supervision trees reviewed, state rebuilt from the right sources, GenServer boundaries drawn so no single process becomes the bottleneck for the whole app.
Ecto and database work
Pool sizing against real traffic, query performance, constraint-aware changesets, migrations that run safely on a replica-promoted production.
Clustering and deploys
libcluster topologies, mix releases, rolling deploys that drain cleanly, and distributed Erlang set up so cross-node calls do not fail under partition.
Managed Tech
Steady work on Elixir and OTP upgrades, Hex dependency updates, telemetry dashboards, and the weekly pass that keeps supervision trees matching what the application actually needs.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Elixir alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Elixir questions

Something else? Call+1 737 727 7327

Why does our Elixir GenServer keep timing out?

Because every caller is funneling through one process and its mailbox is piling up. The 5000 ms default on GenServer.call is a symptom, not the disease. We look at whether the work in that process can be split into a pool, whether some of it can move to Task.Supervisor, and whether state belongs on the calling process instead. The answer is architectural rather than a bigger timeout.

How do we keep Phoenix LiveView sessions alive on flaky mobile networks?

Three pieces usually get it right: a WebSocket path that does not sit behind an aggressive reverse proxy timeout, a reconnect strategy on the client that holds state briefly on disconnect, and an idle timeout on the server that matches what the clients actually do. We tune each layer and test with real device switches between networks.

Should we move an existing Node or Ruby service to Elixir?

Only when the workload actually benefits. Elixir shines at realtime, long-lived connections and many-process workloads. For a standard CRUD backend the gains are smaller than the hiring and training cost, so we usually recommend keeping the current stack and extracting the realtime piece into Elixir instead of a wholesale rewrite.

How do we deploy Elixir to production safely?

Mix releases produce a tarball with the runtime embedded, which is the simplest path and runs comfortably on a container platform. Rolling deploys need libcluster or a load balancer that drains gracefully, because a node that drops mid-request takes LiveView sessions with it. We wire up the release, the cluster topology and the deploy pipeline together so the whole thing is reproducible.

Can you take over a Phoenix app from a previous team?

Yes, and this is one of the more common Elixir calls. We get it building locally, reproduce the production release, document environment variables and third-party dependencies, bring the database migrations into a known state, and only then make changes. A quiet handover comes before any new feature work.

How much does Elixir help cost?

The estimate is complimentary. Share the app and the symptoms, and a quote comes back ahead of any engineering effort.

Free estimate

Elixir app giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.