W
W
WebDev2014-08-30 21:44:36
MySQL
WebDev, 2014-08-30 21:44:36

Request processing speed in Laravel?

Faced the problem of too long request processing in Laravel.
An average query with multiple JOINs takes 4-6 seconds. If you execute this request directly in phpMyAdmin, then it takes 0.1 seconds. Decided to test the same query in php_mysql. Created a table with 10 text fields, filled in 900 fields.
Fulfilled request SELECT * FROM table.
In Laravel, the query takes 5 seconds,
In PHP (mysql_query) - 5.4 seconds,
In phpMyAdmin - 0.18 seconds.
What am I doing wrong? Or is that how it should be? Naturally I use caching, and subsequent requests will be instant, but should the first request be so resource-intensive?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-08-30
@kirill-93

laravel has a profiler, no? As I understand it, you measured the time of the request to the server, and not to the database.
If you measured exactly the time of the request, I suspect that due to the lazy connection, the time of this is also taken into account. 99% that you have problems with DNS resolution. Write in the connection settings with the database instead of localhost 127,0,0,1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question