I suggest looking over DIgital Oceans help articles and make sure all is setup correctly first. Their articles has helped me a great deal.
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?
Please or to participate in this conversation.