PHP Framework Performance test Report, PHP Framework performance Test _php Tutorial

Source: Internet
Author: User
Tags connection reset

PHP Framework Performance test Report, PHP framework performance test

As a PHP developer and a technology developer for a start-up team, choosing a development framework is a tough thing to do.

With thinkphp, recruiting a developer who just came out of the training organization can get started, but performance and later code decoupling is a headache. However, many third-party functions do not need to write their own, many Daniel has paved the way.

With laravel words, the legend is very cool to write, but the cost of learning is a bit high, you can not give junior developers half a month to learn the framework bar. And it is said that the lake people revealed that laravel performance is not good, the document is not particularly rich.

With yii words, grammar a bit verbose, front and rear code separation a little trouble, but the performance is very good, and there are many large domestic companies in use, there are accidents can quickly find Daniel answers.

As a simple performance evaluation, choose a performance of the total will not be wrong

Performance testing
Test Date: May 06, 2016
Test tool: Siege (because the AB of Mac system always appears pr_socket_recv:connection reset by peer (54) error, so selected siege)
Test machine: MacPro Core i5 processor/8GB Memory/256GB SSD Flash
Test environment: Apache PHP5.6
Framework version: thinkphp 3.2.3 Laravel 5.2 Yii2.0.5
Test principle: 5 times per test cycle, medium data
Additional note: All projects are made in sub-directories

Result description

Transactions:        Total number of 2119 hits processing requests availability:        96.85 availability Elapsed        time: 9.74 secs runtime data transferred:      1.31 MB Data Transfer response time:        0.60 secs response times Transaction rate:     217.56 trans/sec per second processing efficiency throughput:        0.13 mb/sec Processing data per second concurrency:       130.28 Concurrent Successful transactions:    2162 Successful request failed transactions:       69 failed request longest Transaction:      2.85 maximum single request shortest transaction:      0.01 Shortest single request

Start testing

Add a controller and enter 10,000 times in the controller HelloWorld

Concurrent 50 Loops 10 times:

The first thing that comes to us is thinkphp, it looks fine.

Transactions:         hitsavailability:       100.00%elapsed time:        2.81 Secsdata transferred:      52.45 Mbresponse time:        0.26 secstransaction rate:     177.94 trans/secthroughput:        18.67 mb/secconcurrency:        47.10Successful transactions:     500Failed transactions:        0Longest transaction:      0.48Shortest transaction:      0.03

And then Laravle, um, slightly disappointed.

Transactions:         hitsavailability:       100.00%elapsed time:        13.33 Secsdata transferred:      52.45 Mbresponse time:        1.27 secstransaction rate:      37.51 trans/secthroughput:        3.93 mb/secconcurrency:        47.55Successful transactions:     500Failed transactions:        0Longest transaction:      3.64Shortest Transaction:      0.07

The last pre-match yii that was more bullish

Transactions:         hitsavailability:       100.00%elapsed time:        4.84 Secsdata transferred:      52.45 Mbresponse time:        0.46 secstransaction rate:     103.31 trans/secthroughput:        10.84 mb/secconcurrency:        47.65Successful transactions:     500Failed transactions:        0Longest transaction:      0.88Shortest transaction:      0.04

Concurrent 200 Loops 10 times:

First, thinkphp.

Transactions:        1977 hitsavailability:        98.85%elapsed time:        10.03 Secsdata transferred:     207.40 Mbresponse time:        0.95 secstransaction Rate:     197.11 trans/secthroughput:        20.68 mb/secconcurrency:       187.68Successful transactions:    1977Failed transactions:       23Longest transaction:      1.22Shortest Transaction:      0.02

And then the Laravel.

Transactions:        1890 hitsavailability:        94.50%elapsed time:        51.85 Secsdata transferred:     198.27 Mbresponse time:        4.88 secstransaction rate:      36.45 trans/secthroughput:        3.82 mb/secconcurrency:       178.00Successful transactions:    1890Failed transactions:       110Longest transaction:      26.01Shortest Transaction:      0.07

And finally, Yii.

Transactions:        1996 hitsavailability:        99.80%elapsed time:        18.95 Secsdata transferred:     209.39 Mbresponse time:        1.79 secstransaction rate:     105.33 trans/secthroughput:        11.05 mb/secconcurrency:       188.57Successful transactions:    1996Failed transactions:        4Longest transaction:      3.29Shortest Transaction:      0.10

Unexpectedly in the absence of optimization, thinkphp speed is the fastest, yii a little more, Laravel hobbled run out of the test. The result is somewhat unexpected, but the above test represents only the development environment, and the framework is optimized to simulate the online environment.

Optimization framework


App_debug Change to False


App_debug instead of falsephp artisan route:cachephp artisan optimizephp Artisan config:cachecomposer Dumpautoload-o


Yii_debug Change to False
Composer Dumpautoload-o
Concurrent 200 Loops 10 times:


Transactions:        1655 hitsavailability:        82.75%elapsed time:        8.21 Secsdata transferred:     173.62 Mbresponse time:        0.69 secstransaction rate:     201.58 trans/secthroughput:        21.15 mb/secconcurrency:       139.29Successful transactions:    1655Failed transactions:       345Longest transaction:      7.83Shortest Transaction:      0.00


Transactions:        1520 hitsavailability:        76.00%elapsed time:        34.95 Secsdata transferred:     159.45 Mbresponse time:        3.15 secstransaction rate:      43.49 trans/secthroughput:        4.56 mb/secconcurrency:       136.84Successful transactions:    1520Failed transactions:       480Longest transaction:      19.18Shortest Transaction:      0.00


Transactions:        1704 hitsavailability:        85.20%elapsed time:        15.16 Secsdata transferred:     178.76 Mbresponse time:        1.46 secstransaction rate:     112.40 trans/secthroughput:        11.79 mb/secconcurrency:       164.21Successful transactions:    1704Failed transactions:       296Longest transaction:      9.04Shortest Transaction:      0.00

Oddly enough, when the framework turns off debug mode, there are more failures. However, it is obvious that the performance of Laravel is greatly improved after simple optimization, but it is still lower than the other two frameworks.


In the process of testing, other my mood is depressed, feel their own three-view world has collapsed, collapse to slag.

thinkphp performance is one-fold higher than yii, nearly four times times higher than laravel
The performance of Yii is moderate, but in the test it is obvious that request failure is less than the other two frames
Laravel is still elegant, but the performance is worrying, using the words of the netizen to describe the more studious people die

At last

My project finally used a self-built framework for development, thanks to the strong composer, the development process was very smooth, and finally attached to its own framework in 200 concurrent 10 cycles of data, framework open source But the update is busy, welcome to search ppphp on GitHub, and I build the framework.

Transactions:        1672 hitsavailability:        83.60%elapsed time:        6.18 Secsdata transferred:     175.40 Mbresponse time:        0.57 secstransaction rate:     270.55 trans/secthroughput:        28.38 mb/secconcurrency:       153.16Successful transactions:    1672Failed transactions:       328Longest transaction:      4.57Shortest Transaction:      0.01 true techarticle PHP Framework Performance test Report, PHP framework performance testing as a PHP developer, and a technology developer for a start-up team, choosing a development framework is a tough thing to do. With thin ...

  • Related Article

    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: 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.