Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

unaor's avatar
Level 1

Laravel 11 application extremly slow when using external database

I have a simple laravel application, and i only change the db settings via the .env file when im using local db (127.0.0.1) everything is extremly fast i logged the query time and it can be seen here: [2024-06-12 22:05:42] local.INFO: select * from w_users where id = ? limit 1 {"bindings":[1],"time":4.1} [2024-06-12 22:05:42] local.INFO: select * from w_users where w_users.id = ? limit 1 {"bindings":[1],"time":1.49}

later i switched to an external db provider (digital ocean) and i noticed that the page is very slow here are the results i logged: [2024-06-12 22:07:03] local.INFO: select * from w_users where id = ? limit 1 {"bindings":[1],"time":1228.27} [2024-06-12 22:07:03] local.INFO: select * from w_users where w_users.id = ? limit 1 {"bindings":[1],"time":352.72}

i tried several cloud db vendors but its always extremly slow what can be done?

0 likes
3 replies
jlrdw's avatar

I suggest looking over DIgital Oceans help articles and make sure all is setup correctly first. Their articles has helped me a great deal.

unaor's avatar
Level 1

i actually tried with several vendors, (RDS, digital ocean, cloudclusters) always getting these results, my local development db is running inside a docker image if it helps

jlrdw's avatar

@unaor Try a setup with no docker and compare the difference.

Please or to participate in this conversation.