When connecting to a remote MySql server (local network), each database query takes 20-30-40 or more milliseconds. Both first and subsequent requests, so it's not a cache issue. When executed on the remote server (phpMyAdmin), the query runs blazing fast, under 1millisecond. Queries are very, very simple: select * from users
where id
= '1' limit 1
This would not be a big issue if you'd have 2 or 3 queries, but when you have 10-20 or even 500 queries, this is a problem.
A similar CodeIgniter application, connecting to the same remote MySql server, runs 20 times (or more) faster. So this is not a MySql issue.
Both Laravel and Codeigniter are executed from a vagrant environment (CentOS 6.5), connecting to a remote database in the same network.
I've tried to exclude the application layer from this and setup a test like this:
Laravel completes in 13 seconds. CodeIgniter in 0.4 seconds
As soon as I switch the connection from remote IP to localhost, Laravel performs very fast, under 100milliseconds.
Trying to exclude a faulty vagrant machine, I've tried with Ubuntu. Same results.
Am I missing something related to remote mysql connections?
An image with queries sent from Laravel to remote server: https://www.dropbox.com/s/6csdhwi4zexstun/mysql-queries.png
An image with queries sent from Laravel to localhost: https://www.dropbox.com/s/qiebqy0bmzqfapa/mysql-queries-localhost.png
Hi mate, I am having same issues and nobody answer anything. Have you found anything to improve the query performance? http://laravel.io/forum/02-26-2015-another-question-regarding-performance?page=1#reply-21639
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community