D
Dokploy6mo ago
nithur

my postgres instance is too slow

I have a VPS in US region. And I am trying to connect to it from Asia. The db is so slow. Writing 8000 records to it takes more than 45 minutes. And trying to read it from takes too much time as well, it's connection is timing out. Anyone faced this issue? what am i missing?
7 Replies
Uberzeek
Uberzeek6mo ago
when you ping the ip of the vps what's the response time?
nithur
nithurOP6mo ago
No description
nithur
nithurOP6mo ago
I think the ping time is normal for an US to Asia communication, right? so, my postgres db is slow because of this? is there any optimizations I could do? So, I tested how it works with an app deployed in the same region and the results look good to me also what is the use of internal connection url? when i tried to connect with the app in the same project using internal url, it is working. I had to use external connection url
Siumauricio
Siumauricio6mo ago
Yes
nithur
nithurOP6mo ago
Thank you @Siumauricio can you please explain this?
Siumauricio
Siumauricio6mo ago
If it's in runtime the internal connection will work, if it is in buildtime it will not work, you can read here https://github.com/Dokploy/dokploy/issues/507
GitHub
Connecting Next.js with server actions to database with Internal Co...
To Reproduce After I created the Next application and deployed it to Dokploy and connected to the Dokploy database (PostgreSQL), communication works if I connect via an external connection string, ...
Siumauricio
Siumauricio6mo ago
Basically by moving the database to the same region where your services are located This way the waiting time will be much shorter

Did you find this page helpful?