2 years 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
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 })```166 Replies
2 years ago
<#727685388893945877> #5
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
2 years 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
2 years ago
not enough shm space
2 years ago
after applying my change, no
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
2 years 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! 😆
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
2 years ago
yep, wont close, but without enterprise, i can't promise we will be able to answer anywhere as fast as ive done today
2 years ago
Pro SLO is 12 hours iirc
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!
2 years ago
timezone doesnt come into play here, you'd get an answer within 12 hours max
i feel there's a pattern after every certain number of read/writes this happens
2 years ago
what postgres service?
This is logged on Nextjs using with Prisma - is that what you meant ?
2 years ago
nope, in the project you linked, there are two postgres services
2 years ago
id please
2 years ago
in the url
postgresql://postgres:*********@junction.proxy.rlwy.net:34872/railway
2 years ago
no what i meant haha, but that works too
2 years ago
please provide the latest error
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "55000", message: "lost connection to parallel worker", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
2 years ago
thats not the same error?
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
2 years ago
where is the next site hosted?
2 years ago
then you are opening and closing database connections for every request since its serverless
2 years ago
use pgbouncer or run your app on railway within the same project
2 years ago
fun fact, we moved the railway.com site from vercel to self hosted on railway live
My problem is time - this is a short term project which closes in <24hrs now
2 years ago
you are bumping up against postgres max connection limits, i can increase them?
2 years ago
i know, your current connections is 976
2 years ago
989 now
let me restart the db once - that'll reset the connections as well right ?
2 years ago
yeah it would drop a lot of connections, im not sure you want that?
things are already failing - and railway would be back in couple seconds i feel ?
2 years ago
well you already did it
2 years ago
climbing fast
Okay let's increase the connection limit if that' the only solve sir
2 years ago
well it would be the fastest
2 years ago
this could also drop connections, are you sure you want me to set it?
2 years ago
the database needs to be restarted after making this change, am i good to do that
2 years ago
okay now max 4k conns
2 years 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
ConnectorError(ConnectorError { user_facing_error: 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
2 years ago
i can increase the shm size to 1gb, this will fully redeploy the database
2 years ago
no it doesnt touch your data
2 years ago
10 seconds tops
2 years ago
okay, deploying now
2 years ago
done
okay thankyou - i do understand about your enterprise plan solutions and i will 100% consider it for future big launches.
2 years ago
i have to ask, what would you have done if i had gone to sleep? it is 1:30am here after all lol
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
2 years ago
enterprise is a year commitment btw
2 years ago
1k /month
2 years ago
paid monthy
2 years ago
you'd have to sign a contract to pay 1k per month for a year
2 years ago
sounds good to me
2 years ago
though next time, maybe run the site on railway too, if railway can run railway.com, it can run your site
2 years ago
hmmm

2 years ago
would you like me to increase max_worker_processes?
2 years ago
it will restart postgres again
2 years ago
done
2 years ago
okay, looks like worker count is regularly going above the previous default of 8
2 years ago
256
Thankyou so much for your help - won't make you stay up for longer - really appreciate all the help
2 years 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)
2 years ago
yeah exactly
ahh - understood
My lil minds could not understand what to do but will surely learn
2 years ago
you must really be hammering this database
i think it's the number of users ?
We have had more than a million users in 2 days
2 years ago
damn and youve only paid us $20 <:kekw:788259314607325204>
if it was not going to end tomorrow i would have upgraded to enterprise
2 years 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
2 years ago
why do you say that, im connected to pgbouncer
2 years ago
who do you have your domain with? cloudflare?
2 years ago
and its simply pointed to the cname vercel gave you?
2 years ago
and theres still issues?
2 years ago
what errors are you getting?
2 years ago
i think we should attempt to run your app on railway and make the switch, cloudflare should make it seemless
2 years ago
no it doesnt
2 years ago
yes you would
2 years ago
then thats all plans i have exhausted
so if i could get access - i just deploy it on railway that's it right ?
i'll try to reach the team
2 years 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?
2 years ago
thats special
2 years ago
i think you need to be running on vercel's infra for that dont you?
Can u help me with how can i check if my traffic is going through pgbouncer ?
2 years ago
have you replaced the old database url in vercel with the one from pgbouncer?
2 years ago
according to the network metrics, looks like most data is still going to just the database
it's some config on my end - i'll handle it - if the team is ready will try moving to railway
2 years ago
you'd likely have to move off the edge functions first
2 years ago
but, i have to sign off for the night as its now 2:30am for me
2 years ago
thank you
2 years ago
!s
Status changed to Solved brody • over 1 year ago
