Menu

Nginx Proxy Manager opens a new backend connection for every request. Here's what that costs (and a 10-line fix)
📰

Nginx Proxy Manager opens a new backend connection for every request. Here's what that costs (and a 10-line fix)

DEV Community: docker·Jikwang Moon·about 1 hour ago
#UQzqvY1c
#devtodocker#devto#dev#proxy#nginx
Reading 0:00
15s threshold

I build an open-source gateway on top of OpenResty, and the first version of it was embarrassingly

slow: 18 % of plain nginx's throughput on the same hardware. The biggest single fix turned out

to be one that many reverse proxies, including Nginx Proxy Manager (NPM), still don't apply:

reusing connections to the backend.

This post shows the benchmark, explains the cause, and gives you a fix you can apply to NPM today

without switching anything.

The setup

Everything runs on one GitHub-hosted ubuntu-24.04 runner (4 vCPU AMD EPYC), pinned with

taskset / --cpuset-cpus so the proxies can't steal CPU from the load generator:

CPU What runs there

0 wrk , 64 keep-alive client connections

1 the backend: nginx:1.28-alpine returning 200 ok from memory

2-3 the proxy under test ( 2 vCPU , 2 worker processes)

Each scenario gets a 5 s warm-up and a 20 s measured run of GET / with a 3-byte response.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.