Laravel 5.1 Do the website, there is no business logic, feel very slow ah!

Source: Internet
Author: User
Keywords Php laravel
Laravel 5.1 Do the website, there is no business logic, feel very slow ah!

This issue has been turned off because of an issue where the exact result cannot be obtained

Reply content:

Laravel 5.1 Do the website, there is no business logic, feel very slow ah!

We should start with these aspects to consider the problem

    1. Page load content contains

      • Server main file (the URL address you requested)
        The loading of this file is related to server performance, which includes the performance of the framework, server performance/response speed, database read speed (MySQL optimization, database query), network, DNS resolution speed

      • Server resource files (css,js, pictures, CSS images, font files, etc. loaded via the main URL address)
        This is a resource file, general and server performance is not too direct relationship, is to load the resource files directly onto your machine, without any PHP processing, this slow can not be blamed on PHP. This is related to IO, network, server response

    2. About the first server main file load speed divided into the following parts of the resolution, we open Google's network debug analysis, this is my native speed Laravel 5.1.35, did not do any cache (Optmize,route cache)


The contents of this section are contained in detail understanding resource timing
Connection Initial part: Client queue/Client delay/proxy request initial
Server Response section: Request Send/TTFB (server wait)/content Download

The TTFB we see here is the response speed of our server, which contains

    1. Server-to-PHP processing (PHP processing/parsing speed)

    2. Io loading of files during PHP processing (disk read speed)

    3. Frame resolution Speed
      You ask the question should be the second step of the third small problem, frame resolution speed, wherein the framework of the analysis can be the following several optimization methods

Optimization commands

php artisan route:cache   # 路由缓存php artisan optmize --force       # 程序加载优化

Optimization comparison:
Before optimization:

After optimization:

    1. Want to answer questions

Business logic is self-written ah, Laravel only a luxury house, decoration to rely on their own.
Slow words are not without the various caches:
Artisan Config:cache
Artisan Route:cache
Artisan optimize
Composer Dumpautoload
。。。

The bottleneck of the website in io,php performance problem can be ignored basically.
The bottleneck of the website in io,php performance problem can be ignored basically.
The bottleneck of the website in io,php performance problem can be ignored basically.


Change the Nodejs, it's almost there.
From http://www.hostingadvice.com/blog/comparing-node-js-vs-php-performance/

But when it comes to writing business logic, it's time to complain about slow development.

Slow, you have to go to the location "slow" where the performance bottleneck is.

may be slow front-end rendering
Maybe the network is slow
Maybe your server is slow.
Could be a problem with your program.
Maybe your SQL is slow
Might be a problem with your system design.
Maybe your database is slow.
It could be your server disk slag.

Don't be slow to blame PHP.

Support @jock generally slow is not because of the framework, but they do not use, the framework can be open, generally through the modification and maintenance of n times

Don't know what you're talking about is slow, the problem is not clear, can not 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.