Running on Phoenix?

Phoenix LiveView or Ecto giving you grief? We ship it properly.

Phoenix is the serious answer for real-time Elixir applications and most of the time it just works, until an Ecto migration deadlocks against live traffic, a LiveView disconnects every two minutes because the WebSocket path is proxied wrong, or a GenServer builds a mailbox you cannot clear. We work the BEAM and the application side together rather than guessing at one half.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

phoenix-prod.log

still failing

What it is

Phoenix (Elixir) at a glance

Phoenix is a web framework written in Elixir, first released in 2015 by Chris McCord and now maintained by the Phoenix core team. It runs on the BEAM, the Erlang virtual machine, and inherits its ability to handle hundreds of thousands of long-lived connections per node without the usual thread-per-connection overhead.

LiveView is the framework's signature feature: server-rendered HTML that updates over a persistent WebSocket, giving most of the feel of a SPA with a small fraction of the JavaScript. Phoenix pairs with Ecto for the database layer and uses OTP primitives like GenServer and Supervisor for background work, giving a stack that is unusually good at concurrent and real-time workloads.

Type
Web framework for Elixir, built on the BEAM virtual machine
First released
2015 public 1.0
License
MIT
Maintained by
Chris McCord and the Phoenix core team
Typically used for
Real-time web applications, LiveView interfaces, APIs, chat and collaboration backends

The honest version

Phoenix (Elixir) pros and cons

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

Where Phoenix (Elixir) is strong

  • Real concurrency without a battleThe BEAM handles thousands of concurrent processes with cheap message passing. Problems that need threads and locks elsewhere are often a few GenServers here.
  • LiveView replaces half the SPAServer-rendered state that updates in place over WebSockets gets you interactive UX with a backend team, no separate React project required.
  • Fault tolerance is first-classSupervision trees restart failed processes without taking the node with them, which is why Elixir systems tend to feel calm under pressure.
  • Ecto is a thoughtful data layerChangesets, migrations and query composition are explicit and testable, rather than hiding behind an opaque ORM.
  • Observability from day oneTelemetry events, LiveDashboard and OTP tracing make production debugging substantially easier than most stacks allow.
  • Hot upgrades are possibleZero-downtime code upgrades on a running node are supported, which few other mainstream frameworks offer honestly.

Where Phoenix (Elixir) bites

  • Hiring Elixir engineers takes effortThe language has fewer practitioners than Node or Python, and finding someone who is comfortable with OTP under production load is harder still.
  • LiveView disconnects are the new flaky testProxies that close idle WebSockets, misconfigured load balancers and mobile network hops all show up as a steady drizzle of reconnects that have to be chased down.
  • Ecto migrations against live traffic need careA naive ALTER TABLE will take an exclusive lock and queue every request. Concurrent indexes and batched updates need to be the default pattern.
  • GenServer backlogs are invisible until they are catastrophicA worker that falls behind its mailbox accumulates messages until the VM runs out of memory. Monitoring queue length is not optional.
  • JavaScript interop still existsLiveView reduces the JS surface, it does not eliminate it. Hooks, uploads and some interactions still need JS written and maintained.
  • Ecosystem is narrower than Rails or DjangoMature libraries exist for the big use cases, but off-the-shelf solutions for niche integrations sometimes require writing your own wrapper.

Sound familiar?

Common Phoenix (Elixir) problems we fix

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

DBConnection.ConnectionError: dropped from queue

The database pool runs out of connections

A slow query holds a connection, more requests queue behind it, and every incoming request times out at the pool. Raising the pool size masks it; finding the slow query fixes it.

Pool steady, queries under budget

GenServer.call timeout

A GenServer builds an unclearable backlog

Heavy work in handle_call blocks the process while new calls queue behind it. Moving the work into a Task, a separate pool, or handle_cast where appropriate restores responsiveness.

Backpressure where the work really is

Phoenix.LiveView.Socket disconnected: :closed

LiveView disconnects every few minutes

An intermediary proxy with a default idle timeout closes the WebSocket, LiveView reconnects, and the user sees a flicker. Fixing the proxy or shortening the client keepalive is the honest answer.

LiveView sessions stay connected

Postgrex.Error 40P01 deadlock_detected

Deadlocks appear under concurrent writes

Two transactions grab locks in different orders and the database kills one. The fix is consistent lock ordering in the application rather than retries alone.

Transactions ordered, deadlocks gone

Ecto.Migration.Error: relation already exists

Migrations fail on redeploy

A migration that was partially applied by a previous crash, or a schema out of sync with the migration history. Reconciling schema_migrations by hand is sometimes the only path.

Migration history consistent

could not fetch application environment :secret_key_base

Release boot fails for missing config

A runtime config value that was in dev.exs and never made it into releases.exs or the environment. Phoenix refuses to boot rather than running insecurely, which is the right call.

Release boots with config intact

process heap size 8388608 words

A single process grows its heap without bound

A cache GenServer that never evicts, or a long-lived process that builds state across requests. Hibernation plus a size budget keeps the VM tidy.

Process memory bounded and visible

What we do

Phoenix help, from one failing LiveView to a managed Elixir estate

One flaky LiveView, or the whole Phoenix application; both are fair game.

LiveView stabilisation
WebSocket plumbing, reconnect handling, hook correctness and the proxy settings that keep sessions alive.
Ecto work
Migrations that do not lock, queries that use the indexes you have, and preloads that do not multiply round trips.
OTP design
Supervision trees, GenServer boundaries and backpressure that match the traffic shape rather than an aspirational diagram.
Deployment
Releases that boot cleanly, runtime configuration that holds, and clustering set up for your real deployment target.
Performance
Finding the slow queries, the chatty processes and the memory growers with OTP-native tools before adding more nodes.
Managed Tech
Telemetry alerts, upgrade planning, dependency updates and a team that speaks Elixir when something odd happens at 3am.

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 Phoenix (Elixir) alongside something else?

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

Questions

Phoenix (Elixir) questions

Something else? Call+1 737 727 7327

Why does our LiveView disconnect every couple of minutes?

The common culprits are a load balancer or reverse proxy with a short idle timeout, a WebSocket path that is routed differently from the HTTP one, and a mobile client whose network handoff drops the connection. The fix starts with checking the proxy's idle setting against the LiveView heartbeat interval, and ensuring the upgrade headers pass through every hop.

How should we run Ecto migrations against a live production database?

Prefer non-blocking patterns: add columns nullable first, backfill in batches with Ecto.Query, add NOT NULL in a later deploy, and build indexes with CONCURRENTLY. Avoid renaming columns in one step; add, backfill, switch reads, then drop. A migration that locks for more than a few milliseconds is the one that will take production down.

Our GenServer is falling behind, what do we do?

Measure the mailbox size with Process.info(pid, :message_queue_len) and look at what handle_call is doing. If the work is slow, move it off the GenServer into a Task.Supervisor or a dedicated worker pool. If the work is fast but incoming rate is high, consider handle_cast with backpressure, or sharding the work across several processes.

Is Phoenix a sensible choice when nobody on the team knows Elixir?

It can be, with eyes open. The learning curve is real but Elixir rewards investment; six months in, teams tend to be as productive as they were in the previous language. If the team is small and the problem is firmly in the real-time or high-concurrency space, Phoenix is often worth it. For a CRUD API with a two-person team on a deadline, a stack with a bigger hiring pool is the safer call.

How much does Phoenix help cost?

Our estimates are free. Share the application, the symptom and the shape of production, and we come back with a scope and a figure before any work begins.

Free estimate

Phoenix 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.