ConnectorError Postgress [Production] Application
adarshmishra07
HOBBYOP

a year ago

Hey team my application is currently active and runnign on a Pro plan and has a huge influx of users but i have been getting the following error making my postgress server shut

Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "53100", message: "could not resize shared memory segment \"/PostgreSQL.1340169832\" to 196736 bytes: No space left on device", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })

Solved

166 Replies

adarshmishra07
HOBBYOP

a year ago

a08f7d7d-760f-41c8-8002-b417a6adf583


adarshmishra07
HOBBYOP

a year ago

@Brody it's urgent please help!


brody
EMPLOYEE

a year ago

<#727685388893945877> #5


adarshmishra07
HOBBYOP

a year ago

I apologise sir - please redirect me to a person if possible, i am sorry to tag you - but you've always been of great help didn't know what to do


adarshmishra07
HOBBYOP

a year ago

ConnectorError Postgress [Production] Application


brody
EMPLOYEE

a year ago

i've made the needed change to prevent the error going forward, its in a staged change, feel free to apply when you want


adarshmishra07
HOBBYOP

a year ago

Thanks a ton can you help me with what exactly the issue is ?


brody
EMPLOYEE

a year ago

not enough shm space


adarshmishra07
HOBBYOP

a year ago

Okay so this won't happen again right ?


brody
EMPLOYEE

a year ago

after applying my change, no


adarshmishra07
HOBBYOP

a year ago

Thanks a ton, i really appreciate it -
Applied it

Apologies again on tagging you -we have a campaign running and have ~4k-5k concurrent users on platform


adarshmishra07
HOBBYOP

a year ago

Hence was a bit anxious


brody
EMPLOYEE

a year ago

perhaps you would be interested in enterprise, that way you could wake us up in the middle of the night for platform issues, and we wouldn't send you the readme! 😆


adarshmishra07
HOBBYOP

a year ago

100% for future campaign would consider it - Thanks for the support just bear with me on this one.

And can we keep this open for another day the campaign ends in ~36hrs


brody
EMPLOYEE

a year ago

yep, wont close, but without enterprise, i can't promise we will be able to answer anywhere as fast as ive done today


brody
EMPLOYEE

a year ago

Pro SLO is 12 hours iirc


adarshmishra07
HOBBYOP

a year ago

What's timezone ?
I won't be able to this time it's be tough to get approvals.

But thanks a ton I appreciate i just hope this doesn't happen again and we should be good!


brody
EMPLOYEE

a year ago

timezone doesnt come into play here, you'd get an answer within 12 hours max


adarshmishra07
HOBBYOP

a year ago

understood thanks


adarshmishra07
HOBBYOP

a year ago

Hey team i am getting the above error again


adarshmishra07
HOBBYOP

a year ago

Can you please check


adarshmishra07
HOBBYOP

a year ago

i feel there's a pattern after every certain number of read/writes this happens


brody
EMPLOYEE

a year ago

what postgres service?


adarshmishra07
HOBBYOP

a year ago

This is logged on Nextjs using with Prisma - is that what you meant ?


brody
EMPLOYEE

a year ago

nope, in the project you linked, there are two postgres services


adarshmishra07
HOBBYOP

a year ago

Postgres


adarshmishra07
HOBBYOP

a year ago

is the prod env


brody
EMPLOYEE

a year ago

id please


adarshmishra07
HOBBYOP

a year ago

one moment checking - where can i find it


brody
EMPLOYEE

a year ago

in the url


adarshmishra07
HOBBYOP

a year ago

postgresql://postgres:*@junction.proxy.rlwy.net:34872/railway


brody
EMPLOYEE

a year ago

no what i meant haha, but that works too


adarshmishra07
HOBBYOP

a year ago

happened again


brody
EMPLOYEE

a year ago

please provide the latest error


adarshmishra07
HOBBYOP

a year ago

ConnectorError(ConnectorError { userfacingerror: None, kind: QueryError(PostgresError { code: "55000", message: "lost connection to parallel worker", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })


brody
EMPLOYEE

a year ago

thats not the same error?


adarshmishra07
HOBBYOP

a year ago

ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "55000", message: "parallel worker failed to initialize", severity: "ERROR", detail: None, column: None, hint: Some("More details may be available in the server log.") }), transient: false })

OH yeah this looks a different one


brody
EMPLOYEE

a year ago

where is the next site hosted?


adarshmishra07
HOBBYOP

a year ago

Vercel


brody
EMPLOYEE

a year ago

then you are opening and closing database connections for every request since its serverless


adarshmishra07
HOBBYOP

a year ago

What can i do here ?


brody
EMPLOYEE

a year ago

use pgbouncer or run your app on railway within the same project


adarshmishra07
HOBBYOP

a year ago

Is there no other solution ?
As i have continous users on the site

1330782661303861200


adarshmishra07
HOBBYOP

a year ago

it would be quite difficult to move it


brody
EMPLOYEE

a year ago

fun fact, we moved the railway.com site from vercel to self hosted on railway live


adarshmishra07
HOBBYOP

a year ago

My problem is time - this is a short term project which closes in <24hrs now


brody
EMPLOYEE

a year ago

you are bumping up against postgres max connection limits, i can increase them?


adarshmishra07
HOBBYOP

a year ago

Are you sure ?
because it's currently set to 1k


brody
EMPLOYEE

a year ago

i know, your current connections is 976


brody
EMPLOYEE

a year ago

989 now


adarshmishra07
HOBBYOP

a year ago

let me restart the db once - that'll reset the connections as well right ?


brody
EMPLOYEE

a year ago

yeah it would drop a lot of connections, im not sure you want that?


adarshmishra07
HOBBYOP

a year ago

things are already failing - and railway would be back in couple seconds i feel ?


brody
EMPLOYEE

a year ago

well you already did it


adarshmishra07
HOBBYOP

a year ago

okay closed processes it's 250 now


adarshmishra07
HOBBYOP

a year ago

didn't restart but close processes


brody
EMPLOYEE

a year ago

climbing fast


adarshmishra07
HOBBYOP

a year ago

Okay let's increase the connection limit if that' the only solve sir


brody
EMPLOYEE

a year ago

well it would be the fastest


adarshmishra07
HOBBYOP

a year ago

Right yes - thank you so much


adarshmishra07
HOBBYOP

a year ago

is it restarting ?


brody
EMPLOYEE

a year ago

this could also drop connections, are you sure you want me to set it?


adarshmishra07
HOBBYOP

a year ago

sure let's do it


adarshmishra07
HOBBYOP

a year ago

i can see things failing now


adarshmishra07
HOBBYOP

a year ago

unable to reach db


brody
EMPLOYEE

a year ago

the database needs to be restarted after making this change, am i good to do that


adarshmishra07
HOBBYOP

a year ago

Yes


brody
EMPLOYEE

a year ago

okay now max 4k conns


adarshmishra07
HOBBYOP

a year ago

okay thankyou


adarshmishra07
HOBBYOP

a year ago

i'll monitor now and see if it happens again


brody
EMPLOYEE

a year ago

i'd like to take this time to again mention that i was only able to answer since i was at my laptop on discord, we cannot promise anyone will answer this fast when youre only on pro


adarshmishra07
HOBBYOP

a year ago

ConnectorError(ConnectorError { userfacingerror: None, kind: QueryError(PostgresError { code: "53100", message: "could not resize shared memory segment \"/PostgreSQL.1707297426\" to 196736 bytes: No space left on device", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })

Still getting this


adarshmishra07
HOBBYOP

a year ago

I understand sir - i really appreciate your help


adarshmishra07
HOBBYOP

a year ago

Getting the shared memory issue again


brody
EMPLOYEE

a year ago

i can increase the shm size to 1gb, this will fully redeploy the database


adarshmishra07
HOBBYOP

a year ago

my data ?


brody
EMPLOYEE

a year ago

no it doesnt touch your data


adarshmishra07
HOBBYOP

a year ago

okay let's do it - how much time does it take ?


adarshmishra07
HOBBYOP

a year ago

a coupl mins is fine


brody
EMPLOYEE

a year ago

10 seconds tops


adarshmishra07
HOBBYOP

a year ago

done pleasee


brody
EMPLOYEE

a year ago

okay, deploying now


adarshmishra07
HOBBYOP

a year ago

yes


brody
EMPLOYEE

a year ago

done


adarshmishra07
HOBBYOP

a year ago

okay thankyou - i do understand about your enterprise plan solutions and i will 100% consider it for future big launches.


brody
EMPLOYEE

a year ago

i have to ask, what would you have done if i had gone to sleep? it is 1:30am here after all lol


adarshmishra07
HOBBYOP

a year ago

I am so sorry - the only thing i could have done is keep closing connecitons
and restarting the db hoping atleast some people keep getting though


adarshmishra07
HOBBYOP

a year ago

i know that's the worst thing to do


brody
EMPLOYEE

a year ago

enterprise is a year commitment btw


adarshmishra07
HOBBYOP

a year ago

how much is it ?


brody
EMPLOYEE

a year ago

1k /month


brody
EMPLOYEE

a year ago

paid monthy


adarshmishra07
HOBBYOP

a year ago

clear yeah


adarshmishra07
HOBBYOP

a year ago

will def go for it


adarshmishra07
HOBBYOP

a year ago

next campaign


brody
EMPLOYEE

a year ago

you'd have to sign a contract to pay 1k per month for a year


adarshmishra07
HOBBYOP

a year ago

i'll reach out to railway once i am ready


brody
EMPLOYEE

a year ago

sounds good to me


brody
EMPLOYEE

a year ago

though next time, maybe run the site on railway too, if railway can run railway.com, it can run your site


adarshmishra07
HOBBYOP

a year ago

It's happening again


adarshmishra07
HOBBYOP

a year ago

the parallel worker failed error


brody
EMPLOYEE

a year ago

hmmm

1330788368694640600


adarshmishra07
HOBBYOP

a year ago

it's under the limit right ?


brody
EMPLOYEE

a year ago

would you like me to increase maxworkerprocesses?


adarshmishra07
HOBBYOP

a year ago

Whatever would help


brody
EMPLOYEE

a year ago

it will restart postgres again


adarshmishra07
HOBBYOP

a year ago

sure


brody
EMPLOYEE

a year ago

done


brody
EMPLOYEE

a year ago

okay, looks like worker count is regularly going above the previous default of 8


adarshmishra07
HOBBYOP

a year ago

how much have we set it to now?


brody
EMPLOYEE

a year ago

256


adarshmishra07
HOBBYOP

a year ago

Okay amazing


adarshmishra07
HOBBYOP

a year ago

Thankyou so much for your help - won't make you stay up for longer - really appreciate all the help


brody
EMPLOYEE

a year ago

for what its worth, this is technically something you could have done, not saying i had any problem doing it for you, just letting you know that its not like i went in a tweaked secret things in railway, everything ive been doing is something a non admin can do too (non admin as in you still have to own the database in railway)


adarshmishra07
HOBBYOP

a year ago

understood - basically if i knew what to i could have did it too ?


brody
EMPLOYEE

a year ago

yeah exactly


adarshmishra07
HOBBYOP

a year ago

ahh - understood
My lil minds could not understand what to do but will surely learn


adarshmishra07
HOBBYOP

a year ago

but it still is happening


adarshmishra07
HOBBYOP

a year ago

i don't understand ….


brody
EMPLOYEE

a year ago

you must really be hammering this database


adarshmishra07
HOBBYOP

a year ago

i think it's the number of users ?
We have had more than a million users in 2 days


brody
EMPLOYEE

a year ago

damn and youve only paid us $20 <:kekw:788259314607325204>


adarshmishra07
HOBBYOP

a year ago

it's a campaign xD
we're just spending gaining nothing


adarshmishra07
HOBBYOP

a year ago

and we were not ready for this lol


adarshmishra07
HOBBYOP

a year ago

if it was not going to end tomorrow i would have upgraded to enterprise


brody
EMPLOYEE

a year ago

okay, plan b, i deployed pgbouncer for you, all you need to do is copy its DATABASE_PUBLIC_URL and then update that in vercel


adarshmishra07
HOBBYOP

a year ago

doing it now


adarshmishra07
HOBBYOP

a year ago

i think it's not able to connect to db for some reason


brody
EMPLOYEE

a year ago

why do you say that, im connected to pgbouncer


adarshmishra07
HOBBYOP

a year ago

but i am sure this is something on my end not yours


brody
EMPLOYEE

a year ago

who do you have your domain with? cloudflare?


adarshmishra07
HOBBYOP

a year ago

yes


brody
EMPLOYEE

a year ago

and its simply pointed to the cname vercel gave you?


adarshmishra07
HOBBYOP

a year ago

that's right


brody
EMPLOYEE

a year ago

and theres still issues?


adarshmishra07
HOBBYOP

a year ago

yeah - i think it's prisma config i am on it currentlyt


brody
EMPLOYEE

a year ago

what errors are you getting?


adarshmishra07
HOBBYOP

a year ago

no errors just it isn't responding i think


brody
EMPLOYEE

a year ago

i think we should attempt to run your app on railway and make the switch, cloudflare should make it seemless


adarshmishra07
HOBBYOP

a year ago

btw moving to pgbouncer does it afftect my data ?


adarshmishra07
HOBBYOP

a year ago

do i need to have access to cloudfalre or domain ?


adarshmishra07
HOBBYOP

a year ago

as i don't have it


brody
EMPLOYEE

a year ago

no it doesnt


brody
EMPLOYEE

a year ago

yes you would


adarshmishra07
HOBBYOP

a year ago

i don't have it, that would be a problem getting it currently


brody
EMPLOYEE

a year ago

then thats all plans i have exhausted


adarshmishra07
HOBBYOP

a year ago

so if i could get access - i just deploy it on railway that's it right ?
i'll try to reach the team


brody
EMPLOYEE

a year ago

then do you want to spend your current time at least trying to run it on railway? do you use any vercel specific features?


adarshmishra07
HOBBYOP

a year ago

edge functions etc nothing special


brody
EMPLOYEE

a year ago

thats special


adarshmishra07
HOBBYOP

a year ago

oh xD


brody
EMPLOYEE

a year ago

i think you need to be running on vercel's infra for that dont you?


adarshmishra07
HOBBYOP

a year ago

that was one of the reasons edge functions and ssr + the urgency


adarshmishra07
HOBBYOP

a year ago

Can u help me with how can i check if my traffic is going through pgbouncer ?


brody
EMPLOYEE

a year ago

have you replaced the old database url in vercel with the one from pgbouncer?


adarshmishra07
HOBBYOP

a year ago

yes i did


adarshmishra07
HOBBYOP

a year ago

the connections gettingin timed out


brody
EMPLOYEE

a year ago

according to the network metrics, looks like most data is still going to just the database


adarshmishra07
HOBBYOP

a year ago

i might have to revert for now - but i'll check what's wrong


adarshmishra07
HOBBYOP

a year ago

it's some config on my end - i'll handle it - if the team is ready will try moving to railway


brody
EMPLOYEE

a year ago

you'd likely have to move off the edge functions first


brody
EMPLOYEE

a year ago

but, i have to sign off for the night as its now 2:30am for me


adarshmishra07
HOBBYOP

a year ago

sure
thanks for your help


adarshmishra07
HOBBYOP

a year ago

Good night sir


brody
EMPLOYEE

a year ago

thank you


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...