R
Railway2y ago
zikk

PostgresQL eating up too much RAM

my Postgresql DB instance averages 3GB of RAM use for like 8 open connections and just a couple of requests a day. It's way too much, i noticed that because of that i've been overpaying for a while alrady. Project ID : e40da83a-cffa-4c89-a560-e1b51f20a45c
33 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
what constitutes a lot
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
my biggest table is 1.5 millions give or take but size on disk shouldn't impact RAM use ?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
i have probably more or less 3 millions rows, but 3GB doesn't feel very reasonable ngl. This should be tweakable in a way ?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
arent's indices written in disk too ? if i had 20 GB of data i'd use 20GB of RAM ? I've had the same instance running on a $5 digital ocean instance without any issue and the RAM was capped at 2GB I really believe this is an issue on the side of railway
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
I see, is there any configuration to cap the PG plugin RAM usage ?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
zikk
zikk2y ago
i'm paying a little too much for an app i'm using alone for now where do i request this ? It is really a serious issue. I'm paying $30 for something that should be $10-15
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Just a heads up those limits will be "When we shut off your application" Not like, throttling your DB for you
zikk
zikk2y ago
Well i actually meant capping RAM usage for plugins and/or app instances for example especially when so many processes or DBs use as much as they have available
JustJake
JustJake2y ago
Totally. So lemme find the ticket where we track THAT issue
zikk
zikk2y ago
that would be a great feature
JustJake
JustJake2y ago
So that you can make sure you're subscribed to the right one Because it's absolutely something we want to do Just like, the more upvotes the actual right ticket gets the more we can prioritize it ya know Sec
zikk
zikk2y ago
of course, i'd like to see that :')
JustJake
JustJake2y ago
Psych, I lied, they're all under the same ticket Upvote away please!
zikk
zikk2y ago
pikaOMG dare you <:pepe_gun:933101827501740152>
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Upvote* it please!
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Ya it caches stuff so that your queries can be fast
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Candidly, dropping a bill is not a usecase
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
I could see PG making weird memory optimizations, and the usecase would actually to be to tweak the DB such that you can say “actually, I don’t really care to keep those first queries hot” For sure I just wanna be clear about what we should be building here 😄 At 8gb, that’s $80, which does drop your costs by 50% anyways
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Oh it’s quite the opposite! It’s saying “Well, I’ve got these resources I might as well use em!”
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JustJake
JustJake2y ago
Wait if it's cheaper than DO why not keep it on Railway for now anyways?