Having a hard time optimising

But it sounds like your postgres server isn’t enough to handle the load? How big is your database? How much ram does your postgres server have?

Maybe you should have waited to see if your postgres server worked first?

Well, it’s mostly the case that only the standard install, is “supported.” The external database should work, but you add a bunch of variables that it’s hard to guess about.

That’s less supported, how large? And then how large are a bunch of things? The database, the database server, the droplet you’re running on, the bandwidth between the droplet and the database. . . .

That’s a good place to start, and then you can start checking things off.

Usually it’ll happen when you bootstrap the container, but you can enter the container and

cd /var/www/discourse
bin/rails db:migrate