Our forum underwent a large infrastructure change and now it’s not performing well.
I migrated the database to be a managed database at digitalocean, I put S3 assets on a minio instance with cloudflare in front of it.
I also re-deployed the discourse with a smaller vm but still enough resources to handle the load.
from what I can see there are postgres queries that are taking forever:
21 seconds
![]()
19 seconds
![]()
AI-generated summary
The user Eviepayne is struggling with performance issues after migrating their Discourse forum to a managed PostgreSQL database on DigitalOcean, using S3 via MinIO with Cloudflare, and deploying on a smaller VM. They’re experiencing extremely slow database queries, with some taking over 19 seconds image. merefield questions the unsupported nature of the setup, and renato asks about network proximity between the server and database. pfaffman explains that while external databases are possible, scaling and complex setups are less supported and introduces variables like database size, RAM, and network latency. Eviepayne plans to test a clean, supported install to isolate the issue. They also ask about manually running database migrations, which pfaffman confirms is possible via bin/rails db:migrate inside the container. After a second rebuild, they note that the registration issue resolved and they were able to restore backups.
so reverse that?
though perhaps others have tried this and will chime in with tips to improve that kind of setup.
Why is this unsupported?
discourse has the options in the app.yml for external databases?
I’m trying to scale a large server.
My bad, let me remove that for now ![]()
How close is the managed database to your instance? Are they in the same network?
yeah the server is also DO.
right now im going to do a bone-stock install with the supported guide and import the database
I’ll see what happens then.
Is there a way to manually run those database migrations?
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
Even a simple bare install isn’t working haven’t even restored the database at all.
did a discourse-setup on a clean VM, and the registration isn’t working.
Attempted to restore via commandline and discourse restore doesn’t list the backups.
Edit: worked after a second complete rebuild.