About PHP Performance optimization

Source: Internet
Author: User

Shown as 100 concurrent, request 1000 times Destination Address

To test

The most important two parameters:requests per second : Receive requests per second, where 101 requests per second

         Time perrequest: How long a request takes, here is 9 milliseconds

The larger the first parameter, the better, the smaller the second parameter, the better.

Optimization method of language-level performance optimization 1

PHP Code Execution Flow:

PHP code through the Zend Engine line by scan, become the Zend engine can understand the syntax, transcoding parsing into opcodes, after execution output

If you use the built-in function more quickly, the time will be much faster in scanning and understanding, opcodes will be less, execution will be fast.

Optimization method of language-level performance optimization 2

Optimization method of language-level performance Optimization 3

Test

The time PHP file name can be executed with a focus on the user value, which is 24 milliseconds

Optimization method of language-level performance Optimization 4

Optimization method of language-level performance optimization 5

Optimization method of language-level performance optimization 6

Optimization method of language-level performance optimization 7

It's better to change it.

optimization method for language-level performance optimization 8

Optimization method of language-level performance optimization 9

optimization method of peripheral problem performance optimization

Optimization method of peripheral problems performance Optimization 1

Common PHP Scenario Overhead order: Read/write memory << read/write database (read and write HDD) < read and write disk < read and write network data (stealth cost: Network latency)

Optimization method of peripheral problems performance optimization 2

Optimization method of peripheral problems performance Optimization 3

Optimization method of peripheral problems performance Optimization 4

Optimization method of peripheral problems performance Optimization 5

Parallel change serial

< Strong> Optimization method perimeter problem performance Optimization 6

< Strong> xhprof tool parsing PHP performance

This command checks to see if the software is installed

Use diagram:

php Performance bottleneck method

/strong>

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.