Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fkwok's avatar
Level 2

Laravel Route getting 503 error

Hi,

I got a weird error from route that I am not sure where to look at ... any suggestion would be a great help.

Currently we are doing an upgrade for our services, where we have legacy users with our old API route services. In the new version we changed the route and update the legacy route through the new handler so we don't need to request all old customers to update their web hooks urls. The route.php setting is as below.

// Legacy:
Route::post('/webhooks/legacy-service-endpoint', 'ServiceController@newHandlingMethod');

// New Web hooks:
Route::post('/webhooks/v2/new-service-endpoint', 'ServiceController@newHandlingMethod');

While I did the individual testing, the code and logic all working fine. However when I roll out to live, many legacy users has time out error and it actually become 503 Service not Available on the server (which I still don't know how to get to this point, I am guessing it is due to repeating requests causing the DOS attach type of thing and bring down the server.....).

So I rolled back and everything went back to normal.

Now I try to conduct a stress testing (I know I should have done that first .... lesson learn!). I realised even the Controller/Handler is the same. The LEGACY web hooks failed response in time and causing the 50X errors. This start happening when there are more than 100 clients sending request in the 1 min duration (using loader.io for testing).

But strangest thing is on the NEW web hooks route, it can handle up to 3000 clients at a time without any issue not even one single 50X error.

In theory, I thought that between the two route, everything should be the same.... except the name/url.

Is that something that I missed here?

Kind regards,

Fei

0 likes
3 replies
siangboon's avatar

perhaps the error messages in your server/laravel log may help.

fkwok's avatar
Level 2

@SIANGBOON - Hi sianghoon,

Thank you for your reply.

I can see the request is coming in without an issue. I even see the Log said the task is completed before the

return response('200', 200);

But for some reason, the client still getting timeout... like the response never get back to them. This only happen then there a 100 or more clients in the testing.

If I use a postman request and it is working fine with me.

I just don't get what is the different between the route's url, since the new one is can mange more than 2000+ client....

Additional information as I digging it, on /var/log/nginx folder on the server I am testing I got some error from the request like this.

connect() to unix:/var/run/php/php7.3-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

Maybe contributing the issue? but I can't get it why it was only happened on the legacy endpoint.

Cheers,

Fei

Please or to participate in this conversation.