{"id":25663492,"url":"https://github.com/bgeneto/php-frameworks-bench","last_synced_at":"2026-05-08T16:40:13.960Z","repository":{"id":222177096,"uuid":"756477783","full_name":"bgeneto/php-frameworks-bench","owner":"bgeneto","description":"Docker containers to benchmark several php frameworks","archived":false,"fork":false,"pushed_at":"2024-02-20T02:41:50.000Z","size":407,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T05:16:27.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgeneto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-12T18:34:55.000Z","updated_at":"2024-02-15T14:21:54.000Z","dependencies_parsed_at":"2024-02-18T21:34:36.568Z","dependency_job_id":null,"html_url":"https://github.com/bgeneto/php-frameworks-bench","commit_stats":null,"previous_names":["bgeneto/php-frameworks-bench"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bgeneto/php-frameworks-bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fphp-frameworks-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fphp-frameworks-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fphp-frameworks-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fphp-frameworks-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgeneto","download_url":"https://codeload.github.com/bgeneto/php-frameworks-bench/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fphp-frameworks-bench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32788743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T05:16:30.734Z","updated_at":"2026-05-08T16:40:13.916Z","avatar_url":"https://github.com/bgeneto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PHP Frameworks Benchmark\n\nThis project allows you to compare the performance of popular PHP frameworks like Laravel, Symfony, CodeIgniter, and others, in a standardized and reproducible environment using Docker containers. You can measure key metrics like Requests Per Second (RPS) and latency for each framework, running the same PHP code base.\n\n## Prerequisites:\n\n- Docker installed and running (https://docs.docker.com/desktop/)\n- Git installed and accessible (https://git-scm.com/downloads)\n\n## Supported Platforms:\n\n- Windows (WSL 2 backend)\n- macOS\n- Linux\n\n## Features:\n\n- Benchmark multiple PHP frameworks with the same code base.\n- Measure RPS and latency for each framework.\n- Easy to use Docker containers for consistent environment.\n- Customizable benchmark configuration.\n- Supports running on various platforms.\n\n## Getting Started:\n\n### 1.  Clone the repository:\n\n```bash\ngit clone https://github.com/bgeneto/php-frameworks-bench\n```\n\n### 2. Build the Docker images:\n\n```bash\ncd php-frameworks-bench\nbash ./build.sh\n```\n\n### 3. Check the installation\n\nTo check if everything installed correctly and is working as expected, you may need to edit your hosts file (``/etc/hosts` or `C:\\Windows\\System32\\drivers\\etc`) and add a line like this:\n\n```\n127.0.0.1       laravel.bench octane.bench codeigniter.bench codeigniter3.bench symfony.bench plainphp.bench\n```\n\n(or use a valid IP) Then open your preferred browser and navigate to: \n\n```\nhttp://codeigniter.bench:8080/benchmarking/info\nhttp://codeigniter3.bench:8080/benchmarking/info\nhttp://laravel.bench:8080/benchmarking/info\nhttp://octane.bench:8080/benchmarking/info\nhttp://symfony.bench:8080/benchmarking/info\nhttp://plainphp.bench:8080/benchmarking/info\n```\n\nIf everything went fine, you should see a standard `phpinfo()` page for each address above:\n\n![image](https://github.com/bgeneto/php-frameworks-bench/assets/473074/82b1fb4d-c1c6-46fb-ab46-ea919be10632)\n\n### 4. Run the benchmark:\n\nNow we are ready to run the benchmarks:\n\n```\nbash ./run-benchmark.sh\n```\n\n\n### 5. View the results:\n\nThe benchmark report (logs and html files) will be generated in the `results` directory. Some examples of the outputted report/graphics:\n\n![image](https://github.com/bgeneto/php-frameworks-bench/assets/473074/8b4e0db8-3d1f-48cc-b54a-c4e372fd6bdf)\n\n![image](https://github.com/bgeneto/php-frameworks-bench/assets/473074/8e16e038-92aa-4db5-80d6-0d27d5a69fbc)\n\n![image](https://github.com/bgeneto/php-frameworks-bench/assets/473074/0c542ae4-bde6-4cb3-99f1-886c342e3bc0)\n\n## Customization:\n\nYou can customize the benchmark by modifying the following files:\n\n- `frameworks.conf`: Define all the (installed) frameworks you would like to be benchmarked. If you are not interested in a framework, you can comment this file like this: \n\n  ```\n  #plainphp\n  #codeigniter3\n  codeigniter\n  symfony\n  laravel\n  ```\n\n- `benchmarks.conf`: Configure which benchmark test to run (available: `info hello api`).\n\n- `tests.conf`: Selects your desired benchmark testing tool, along with their command line options. You can also comment a benchmark tool you would not like to run (the only tool that will always run is the k6). The example below will run only the `wrk` (and `k6`) benchmarks:\n\n  ```\n  # run h2load RPS test\n  #h2load=--h1 --warm-up-time 5 -D 10 -c 100 -t 1 -T 5 -m 10\n  # run wkr latency and rps test\n  wrk=-c 100 -t 1 --timeout 5 -d 10 --latency\n  # run wrk2 latency test with constant RPS (requires at least 30s to be accurate!)\n  #wrk2=-R 500 -L -d 30s -t 10 -c 100\n  ```\n\nOther important settings are available in the `conf` folder. For example, if you would like to turn off OPcache, comment the respective line in the file `conf/php/conf.d/docker-php-extensions.ini` : \n\n```ini\nextension=zip\nextension=gd\nextension=gettext\nextension=intl\nextension=bcmath\nextension=mysqli\nextension=pdo_mysql\nextension=redis.so\n#zend_extension=opcache\n```\n\n## Tips/Troubleshooting:\n\n- If you are getting the following errors in `h2load` or `wrk` (or with any other benchmark tool): \n\n  ```\n  getaddrinfo() failed: Name does not resolve\n  unable to resolve plainphp.bench:8080 Name does not resolve\n  ```\n\n  Then you need to add the line below to your `/etc/hosts` (or `C:\\Windows\\System32\\drivers\\etc`):\n\n  ```\n  127.0.0.1      laravel.bench octane.bench codeigniter.bench codeigniter3.bench symfony.bench plainphp.bench\n  ```\n\n  And `./run-benchmark.sh` again. \n\n  \u003e The **./run-benchmark.sh** command may take around **30 minutes** to complete all tests, depending on the processing power of your server! You can decrease this time substantially by removing some tests in the tests.conf file or by removing some frameworks from frameworks.conf. You can also disable some benchmarking tools bt commenting the file benchmarks.conf. \n\n- It’s a good idea to check whether all docker containers are running and restart then if not:\n\n  ```bash\n  docker ps\n  docker compose down \u0026\u0026 docker compose up -d\n  ```\n\n  You can also check if all containers are responding as expected with `curl` command:\n\n  ```bash\n  curl -v http://laravel.bench:8080/benchmarking/hello\n  ```\n\n  The output should be something like this (for all frameworks, not only Laravel, just change the URL)\n\n  ```html\n  \u003c!doctype html\u003e\n  \u003chtml lang=\"en\"\u003e\n  \n  \u003chead\u003e\n      \u003cmeta charset=\"utf-8\"\u003e\n      \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n      \u003ctitle\u003eHello\u003c/title\u003e\n  \u003c/head\u003e\n  \n  \u003cbody\u003e\n      Hello, World!!!\n  \u003c/body\u003e\n  \n  \u003c/html\u003e\n  ```\n\n  Check also other end points: \n\n  ```bash\n  curl -v http://symfony.bench:8080/benchmarking/api\n  ```\n\n  If the api endpoint above fails, check whether the file `films.sql` were imported successfully to our database (Mariadb) container, this is done in the last line from our `./build.sh file`:\n\n  ```bash\n  docker exec -i mariadb_bench mysql -ubench -pbench bench \u003c ./src/db/films.sql\n  ```\n\n- You can change k6 settings using the template file available in `k6/script.template.js` \n\n- php-fpm settings are exposed in `conf/php-fpm.d/www.conf` if you want to change my defaults.\n\n- If Laravel Octane is not working for you, try to run those commands inside the php container: \n\n  ```\n  docker exec -it php_fpm_bench bash\n  cd octane\n  php artisan octane:install --server=swoole\n  ```\n\n  \n\n\n## License:\n\nThis project is licensed under the GNU GPLv3 License.\n\n\n## Contributing:\n\nWe welcome contributions! Please see the CONTRIBUTING.md file for guidelines on how to contribute.\n\n\n## Additional Notes:\n\n- This project is a work in progress and may be subject to changes.\n- We encourage you to contribute your own benchmarks and test cases.\n- Please provide feedback and suggestions through pull requests or issues.\n\n\n\n**I hope this helps! Please let me know if you have any questions.**\n\n\n\n\u003e **Disclaimer:** Benchmark results may vary depending on your hardware, software, and configuration. This project is intended for comparative analysis and not for absolute performance evaluation.\n\n\n\n**Additional Resources:**\n\n- PHP frameworks websites:\n\n  - Laravel: https://laravel.com/\n  - Symfony: https://symfony.com/\n  - CodeIgniter: https://codeigniter.com/\n- Docker documentation: https://docs.docker.com/\n\n\n\n**Happy benchmarking!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgeneto%2Fphp-frameworks-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgeneto%2Fphp-frameworks-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgeneto%2Fphp-frameworks-bench/lists"}