Performance issue - Container crashes under load with PHP built-in server
jorgequispe-oacg
PROOP

2 months ago

Hi Railway Support,

We're experiencing performance issues with our PHP API (Fluentia API) that causes the service to become unresponsive when multiple users connect simultaneously.

Problem Description

  • Service: Fluentia API (PHP 8.3)

  • Current Dockerfile: Uses php -S (PHP built-in server)

  • Symptoms:

    • Service becomes unresponsive with 5+ concurrent users

    • HTTP 499/502 errors

    • RAM stays constant at ~2.86 GB (appears to hit a limit)

Root Cause Identified

The PHP built-in server (php -S) is single-threaded and can only handle 1 request at a time. We've already merged a fix (PR #180) that migrates to PHP-FPM + Nginx to support concurrency.

Questions

  1. Is there a memory limit on our container even though our Pro Plan shows 32GB available?

  2. How long should we expect the redeploy to take after merging to main?

  3. Are there any recommended configurations for PHP-FPM + Nginx on Railway?

Technical Details

New Dockerfile (already deployed)

FROM php:8.3-fpm-alpine

# Uses PHP-FPM with 5-50 dynamic workers

# Nginx as reverse proxy

# Supervisord to manage both processes

Thank you for your assistance.

Attachments

$20 Bounty

0 Replies

Railway
BOT

2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway about 2 months ago


Loading...