phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

lighttpd? #11

Closed adaliszk closed 6 years ago

adaliszk commented 6 years ago

I recently did a couple of benchmarks to choose which server solution is efficient to run a high-speed api, and I found out that lighttpd actually can faster serve static content than nginx. The cgi version is not faster but I think the fpm might be (currently configuring). Is there option to add lighttpd as well to the images?

petk commented 6 years ago

OpenLiteSpeed does miracles... Kind of also why lighttpd and Caddy wasn't added here just yet. Benchmarking web servers is very complex task and depends on many many factors.

adaliszk commented 6 years ago

It does? From my initial benchmarking tests with multiple threads a simple hello world is kind of the same speed as an apache. For now I admit that the tools which basically doesn't slow the code really nice with litepseed, but it doesn't seems to have that much miracle.

Currently the avarage speeds are (i7-6700,32GB RAM,High Speed SSD):

Paralel is where I start requests until I have to wait to the server or to the client, Serial where I start them after each other and wait for them to finish. Sadly it seems I cannot call more than 80K because my cpu is burning, so I will do the tests at home with my i7-7700K, I think I will boost that up to 5GHz just for this :D

This Caddy is interestig but I don't need automatic SSL, that's added with the proxy but I will do somes tests with it soon.

gstrauss commented 6 years ago

@adaliszk lighttpd 1.4.46 was just released today and I am curious if it is am improvement for you. As I am a lighttpd developer, I am curious what your benchmark is here. What is your lighttpd.conf and how are you running your benchmark? As @petk said:

Benchmarking web servers is very complex task and depends on many many factors.

adaliszk commented 6 years ago

Hey @gstrauss ! Sorry for the late response, I will upload the tester code and dockerfiles probably this weekend, I will ping you when it's up.

The method is basically to run one docker container, call a really simple <?php echo "🐘"; file with https://github.com/wg/wrk with paralel threads note the results, after rebooting the container running the tests with https://httpd.apache.org/docs/2.4/programs/ab.html because it seems not working in paralel, and a third one is using the time tool and call curl inside and outside from the container.

I want to add to this chain the static contents as well and a few type of php scripts so it would possible to see that is there difference in runtime with more code between servers. For now I only have a benchmark comparison between the group containers on cli level: https://github.com/adaliszk/benchmark-php-cli

petk commented 6 years ago

Hello, @adaliszk and @gstrauss there is now a lighttpd image added as well using the default lighttpd from Alpine stable repository.

It will be more fined tuned in the near future.