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

arthurvillar's avatar

504 Gateway Time-out error

I have a ScienceNews Laravel app deployed on DigitalOcean using Nginx. I am using the most basic droplet:

  • 1 GB / 1 CPU
  • 25 GB SSD disk
  • 1000 GB transfer

It is called https://thesciencebreaker.org

I have other projects using the same exact configurations (also on DigitalOcean) but this is the only one that started to show the 504 Time-out error recently. The website has been dragging quite a bit as well, and at times blows up and shows this error.

The database has about 300 articles, 400 authors and 5k subscribers.

It has an average of about 1200 visitors per month, according to Google Analytics.

Would the database be causing this? Or is it the server that is too basic?

The same backend also has an API that serves an iOS app, but the app never crashes or experiences delays. This happens only on the website.

Any help would be greatly appreciated!

0 likes
3 replies
andreich1980's avatar

You could try to use Laravel Telescope and check how long are the requests, how many DB queries are running with each request, etc.

Talinon's avatar
Talinon
Best Answer
Level 51

@arthurvillar I don't think it has anything to do with your droplet specs.

Loading your homepage took over 13 seconds for the server to respond, the "about" page takes 7 seconds, and an undefined route is under 1 second.

The fact it takes milliseconds to respond tells me your server is handling the request adequately. It is most likely code-based with some nasty N+1 queries, and maybe a database that needs some indexing.

As suggested, try to track it down with some diagnostic tools. You can also give laravel-debugbar a try to drill-down into what is causing the slow responses.

arthurvillar's avatar

@talinon Thanks for looking that up, you might be right! This is an old app, there might very well be many unnecessary repeated query calls. I'll check that and follow up here soon.

Please or to participate in this conversation.