<?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-sep-2022.github.io/category/service/website-service/nginx/nginx-performance/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Thu, 04 Aug 2022 07:44:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[内容] Nginx 缓存 （存储网页数据到客户端的本地硬盘）</title>
		<link>https://eternalcenter-sep-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[Service (服务)]]></category>
		<category><![CDATA[Website Service (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=5725</guid>

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



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



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



<h1>正文：</h1>



<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-sep-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[Service (服务)]]></category>
		<category><![CDATA[Website Service (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=5723</guid>

					<description><![CDATA[注意： 在设置 Nginx 并发数之前要先安装 Nginx 正文： 步骤一：设置 Nginx 的并发数 将部分内容修改如下： （补充：这里以 Nginx 可以开启两个进程并且最大连接数是 65536 为例） 步骤二：修改系统的并发数 2.1 临时修改系统的并发数 （补充：这里以将最大软件连接和最大硬连接都设置为 100000 为例） 2.2 永久修改系统的并发数 2.2.1 修改 /etc/security/limits.conf 配置文件 添加以下内容： （补充：这里以将最大软连接和最大硬连接都设置为 10000 为例） 2.2.2 重启系统 步骤三：测试修改的结果 （补充：这里以模拟 2000 个客户端，每个客户端访问 1000 次 127.0.0.1 为例）]]></description>
										<content:encoded><![CDATA[
<h1>注意：</h1>



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



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



<h1>正文：</h1>



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



<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>



<h3>步骤二：修改系统的并发数</h3>



<h4>2.1 临时修改系统的并发数</h4>



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



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



<h4>2.2 永久修改系统的并发数</h4>



<h5>2.2.1 修改 /etc/security/limits.conf 配置文件</h5>



<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>



<h5>2.2.2 重启系统</h5>



<pre class="wp-block-code"><code># reboot</code></pre>



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



<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-sep-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[Service (服务)]]></category>
		<category><![CDATA[Website Service (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=5718</guid>

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



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



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



<h1>正文：</h1>



<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>
