Laravel5.1's website has no business logic, and it feels very slow!

Source: Internet
Author: User
Laravel5.1's website has no business logic, and it feels very slow! Laravel 5.1's website has no business logic and feels very slow!

The problem has been disabled. cause: the problem cannot obtain the exact result.

Reply content:

Laravel 5.1's website has no business logic and feels very slow!

Consider these issues

  1. Webpage content inclusion

    • Server master file (the url you requested)
      The loading of this file is related to the server performance, that is, the performance of the Inclusion Framework, server performance/response speed, database read speed (mysql optimization, database query), network, and dns resolution speed.

    • Server resource files (css, js, images, images used by css, and font files loaded through the main url)
      This is a resource file, which is generally not directly related to server performance. It is to load the resource file directly to your machine without any php processing, this slowness cannot be attributed to php. this is related to IO, network, and server response.

  2. The loading speed of the master file on the first server is divided into the following parts: We open Google's network debugging analysis, this is my local speed laravel 5.1.35, no cache (optmize, route cache)


For details, see understanding resource timing.
Initial connection: client queue/client latency/initial proxy request
Server Response: request sending/ttfb (server waiting)/content download

The ttfb here is the response speed of our server, which includes

  1. Server processing of PHP (php processing/parsing speed)

  2. File I/O loading during php processing (disk read speed)

  3. Framework resolution speed
    The question you asked should be the third small problem in the second step. The framework resolution speed. The framework resolution can be optimized in the following ways:

Optimization command

Php artisan route: cache # route cache php artisan optmize -- force # program loading Optimization

Optimization comparison:
Before optimization:

After optimization:

  1. Hope to answer questions

The business logic is self-written. laravel is only a luxurious house and the decoration depends on itself.
If it is slow, is there no cache:
Artisan config: cache
Artisan route: cache
Artisan optimize
Composer dumpautoload
...

The website bottleneck lies in I/O, and php performance problems can be basically ignored.
The website bottleneck lies in I/O, and php performance problems can be basically ignored.
The website bottleneck lies in I/O, and php performance problems can be basically ignored.


It will be faster with nodejs.
From http://www.hostingadvice.com/blog/comparing-node-js-vs-php-performance/

However, when writing business logic, it is time to complain about slow development efficiency.

Slow, you need to find out where "slow" is and what is the performance bottleneck.

It may be that front-end rendering is slow.
The network may be slow.
It may be that your server is slow.
Maybe your program is faulty.
It may be that your SQL statement is slow.
It may be a problem with your system design.
It may be that your database is slow.
It may be the disk residue of your server.

Don't take the trouble to blame PHP.

Support @ jock is generally slow not because of the framework, but because it is not used by itself. The framework can be opened, and it is generally modified and maintained multiple times.

I don't know where you are talking about. I didn't know the problem, and I couldn't help you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.