Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.
/ httpd-php-fpm Public archive

Lightweight πŸƒ fast ⚑ fastcgi php 🐘 proxy and static http server

Notifications You must be signed in to change notification settings

shouze/httpd-php-fpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

httpd-php-fpm

Lightweight πŸƒ fast ⚑ fastcgi php 🐘 proxy and static http server.

Why another http server for php?

Because nowaday either you go serverless, or you manage distributed services in containers. httpd-php-fpm focus on containerized php world.

Well known existing solutions are:

  • apache + mod-php: the more official & recommended solution. Unfortunately, this automatically imply a debian based docker image, pretty heavy (>=140Mib) 😭
  • nginx + php-fpm: the bad news is that to avoid violating the container's single root process principle... we also need an init to supervise both nginx & php processes, and the resulting base docker image is still heavy, even with an alpine variant (>=90Mib) 😭
  • symfony cli: not recommended for production, not single responsibility (also embed Symfony Cloud utils), closed source and written in Go (hello garbage collector). It also tries to bring the better developer experience so it does some voodoo, trying to make things work whatever your php setup is.

So, here's the budget of this project:

  • Lightweight πŸƒ: base docker image less than 40Mib (compressed). And lowest memory footprint.
  • fast ⚑:
    • at least 2k req/s under 2ms at 95 percentile for static files
    • at least 1k req/s under 5ms at 95 percentile for basic php-fpm request

Inspirations

Compiling

cargo build -j(nproc) --release
# then run it, for example if you have a www dir:
# ./target/release/httpd-php-fpm -d ./www

Benchmarks

Static files

current benchmarks, done with vegeta on a 8 core intel 10th gen CPU.

➜ echo "GET http://localhost:3000/" | vegeta attack -duration=10s -rate=2000 | tee results.bin | vegeta report
Requests      [total, rate, throughput]         20000, 2000.13, 2000.08
Duration      [total, attack, wait]             10s, 9.999s, 287.523Β΅s
Latencies     [min, mean, 50, 90, 95, 99, max]  219.856Β΅s, 564.652Β΅s, 312.437Β΅s, 813.232Β΅s, 1.763ms, 5.4ms, 21.491ms
Bytes In      [total, mean]                     256240000, 12812.00
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           100.00%
Status Codes  [code:count]                      200:20000  
Error Set:

php-fpm

stay tuned!

About

Lightweight πŸƒ fast ⚑ fastcgi php 🐘 proxy and static http server

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages