Note that the CPU use on caddy is very smooth. I have no idea why. Nginx was self-compiled with pagespeed module (the latest stable version).
Also, I don’t notice any quic requests, even though quic is enabled (I tested using Chrome). All requests seem to be http2. Any idea why that’s so? This server basically serves static content (mostly images).
Very interesting! It could have something to do with the fact that Caddy doesn’t have a pagespeed equivalent, so perhaps it’s doing less work in that sense.
Might also have to do with the fact that Go’s garbage collector runs concurrently and in very, very quick, short, and possibly frequent intervals. Would be interesting to see what your Caddyfile is like, to know which middlewares are being invoked.
A better explanation could be given by profiling; you might also enable the pprof and expvar directives to gain insights.
definitely a possibility as ngx_pagespeed module does on the fly image optimisations i.e. converting jpg/png to webp as well as optimise css/js assets on the fly so depending on nginx pagespeed filters configured/enabled, cpu load could be higher. The more image heavy your pages accessed through ngx_pagespeed optimised filters, the more cpu usage it would involve though it can be tuned via ngx_pagespeed settings as well.
old youtube video explaining what nginx pagespeed/ apche mod_pagespeed modules do
ngx_pagespeed speeds up your site and reduces page load time. This open-source nginx server module automatically applies web performance best practices to pages, and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow.
ngx_pagespeed improves web page latency and bandwidth usage by changing the resources on that web page to implement web performance best practices. Each optimization is implemented as a custom filter in ngx_pagespeed, which are executed when nginx serves the website assets. Some filters simply alter the HTML content, and other filters change references to CSS, JavaScript, or images to point to more optimized versions.