PM2 in production: restart Node.js without dropping requests
A brutal pm2 restart drops connections mid-request. Between reload, cluster mode, and graceful shutdown, the difference shows up as seconds of outage—or none at all.
Browse our Technical posts on European hosting.
No results for this search
A brutal pm2 restart drops connections mid-request. Between reload, cluster mode, and graceful shutdown, the difference shows up as seconds of outage—or none at all.
Restarting Node every night hides the leak — until the interval is not enough and PM2 loops on OOM kill.
Replacing a loop with SQL without profiling is random optimization. Blackfire, Xdebug, and SPX exist to prevent that.
Deploying PHP without touching OPcache bets that no worker keeps old compiled bytecode — until the next ghost bug.
PHP-FPM queue full? Before raising pm.max_children, check if workers sleep on an external API call or a 30-second SQL query.
PgBouncer and app pools cut open connections — but sized wrong, they make apps wait in front of an already choking database.
Replicating without a clear goal duplicates data — not problems. Failover, read replica, and lag are three different conversations.
"The database is slow" is not a diagnosis. EXPLAIN (ANALYZE) shows where PostgreSQL loses time — scan, join, sort — before you buy hardware.
Site suddenly slow with no recent deploy? Before adding RAM, find the query scanning millions of rows — one EXPLAIN line is often enough.
Moving PHP sessions to Redis enables horizontal scale — until Redis fails and everyone is logged out at once.
Varnish speeds everything identical between visitors — and serves the wrong page to those who should not see the cacheable version.
Caching "the homepage" seems simple — until a logged-in banner, cart and A/B test make every visit unique.
Nginx excels as a reverse proxy and for static files; Apache still shines with .htaccess and legacy modules. The right choice is read request by request.