this post was submitted on 25 Feb 2024
42 points (97.7% liked)

Selfhosted

39980 readers
690 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
42
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/[email protected]
 

I want to migrate my Nextcloud instance from MariaDB over to PostgreSQL. I already have a PostgreSQL service running for Lemmy. And I'm pretty starved for RAM.

Would it be better to just have one PostgreSQL service running that serves both Nextcloud and Lemmy? Or should every service have its own PostgreSQL instance?

I'm pretty new to PostgreSQL. But in my mind I would tend towards one service to serve them all and let it figure out by itself how to split resources between everything. Especially when I think that in the long run I will probably migrate more services over to PostgreSQL (and upgrade the RAM).

But maybe I am overlooking something.

Edit: Thanks guys, I've settled for a single instance for now. And after a little tuning everything seems to be running better than ever, with room to spare.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 8 months ago (1 children)

Native, docker, something else? How starved are you at the moment?

[–] [email protected] 3 points 8 months ago (2 children)

If I went with a shared service I would run it natively on Debian Stable.

Lemmy currently uses a dockerised PostgreSQL service. I've got 16 GB RAM which is currently mostly occupied by both MariaDB and the PostgreSQL Docker.

[–] [email protected] 9 points 8 months ago

Your Postgres and/or MariaDB is probably configured to take as much RAM as it can get. It shouldn't use that much with the light workloads you're likely to have.

[–] [email protected] 3 points 8 months ago (1 children)

Have you tried limiting the RAM usage of those containers? They tend to use as much as you give them, which is all of it by default.

[–] [email protected] 1 points 8 months ago

That was more or less the default of the PostgreSQL container and it ran like ass because I don't have a SSD.

Basically I had to give MySQL a ton of RAM for Nextcloud and PostgreSQL for Lemmy. For now I've put both on the same PostgreSQL instance and let them battle out who gets the assigned RAM by themselves.