Closed zsimple closed 5 years ago
I think this is not a caddy:php issue, the offical php-fpm-alpine is working at the the same speed…
That's almost an order of magnitude difference in requests/second and latency. Maybe an issue with default file descriptor limits? (see: ulimit)
Did you run the two benchmarks on the same machine?
Yes, I ran them on the same machine. Here are ulimit -a results:
abiosoft/caddy:php
-t: cpu time (seconds) unlimited
-d: data seg size (kb) unlimited
-s: stack size (kb) 8192
-c: core file size (blocks) unlimited
-m: resident set size (kb) unlimited
-l: locked memory (kb) 16384
-p: processes unlimited
-n: file descriptors 1048576
-v: address space (kb) unlimited
-w: locks unlimited
-e: scheduling priority 0
-r: real-time priority 0
and ubuntu php
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) unlimited
memory(kbytes) unlimited
locked memory(kbytes) 16384
process unlimited
nofiles 1048576
vmemory(kbytes) unlimited
locks unlimited
rtprio 0
Any help?
The main difference I'm aware of between Alpine and Ubuntu images is that packages are built with musl and glibc respectively. I'm not sure if that plays a role.
Since this is the case, I don't think it has anything to do with this image. But I'll leave this issue open for now.
I think this is not a caddy:php issue, the offical php-fpm-alpine is working at the the same speed…
@zsimple please re-run the tests again. The new builds have opcache included witch should increase the php performance. Also through alpine 3.10 and php-fpm7.3 is used
Yes! It is much faster then before, I think it can be used in production after some security test.
Thanks for your work.
I use caddy:php to run a laravel application, which only display a static page. I found it is slower then I expected, so I benched the speed with wrk.
I also tried unix sock in fastcgi, /dev/shm to serve files, nothing works.
So I tried to build a ubuntu image, with almost the same dockerfile, below is the result:
I am using Ubuntu 18.04, docker version is Docker version 17.12.1-ce, build 7390fc6.