2 months ago
So I'm pretty new to the tech scene; but I've spend close to 800 hours in the last two months sort of no-lifing AI and using claude.code. Which has gotten me to the point where I'm actually asking questions about certain uses for my code; which is honestly amazing!
I've never been a huge coder; I tried a few years ago as my best friend is a software engineer; and a damn good one! Not trying to glaze my friend; but he has been the cornerstone for questions throughout this journey! (as well as Claude).
I know this introduction probably wasn't needed; but This is the first time I've ever sent a message, on like a forum like this before- Especially something that I'm not obssessed with!
Okay so the question! haha; what is the Max_connections I can have without having a connection error? I'm hoping to get 200-400 PostgresSQL_Max_connections.
Hope you enjoyed the read:) thanks for answering my question!
16 Replies
2 months ago
There's not a hard cap. It depends on MANY things, but I wouldn't go over 100. Why do you want 200-400? That's FAR too many.
samgordon
There's not a hard cap. It depends on MANY things, but I wouldn't go over 100. Why do you want 200-400? That's FAR too many.
2 months ago
Great thanks for the tip:) building something fun!
2 months ago
You're likely building it wrong if you need 200-400 active connections. What is it?
samgordon
You're likely building it wrong if you need 200-400 active connections. What is it?
2 months ago
building something fun! hahaha
but are you sure Railway's managed PostgreSQL has only no hard cap? guess ill find out; gonna start with 200 since 100 is to slow!
2 months ago
oh shit this is a live chat; dope
2 months ago
sweet; any additional costs that you are aware of?
2 months ago
No data cost if you're using internal networking... but you could have exponentially higher CPU and RAM usage if you for some reason are holding 300 concurrent connections.
2 months ago
All good! I'm doing connection pooling with short lived queries! So I don't think it'll have any issues; hoping that I don't have api issues; and my system becomes more instantaneously than having to wait; that's the important part lol; no bottle necking
2 months ago
You shouldn't ever come near 200 concurrent connections if you do that. Each connection will only live for a fraction of a second.
2 months ago
That is true; if it's not going through a pipeline isn't it? Its going through several different checks before the connection ends
2 months ago
Yes, but still less than a second. It will likely be slower than just using one connection because of the overhead of establishing a new connection each query.
samgordon
There is no hard cap on Railway.
2 months ago
We don't cap connections anywhere near 400, but the Postgres software itself limits the max connections to 100 by default.
codingwithchristian
building something fun! hahahabut are you sure Railway's managed PostgreSQL has only no hard cap? guess ill find out; gonna start with 200 since 100 is to slow!
2 months ago
Just want to mention that our databases are not managed.
brody
We don't cap connections anywhere near 400, but the Postgres software itself limits the max connections to 100 by default.
2 months ago
By default, yes, but their question was the maximum value of changing that default, which I believe doesn't exist.
brody
Just want to mention that our databases are not managed.
2 months ago
Good to know!! thank you for this