Timeout (524 & 504) Error WordPress Site | DigitalOcean

So from your information, there are a couple of things that can be done.

I’ll break the answer into the comments as well as it might make it really long to read and overwhelming.

The answer will be set in the current 3 points:

Resolve current Droplet issues

At the moment your Issues are coming from the fact that you are generating too much traffic for the resources you have.

There are two ways to resolve such situations about

Now, sometimes it doesn’t matter how much you’ll optimize your website, you still need more recourses. Having said that before you go toward that solution, you first need to try the optimization process

Ubuntu Outdated version

First and most important would be to upgrade your Ubuntu server. As you are using Ubuntu 16.04, which is heavily outdated you are using outdated OS, packages, and other tools which can cause worse performance for your application/website, not to mention vulnerability issues.

Upgrade Ubuntu or go for a new Droplet

There are two ways to go about this, either upgrade your Droplet from 16.04 to 22.04 OR create a new 22.04 Droplet and migrate your WordPress over to it.

Since the changes between 16.04 and 22.04 are far too big and there most probably would be issues along the way I usually recommend people to recreate their setup on a new Droplet and migrate the configuration over however upgrading the Droplet is also a possibility.

Upgrade Ubuntu

To upgrade Ubuntu you’ll basically need to run 3 commands.

If you want to be a bit more though you can do something like:

but usually, the first 3 commands would do the trick.

Now, before you begin, I’ll recommend to create a Snapshot of your Droplet just to be sure you have everything backed in case of an emergency.

You can see the docs here:

Snapshots are on-demand disk images of DigitalOcean Droplets and volumes saved to your account. Use them to create new Droplets and volumes with the same contents.

Migrate to a new Droplet

The other option would be to migrate your application on a newly created Droplet which has Ubuntu 22.04.

The first step is to create and configure your Droplet to be ready for your website. This process can be difficult for people with no experience. As such I’ll recommend using the DigitalOcean market place :

There is a WordPress image. This will create a Droplet ready for use exactly for a WordPress website. Follow the steps there and you’ll be good to go.

Now that you have a second upgraded Droplet, it’s time to migrate the data, you can use plugins like:

It should move your data all in one go. The final step will be to test everything with a host file and make sure it is working fine and then switch the DNS settings and push your site live from DigitalOcean.

This is the first part

As a comment, I’ll post point number 2 and 3

This content was originally published here.