The newly installed Laravel, only outputs one sentence, so why does it take more than two seconds to return the result?

laravel takes more than two seconds to return the result with only one sentence output.

the local environment is installed with Docker for Mac. The php7, laravel version is 5.7

.

this is the result viewed with debugbar

php-fpm

Jan.11,2022

mac's docker volumn contains the IO problem. Google for this problem, there are a bunch of solutions


the problem has been solved. Thank you. The answer of
@ to2false is correct. The problem lies in the volumn of Mac. The container on Mac will have a short delay in requesting the files of the host, while laravel will load hundreds of files even if it outputs only one sentence. As a result, the running time of laravel is very long, and sometimes it takes more than 5 seconds to return the result, which is simply unbearable.

the easiest way is to use caching by adding the : cached parameter after the-v parameter, for example:

docker run --name php71 -d -v /workspace:/workspace:cached php:7.1-fpm
The

cached parameter caches the host's files into the container, and the container uses the internal cache instead of the files on the host, so there will be no problems.


you can turn on route caching and configure caching and try again.
each request reloads the configuration file and routing configuration, which may be slow.

  • How to configure xdebug? under laradock

    system environment windows 10 php version: 7.2.4 IDE: PHPSTORM current progress xdebug extensions for workspace and php-fpm in laradock have been enabled. browser has installed xdebug helper debugging process you understand after opening xd...

    Apr.02,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38325-344a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38325-344a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?