<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nginx Performance (性能) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-may-1-2022.github.io/category/services/website-services/nginx/nginx-performance/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-may-1-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Sat, 01 Jan 2022 15:03:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[内容] Nginx 缓存 （存储网页数据到客户端的本地硬盘）</title>
		<link>https://eternalcenter-may-1-2022.github.io/nginx-cache-client/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 10:58:10 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Performance (性能)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=5725</guid>

					<description><![CDATA[注意： 在将 Nginx 网页数据缓存到访问者的本地硬盘之前要先安装 Nginx 正文： 将部分内容修改如下： （补充：这里以将 jpd、jpeg、gif、png、css、js、ico、xml 后缀的文件保存在客户端本地 30 天为例）]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>在将 Nginx 网页数据缓存到访问者的本地硬盘之前要先安装 Nginx</p>



<div class="wp-container-1 wp-block-buttons is-content-justification-center">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/nginx-install-source/">Nginx 源码软件包的安装</a></div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<pre class="wp-block-code"><code># vi /usr/local/nginx/conf/nginx.conf
将部分内容修改如下：
server {
......
location /{
......
}
location ~* \.(jpd|jpeg|gif|png|css|js|ico|xml)$ {
expires 30d;
}
......
}
......</code></pre>



<pre class="wp-block-code"><code># vi /usr/local/nginx/conf/nginx.conf</code></pre>



<p>将部分内容修改如下：</p>



<pre class="wp-block-code"><code>server {
......
location /{
......
}
location ~* \.(jpd|jpeg|gif|png|css|js|ico|xml)$ {
expires 30d;
}
......
}
......</code></pre>



<p>（补充：这里以将 jpd、jpeg、gif、png、css、js、ico、xml 后缀的文件保存在客户端本地 30 天为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Nginx 并发数的设置</title>
		<link>https://eternalcenter-may-1-2022.github.io/nginx-concurrent/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 10:54:06 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Performance (性能)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=5723</guid>

					<description><![CDATA[注意： 在设置 Nginx 并发数之前要先安装 Nginx 正文： 步骤目录： 步骤一：设置 Nginx 的并发数 步骤二：修改 Linux 内核的并法术2.1 临时修改 Linux 的方法2.2 永久修改 Linux 的方法 步骤三：测试修改的结果 具体的操作步骤： 步骤一：设置 Nginx 的并发数 将部分内容修改如下： （补充：这里以 Nginx 可以开启两个进程并且最大连接数是 65536 为例） 步骤二：修改 Linux 内核的并法术2.1 临时修改 Linux 的方法 注意：此方法在修改后会立即生效 （补充：这里以将最大软件连接和最大硬连接都设置为 100000 为例） 2.2 永久修改 Linux 的方法 注意：此方法在修改后需要重启后才会生效 添加以下内容： （补充：这里以将最大软连接和最大硬连接都设置为 10000 为例） 步骤三：测试修改的结果 （补充：这里以模拟 2000 个客户端，每个客户端访问 1000 次 &#8230; <p class="link-more"><a href="https://eternalcenter-may-1-2022.github.io/nginx-concurrent/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Nginx 并发数的设置"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>在设置 Nginx 并发数之前要先安装 Nginx</p>



<div class="wp-container-2 wp-block-buttons is-content-justification-center">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/nginx-install-source/">Nginx 源码软件包的安装</a></div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<h2>步骤目录：</h2>



<h4>步骤一：设置 Nginx 的并发数</h4>



<h4>步骤二：修改 Linux 内核的并法术<br>2.1 临时修改 Linux 的方法<br>2.2 永久修改 Linux 的方法</h4>



<h4>步骤三：测试修改的结果</h4>



<h2>具体的操作步骤：</h2>



<h4>步骤一：设置 Nginx 的并发数</h4>



<pre class="wp-block-code"><code># vi /usr/local/nginx/conf/nginx.conf</code></pre>



<p>将部分内容修改如下：</p>



<pre class="wp-block-code"><code>......
Worker_processes 2;
Events{
Worker_connections 65536;
Use epoll;
}
......</code></pre>



<p>（补充：这里以 Nginx 可以开启两个进程并且最大连接数是 65536 为例）</p>



<h4>步骤二：修改 Linux 内核的并法术<br>2.1 临时修改 Linux 的方法</h4>



<p>注意：此方法在修改后会立即生效</p>



<pre class="wp-block-code"><code># ulimit -a
# ulimit -Hn 100000
# ulimit -Sn 100000</code></pre>



<p>（补充：这里以将最大软件连接和最大硬连接都设置为 100000 为例）</p>



<h4>2.2 永久修改 Linux 的方法</h4>



<p>注意：此方法在修改后需要重启后才会生效</p>



<pre class="wp-block-code"><code># vi /etc/security/limits.conf</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>.....
*    soft  nofile  10000
*    hard  nofile  10000</code></pre>



<p>（补充：这里以将最大软连接和最大硬连接都设置为 10000 为例）</p>



<h4>步骤三：测试修改的结果</h4>



<pre class="wp-block-code"><code># ab -n 2000 -c 1000 http://127.0.0.1/</code></pre>



<p>（补充：这里以模拟 2000 个客户端，每个客户端访问 1000 次 127.0.0.1 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Nginx 缓存 （存储网页数据到内存）</title>
		<link>https://eternalcenter-may-1-2022.github.io/nginx-cache-server/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 10:49:49 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Performance (性能)]]></category>
		<category><![CDATA[Services (服务)]]></category>
		<category><![CDATA[Website Services (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-may-1-2022.github.io/?p=5718</guid>

					<description><![CDATA[注意： 在将 Nginx 网页文件放入内存进行缓存之前要先安装 Nginx 正文： 将部分内容修改如下：]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>在将 Nginx 网页文件放入内存进行缓存之前要先安装 Nginx</p>



<div class="wp-container-3 wp-block-buttons is-content-justification-center">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-may-1-2022.github.io/nginx-install-source/">Nginx 源码软件包的安装</a></div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2>正文：</h2>



<pre class="wp-block-code"><code># vi /usr/local/nginx/conf/nginx.conf</code></pre>



<p>将部分内容修改如下：</p>



<pre class="wp-block-code"><code>http {
Open_file_cache max=2000 inactive=20s;
Open_file_cache_valid 60s;
Open_file_cache_min_uses 5;
Open_file_cache_errors off;
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
