Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Let your PHP 7 faster (GCC PGO)     - Linux system security check method (Linux)

- CentOS 6.4 RPM install MySQL-5.6.22-1 (Database)

- Experience RHEL7 new features (Linux)

- Replace font under Linux (Linux)

- ntop monitoring software configuration and installation (Linux)

- sed and awk in shell usage and some examples (Linux)

- Linux scheduling summary (Linux)

- C language programming entry - Common operators (Programming)

- DataGuard Standby backup error RMAN-06820 ORA-17629 to solve (Database)

- Hadoop2.6.3 build clusters and the development of MapReduce WIN7 by Eclipse on Linux demo (Server)

- Ubuntu 14.04 installed NVIDIA graphics driver (Linux)

- Hive handle count distinct inclination to produce data processing (Database)

- Linux OOM killer mechanism (Linux)

- Linux kernel TCP / IP parameters analysis and tuning (Linux)

- Use HugePages optimize memory performance (Database)

- How to import JNI resulting .so libraries in Android Studio (Programming)

- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)

- Android recyclerview cardview (Programming)

- Docker study notes (Server)

- Linux system installation and usage instructions Wetty (Linux)

 
         
  Let your PHP 7 faster (GCC PGO)
     
  Add Date : 2018-11-21      
         
         
         
  We're always working to improve performance PHP7 of last month, we note that the GCC PGO on Wordpress can bring nearly 10% performance boost, this makes us very excited.

However, PGO as the name implies (Profile Guided Optimization interested can Google), he needs to use a number of use cases to get feedback, that this is the need to optimize a particular scene and binding.

You optimize a scene, perhaps in another scene on a backfire. It is not a common optimization. So we can not simply contains these optimizations can not directly publish PGO compiled PHP7.

Of course, we are trying to find some common optimization from PGO, and then manually Apply to PHP7 up, but this obviously can not do specifically optimized for a scene that can be achieved, so I decided to write this article a brief introduction how to use PGO compiled PHP7, so that you can compile PHP7 special make your own independent applications faster.

First, decide what means is the scene to Feedback GCC, we usually choose: you want to optimize the scene: the most visited, most time-consuming, resource consumption heaviest one page.

Take Wordpress as an example, we have chosen Wordpress home (because Home is often the most visited).

We my machine as an example:

       Intel (R) Xeon (R) CPU X5687 @ 3.60GHz X 16 (Hyper-Threading),
       48G Memory
php-fpm using a fixed 32 worker, opcache default configuration (must remember to load opcache)

In order to optimize the scene .. wordpress 4.1

First, we have to test the performance of the current WP PHP7 of (ab -n 10000 -c 100):

$ Ab -n 10000 -c 100 http://inf-dev-maybach.weibo.com:8000/wordpress/
This is ApacheBench, Version 2.3 <$ Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
 
Benchmarking inf-dev-maybach.weibo.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
 
Server Software: nginx / 1.7.12
Server Hostname: inf-dev-maybach.weibo.com
Server Port: 8000
 
Document Path: / wordpress /
Document Length: 9048 bytes
 
Concurrency Level: 100
Time taken for tests: 8.957 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 92860000 bytes
HTML transferred: 90480000 bytes
Requests per second: 1116.48 [# / sec] (mean)
Time per request: 89.567 [ms] (mean)
Time per request: 0.896 [ms] (mean, across all concurrent requests)
Transfer rate: 10124.65 [Kbytes / sec] received
Wordpress 4.1 is currently visible on the machine, the QPS Home can to 1116.48. That is so many requests per second can be processed on the homepage,

Now, let us begin to teach GCC, so he ran Wordpress4.1 compile faster PHP7 come, first requires GCC 4.0 or later, but I suggest that you use GCC-4.8 or later (now the GCC-5.1).

The first step is to download PHP7 natural source, and then do ./configure. These are no different

Then there is the distinct place, we must first build a first pass PHP7, it will have to generate an executable file profile data:

$ Make prof-gen
Note that we use the prof-gen argument (this is the Makefile PHP7 unique, do not attempt to do so on other projects ha :))

Then, let's start training GCC:

$ Sapi / cgi / php-cgi -T 100 /home/huixinchen/local/www/htdocs/wordpress/index.php> / dev / null
Let php-cgi is run 100 times wordpress home to generate some of the profile information in this process.

Then we start the second compilation PHP7.

$ Make prof-clean
$ Make prof-use && make install
Yes, it's that simple, PGO compiled, and now we look at the performance of PGO compiled after PHP7:

$ Ab -n10000 -c 100 http://inf-dev-maybach.weibo.com:8000/wordpress/
This is ApacheBench, Version 2.3 <$ Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
 
Benchmarking inf-dev-maybach.weibo.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
 
Server Software: nginx / 1.7.12
Server Hostname: inf-dev-maybach.weibo.com
Server Port: 8000
 
Document Path: / wordpress /
Document Length: 9048 bytes
 
Concurrency Level: 100
Time taken for tests: 8.391 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 92860000 bytes
HTML transferred: 90480000 bytes
Requests per second: 1191.78 [# / sec] (mean)
Time per request: 83.908 [ms] (mean)
Time per request: 0.839 [ms] (mean, across all concurrent requests)
Transfer rate: 10807.45 [Kbytes / sec] received
Now it can handle 1191.78 per QPS, and ascension to 7%. Not bad ha (Hey, did not you say that 10% of it? How to 7% of the? Oh, as I said before, we do try to analyze PGO something optimization, optimization and then put some generic manual Apply to PHP7 in. so to say, that to 3% more generic optimization has been included to PHP7 inside, of course, the work continues).

So it's that simple, we can use their products classic scenes to train GCC, simple steps, get promoted, why not do it
     
         
         
         
  More:      
 
- xargs Detailed description (Linux)
- Linux file permissions chmod chown (Linux)
- Detailed installation OpenCV2.3.1 under CentOS 6.5 (Linux)
- Ubuntu Locale configuration problem solving Can not set LC_CTYPE (Linux)
- Ubuntu 14.04 installation configuration GNOME Classic interface (Linux)
- VirtualBox install Windows 8.1 has encountered an error 0x000000C4 solutions (Linux)
- Use libcurl library download url image (Programming)
- Customize the 404 error page Nginx (Server)
- Linux kernel boot to retain large memory method summary (Linux)
- Linux operating system security tools of the Logs (Linux)
- Linux environment variable configuration and save places (Linux)
- Spring inject a type of object to enumerate (Programming)
- History and Statistics tuptime use tools to view Linux server system boot time (Server)
- LAMP and LNMP automated installation scripts (Server)
- Android custom slideshow menu slidmenu (Programming)
- RAID configuration and management under linux (Server)
- Java singleton mode (Singleton mode) (Programming)
- Sleuth Kit: used to analyze a disk image and restore files open source forensics tools (Linux)
- CentOS6 5 source compiler installation Hadoop2.5.1 (Server)
- How to clear the DNS query cache under Linux / Unix / Mac (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.