Postgres question

codingwithchristian
PROOP

24 days 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!

$10 Bounty

16 Replies

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.

codingwithchristian
PROOP

24 days ago

Great thanks for the tip:) building something fun!


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?

codingwithchristian
PROOP

24 days 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!


codingwithchristian
PROOP

24 days ago

oh shit this is a live chat; dope


There is no hard cap on Railway.


codingwithchristian
PROOP

24 days ago

sweet; any additional costs that you are aware of?


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.


codingwithchristian
PROOP

24 days 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


You shouldn't ever come near 200 concurrent connections if you do that. Each connection will only live for a fraction of a second.


codingwithchristian
PROOP

24 days 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


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.

23 days 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!

23 days 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.

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.

codingwithchristian
PROOP

21 days ago

Good to know!! thank you for this


Postgres question - Railway Help Station