PHP Async HTTP Client Benchmarks: Measure the performance of different HTTP clients

Recommend this page to a friend!
  Info   View files Documentation   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-05-02 (7 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 62 All time: 9,808 This week: 209Up
Version License PHP version Categories
php-async-benchmarks 1.0.0MIT/X Consortium ...7.4HTTP, Statistics, Performance and opt..., P...
Description Author

This package can measure the performance of different HTTP clients.

It can measure how long it takes to send HTTP requests to remote servers and save responses to a files using different HTTP client packages.

Currently it supports testing HTTP clients that use React PHP, Amphp and Guzzle.

Innovation Award
PHP Programming Innovation award nominee
May 2020
Number 8
There are many PHP packages that can be used to send HTTP requests to remote servers asynchronously.

This means that the same PHP script can send many HTTP requests at the same time, thus taking less time to get the remote HTTP responses.

This package provides means to measure and compare the performance of several packages that can send the asynchronous HTTP requests.

Manuel Lemos
Picture of Insolita
  Performance   Level  
Name: Insolita <contact>
Classes: 7 packages by
Country: Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 5x

 

Details

PHP Async Clients benchmark (Amphp, ReactPHP, Guzzle)

Articles with explanation [[ENG]](https://dev.to/insolita/which-http-client-is-faster-for-web-scraping-c95) [[RUS]](https://medium.com/@DonnaInsolita/%D0%B2%D0%B4%D0%BE%D1%85%D0%BD%D0%BE%D0%B2%D0%B8%D0%B2%D1%88%D0%B8%D1%81%D1%8C-%D0%B7%D0%B0%D0%BD%D0%B8%D0%BC%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%BC-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B2%D1%8C%D1%8E-%D0%BD%D0%B0-%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%D0%B5-moreview-c-%D1%81%D0%B5%D1%80%D0%B3%D0%B5%D0%B5%D0%BC-%D0%B6%D1%83%D0%BA%D0%BE%D0%BC-%D0%B8-%D1%86%D0%B8%D0%BA%D0%BB%D0%BE%D0%BC-%D1%81%D1%82%D0%B0%D1%82%D0%B5%D0%B9-fast-web-f9715b21517f)

Http request with saving data to file

Docker: Concurrency = 25, iterations=10

|Num queries | Client | Min Time | Max Time | Avg Time | |------------|--------------|------------|------------|-----------| | 25 queries| | | | | | |guzzle(multicurl)|1.7345 | 2.3703 |1.8946 | | | amphp | 1.4945 | 2.2807 | 1.7511 | | | reactphp| 3.7657 | 4.1934 | 3.9941 | | 100 queries| | | | | | |guzzle(multicurl)| 5.6384 | 7.5598 | 6.0287 | | | amphp | 10.8207 | 12.8282 | 11.4251 | | | amphp (-c100) | 4.4791 | 24.4778 | 8.3344 | | | reactphp| 9.3227 | 9.7782 | 9.4414 | | 500 queries| | | | | | |guzzle(multicurl)|21.9477 |36.5856|28.8197| | | amphp | 101.1285 | 137.5680 |117.6780| | | reactphp| 21.2281| 31.7487|26.1375| | 2000 queries| | | | | | |guzzle(multicurl)|86.3061|139.7627 |115.9115| | | reactphp|86.6550 | 115.3414|104.7146| | 4000 queries| | | | | | |guzzle(multicurl)|248.9 | 260.0907 | 255.7737| | | reactphp| 208.5986 | 228.2414 | 217.3939 |

Production server

|Num queries | Client | Min Time | Max Time | Avg Time | |------------|--------------|------------|------------|-----------| | 25 queries| | | | | | |guzzle(multicurl)|1.5025 | 1.9986 |1.7009 | | | amphp | 1.4691 | 2.4819 | 1.7389 | | | reactphp| 7.0732 | 7.6412 | 7.1580 | | 4000 queries| | | | | | |guzzle(multicurl)| 135.9078 | 143.1398 | 139.3505 | | | reactphp| 95.6756 | 111.0209 | 98.6829 | | 6000 queries| | | | | | |guzzle(multicurl)| 177.1444 | 172.1199 | 174.07613 | | | reactphp| 139.5903 | 159.0747 | 146.9556 |

  Files folder image Files  
File Role Description
Files folder imagesrc (5 files, 2 directories)
Files folder image_docker (1 directory)
Accessible without login Plain text file docker-compose.yml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagebin (1 file)
Files folder imageclients (5 files)
  Plain text file Bench.php Class Class source
  Plain text file BenchDb.php Class Class source
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data
  Accessible without login Plain text file urls.csv Data Auxiliary data

  Files folder image Files  /  src  /  bin  
File Role Description
  Accessible without login Plain text file bench Example Example script

  Files folder image Files  /  src  /  clients  
File Role Description
  Plain text file Amphp.php Class Class source
  Plain text file Guzzle.php Class Class source
  Plain text file GuzzleDb.php Class Class source
  Plain text file ReactDb.php Class Class source
  Plain text file Reactphp.php Class Class source

  Files folder image Files  /  _docker  
File Role Description
Files folder imagecli (1 file)

  Files folder image Files  /  _docker  /  cli  
File Role Description
  Accessible without login Plain text file Dockerfile Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:62
This week:0
All time:9,808
This week:209Up

For more information send a message to info at phpclasses dot org.