NovFora Dev

Performance bottleneck at 80% CPU on Nginx with Gzip enabled

Taylor Davis

Taylor Davis

3 months ago

We see high CPU utilization during heavy static asset delivery. The following config is in production: gzip_comp_level 9, gzip_types all, and tcp_nopush off. We tested dropping the compression level to 4 and observed a 15% reduction in CPU without significant payload size increase. Is this the correct direction or should we investigate per-request buffering instead?

Benjamin Richardson

Benjamin Richardson

3 months ago

You're hitting the gzip compression overhead. At ~80% you probably have a decent request rate, and if Nginx is compressing every response dynamically it eats CPU cycles linearly with traffic. Run nginx -T to see your current config — check if you have gzip_types *;, which compresses images/js/css that are already compressed (wasteful). Also set gzip_min_length 256; so small responses skip compression entirely, and consider offloading gzip to a reverse proxy like Cloudflare or an upstream LB if this is high-volume. The big win for CPU usually comes from serving static assets from Nginx directly rather than through the app server.

Join the conversation to leave a reply.

Sign in to reply

Related topics