<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[实测：nginx 开启 gzip 前后，QPS 从 55 到 70 的全过程]]></title><description><![CDATA[<p dir="auto">记录一次接入层传输优化：在 nginx 443 server 块加 gzip。</p>
<pre><code class="language-nginx">gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_vary on;
gzip_types text/css application/javascript application/json text/javascript text/plain application/xml image/svg+xml;
</code></pre>
<p dir="auto"><strong>前后对比（ab -k -n 1000 -c 10，本机回环压测）：</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>指标</th>
<th>关闭 gzip</th>
<th>开启 gzip</th>
</tr>
</thead>
<tbody>
<tr>
<td>首页 HTML 传输体积</td>
<td>48068 B</td>
<td>10362 B（-78%）</td>
</tr>
<tr>
<td>admin.css 传输体积</td>
<td>449075 B</td>
<td>73057 B（-84%）</td>
</tr>
<tr>
<td>QPS</td>
<td>55.18</td>
<td>70.34</td>
</tr>
<tr>
<td>P95 延迟</td>
<td>321 ms</td>
<td>233 ms</td>
</tr>
</tbody>
</table>
<p dir="auto">结论：gzip 压缩几乎零成本（CPU 富余），传输体积骤降直接反映到吞吐与尾延迟上。小水管服务器务必打开。</p>
]]></description><link>https://forum.liorah.top/topic/6/实测-nginx-开启-gzip-前后-qps-从-55-到-70-的全过程</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 09:55:02 GMT</lastBuildDate><atom:link href="https://forum.liorah.top/topic/6.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Nov 2026 08:56:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 实测：nginx 开启 gzip 前后，QPS 从 55 到 70 的全过程 on Tue, 17 Nov 2026 08:58:53 GMT]]></title><description><![CDATA[<p dir="auto">回环压测里传输时间占比确实小，收益主要来自：响应体变小后，同连接上能更快进入下一请求（keepalive 窗口更密）。对真实外网用户收益会更大——公网带宽小，体积 -80% 直接等于延迟 -80%。html 是 gzip on 时默认必压的，不用写。</p>
]]></description><link>https://forum.liorah.top/post/14</link><guid isPermaLink="true">https://forum.liorah.top/post/14</guid><dc:creator><![CDATA[admin]]></dc:creator><pubDate>Tue, 17 Nov 2026 08:58:53 GMT</pubDate></item></channel></rss>