After ~500 requests project timeouts in every request (kinda urgent).

Hi, I have a Strapi-Postgres project. After ~500 requests, to generate individual static pages for each entry with Next.js, I cannot access the project anymore, every request timeouts. It shows both Strapi and Postgres as active deployments, but they don't respond I tried redeploying / restarting https://fda-strapi.up.railway.app
Solution:
you can add more replicas to spread out the load
Jump to solution
38 Replies
Percy
Percy2mo ago
Project ID: ef73b672-1bce-4cbc-a2c1-441bb7dd0112
bmariano
bmarianoOP2mo ago
ef73b672-1bce-4cbc-a2c1-441bb7dd0112
ThallesComH
ThallesComH2mo ago
hey, little confused, your strapi project is scraping (visiting each entry) in your nextjs project?
bmariano
bmarianoOP2mo ago
No.. Strapi works only as a CMS/API. I built my Next.js app locally and suddenly Strapi started to timeout, and I couldn't make any kind of request to it anymore
ThallesComH
ThallesComH2mo ago
maybe you got ip ban? Railway has a cringe ip ban if you do a lot of requests from the same IP
bmariano
bmarianoOP2mo ago
Well, It timed out from the server too...
bmariano
bmarianoOP2mo ago
No description
ThallesComH
ThallesComH2mo ago
its probably an IP ban then your nextjs spin up, do a lot of requests from the same vercel IP and gets ip ban
bmariano
bmarianoOP2mo ago
This is nonsense. They should just charge my project for the usage. What if I'd have a project making 500 request per second? What I'm supposed to do then?
ThallesComH
ThallesComH2mo ago
completely agree, nonsense to ban ip for a lot of requests tbh i've no idea on how you can solve that, maybe deploy your nextjs project to Railway and use private networking? There's tailscale but I doubt its possible to spin up Tailscale in Vercel in a easy way this should be something for the team to lookup if possible, IMO its a platform problem
bmariano
bmarianoOP2mo ago
Now it's responding. Anyways, how I'm supposed to generate the 600 static pages...
ThallesComH
ThallesComH2mo ago
or if maybe nextjs offers a way to throttle the static pages generation
bmariano
bmarianoOP2mo ago
They could actually be 5000. It's a matter of time Yes, I'll take a look
ThallesComH
ThallesComH2mo ago
as long as you don't do a lot in a short time, it should work, it'll probably be painful slow tho
Brody
Brody2mo ago
thalles gave a very good answer -
deploy your nextjs project to Railway and use private networking
these are logs from vercel, when you see these logs, are you still able to access strapi from your own local computer?
bmariano
bmarianoOP2mo ago
Already tried to deploy Next.js to Railway. A site with 50 users per day would make the project cost $5 - $10 per month... that's why a pay for Vercel for that. I'd love to just deploy everything in Railway
bmariano
bmarianoOP2mo ago
In my PC it was the same, for a moment
No description
Brody
Brody2mo ago
then its not an ip ban.. unless you live inside the aws data center?
ThallesComH
ThallesComH2mo ago
and btw, can you still access the strapi through the browser after that happens?
bmariano
bmarianoOP2mo ago
I couldn't access the strapi admin for about 10 minutes. Now I can https://fda-strapi.up.railway.app
Brody
Brody2mo ago
thats not a ban then, thats strapi locking up
bmariano
bmarianoOP2mo ago
Yes.. that's what I thought
ThallesComH
ThallesComH2mo ago
maybe its not? @bmariano are u still not able to access?
Solution
Brody
Brody2mo ago
you can add more replicas to spread out the load
ThallesComH
ThallesComH2mo ago
try to run the nextjs static generation, when you get an ip ban lmk that i'll try to access the strapi url if it works for me then its an ip ban
bmariano
bmarianoOP2mo ago
Brody said it's not
Brody
Brody2mo ago
they cant access it from their own computer after running a build on vercel that would be two different ips
ThallesComH
ThallesComH2mo ago
oh from vercel? got it wrong then
bmariano
bmarianoOP2mo ago
I said "from the server" but yes, it was Vercel
Brody
Brody2mo ago
yeah these are vercel logs go ahead and up the replica count to 3
bmariano
bmarianoOP2mo ago
. I'll try and let you know, give me a moment Will that make it more expensive?
Brody
Brody2mo ago
while running next on railway wont help elevate any load from strapi, what is stopping you from deploying next to railway? slightly yes, since its running 3x of your strapi apps
bmariano
bmarianoOP2mo ago
Now I have like... 15 projects in Railway. ~12 have a Strapi and a Postgres DB. Once I thought that, I could bill to my clients exactly what I pay by just deploying everything in Railway since it has usage-based pricing, different from Vercel. When I added the Next.js app to the project, the pricing basically doubled even they had ~1000 users per month I did that with 2 projects I think
Brody
Brody2mo ago
so what you are saying is that next on railway costs more than next on vercel given your current user base?
bmariano
bmarianoOP2mo ago
Yes, I pay the $20 of Vercel and I have 50 Next apps there. Some apps are used by 50k users/m, others are simple websites for 200 users
Brody
Brody2mo ago
okay thats fair, thanks for sharing
bmariano
bmarianoOP2mo ago
I'll try increasing the replicas and let you know here, thank you
Brody
Brody2mo ago
sounds good
Want results from more Discord servers?
Add your server