3 ms·
> the load on my server is reduced isn't this the opposite? Enabling compression will INCREASE the load on your server as you need more CPU to compress/decompr
by santiagobasulto 1y ago
> the load on my server is reduced
isn't this the opposite? Enabling compression will INCREASE the load on your server as you need more CPU to compress/decompress the data.
- reactordev 1y agoIt depends on where the bottleneck is. If it’s in network packet size, it would help serve more clients. At the expense of more CPU needed to decode/encode the data. If you’re serving large files and you have headroom in hardware it’s totally normal.
- have_faith 1y agoDepends on efficiency of compression I guess. If X bytes of data takes N time to transmit, and each slice of N takes Y CPU cycles during transmission, how many Y must your compression algorithm use, and how low must it lower N, in order to be more efficient from a CPU utilisation perspective? assumedly there's an inflection point from CPU use perspective, maybe a point that's impractical to achieve? I'm just vibe-thinking-out-loud.
- Koffiepoeder 1y agoOr your server can cache the compressed content (since it is a static page anyway).
- ltratt 1y agoAs Koffiepoeder suggests, since the vast majority of content on my site is static, I only have to compress a file once when I build the site, no matter how many people later download it. [The small amount of dynamic content on my site isn't compressed, for the reason you suggest.]
- santiagobasulto 1y agoThat’s a good point, didn’t know it was cached on top.
- ModernMech 1y agoNot necessarily. For example you can pre-compress your files once, and then it'll be up to the clients to decompress on receipt.