Laravel is very fast locally and slow in the background as soon as it is launched. Why?

clipboard.png
the project is very fast locally. After it is deployed to the server, there will be problems with online access. Sometimes it will come out after visiting 0.1s, and sometimes it will show "connecting" all the time. It took more than ten seconds to come out. I don"t know if it is a problem with the server or the domain name mapping. Please ask for help

.
Mar.02,2021

sometimes it comes out in 0.1s, and the local problem you mentioned can basically eliminate the slow running of the project.
if the fast running of the project means that the server is OK, then the main problem is the network:

there are several problems to troubleshoot:

  1. DNS query speed
  2. you can use network problems (you can switch to 4G networks, ask friends to test, or check with some online tools)
  3. whether the execution of the project is blocked (such as slow connection to the database)

see if the slow-loading page introduces too many static resources


is connecting, and the title is not coming out, is it? Dns parsing problem.


chrome debugging panel to see which network, request is specific
local and online environment


should be a Ssl problem. You can first turn off Ssl and use Http to access
and then encounter occasional long connections after using Ssl, indicating that the connection has been reset (I don't know why)
but it's fine after a period of time.


Open the console to see which part of the request is slow


I guess the php-fpm you installed does not change the default setting ~ the default is the development configuration, and the number of supported requests is very small.

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-1ea01af-1aae.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-1ea01af-1aae.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?