<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # PHP優化基礎 PHP優化基礎書: https://www.sitepoint.com/premium/books/performance-project ## 1,用Blackfire監控PHP性能問題 PHP-level Performance Optimization with Blackfire: 紅色排前面的就是性能問題所在: ![](https://img.kancloud.cn/b3/0c/b30c93187aa791cdc41531b08731dbb9_400x500.png) ***** ## 2,檢查Mysql性能 MySQL Performance Boosting with Indexes and Explain: ### show profiles看執行情況: As we can see, the?`show profiles;`?command gives us times not only for the original query but also for all the other queries that are made. This way we can accurately profile our queries. ![](https://img.kancloud.cn/76/5c/765c0f6b0472f76b59e8522137e0f50b_903x757.png) ### explain慢查詢: ![](https://img.kancloud.cn/2c/b7/2cb7d43ca6ad957c2e4a0cab875bd193_1344x688.png) ***** ***** ## 3,用GTmetrix工具檢查存在問題 Improving Performance Perception with Pingdom and GTmetrix: 例如: ### On-demand Image Resizing 圖片加載方面:用srcset ![](https://img.kancloud.cn/94/8e/948efe9e8780b2cbd04ca4cb980330db_1024x148.png) ***** ## 4,后臺任務異步化 Using Background Processing to Speed Up Page Load Times ![](https://img.kancloud.cn/cb/db/cbdb533855f301d5242e26d3f4a76fb8_1024x397.png) We're using the?[Beanstalkd](http://kr.github.io/beanstalkd/)?job queue to store jobs, the Symfony Console component to implement workers as console commands and?[Supervisor](http://supervisord.org/)?to take care of worker processes. ![](https://img.kancloud.cn/0a/75/0a75570a99c1ca5859062adbb21fd130_989x311.png) 異步的另一個好處:多任務多worker并行處理: The best part about background processing is the ease of parallel processing. We can set a?`numprocs=5`?directive and Supervisor will spawn five instances of our workers. ### 利用supervisor: ![](https://img.kancloud.cn/8c/df/8cdf0455a1da1d3986942ec0adca33cf_790x266.png) ***** ## 6,Nginx 和 PHP-FPM方面的優化 Server-side Optimization with Nginx and pm-static php-fpm :`dynamic`,?`ondemand`?and?`static`, 嘗試 使用:**static** https://www.sitepoint.com/server-side-optimization-with-nginx-and-pm-static/ tried the?`pm = static`?setting, allowing our PHP processes to take over the maximum of the server's resources, short of swapping, or driving the CPU to a halt. This setting means we're forcing the maximum out of our system at all times. It also means that — within our server's constraints — there won't be any spawning overhead time cost. ***** ## 7,頁面靜態化 Nginx and **fastcgi Caching** 動態php變成頁面靜態化 ![](https://img.kancloud.cn/91/84/918432147437d9ed0aa54b4613d72da2_1115x521.png) ![](https://img.kancloud.cn/ca/d8/cad81e8039e42cbfbd27cdcd9cbc7711_1013x978.png) 同時也可以使用**Cloudflare** 和 **varnish**。。 ### 有沒有其他方案? Cloudflare APO,[How to Set up Cloudflare APO for WordPress (kinsta.com)](https://kinsta.com/blog/cloudflare-apo-wordpress/)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看