<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://kangwuyi.com/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%2F%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7%2F%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96</id>
	<title>使用方法/系统安装与升级/性能优化 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://kangwuyi.com/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%2F%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7%2F%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96"/>
	<link rel="alternate" type="text/html" href="https://kangwuyi.com/index.php?title=%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96&amp;action=history"/>
	<updated>2026-11-30T15:29:33Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://kangwuyi.com/index.php?title=%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96&amp;diff=11006&amp;oldid=prev</id>
		<title>Kangkk：​创建页面，内容为“== 性能优化 == 恩，怎么说呢，有段时间不上这个网站了，因为浏览网页速度特别的卡顿。查了下服务器，MySQL 进程占用过高。也许是页面缓存写进了 MySQL 里面么？  所以查阅了一些优化策略，分为一二三步  第一点是安装 opcache。跑了下命令，发现已经被内置在了 PHP8.1 里面，应该是以前安装过吧。  {{shc|&lt;syntaxhighlight lang=&quot;bash&quot;&gt; sudo apt install php-opcache &lt;/sy…”</title>
		<link rel="alternate" type="text/html" href="https://kangwuyi.com/index.php?title=%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96&amp;diff=11006&amp;oldid=prev"/>
		<updated>2026-09-07T06:45:14Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“== 性能优化 == 恩，怎么说呢，有段时间不上这个网站了，因为浏览网页速度特别的卡顿。查了下服务器，MySQL 进程占用过高。也许是页面缓存写进了 MySQL 里面么？  所以查阅了一些优化策略，分为一二三步  第一点是安装 opcache。跑了下命令，发现已经被内置在了 PHP8.1 里面，应该是以前安装过吧。  {{shc|&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; sudo apt install php-opcache &amp;lt;/sy…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 性能优化 ==&lt;br /&gt;
恩，怎么说呢，有段时间不上这个网站了，因为浏览网页速度特别的卡顿。查了下服务器，MySQL 进程占用过高。也许是页面缓存写进了 MySQL 里面么？&lt;br /&gt;
&lt;br /&gt;
所以查阅了一些优化策略，分为一二三步&lt;br /&gt;
&lt;br /&gt;
第一点是安装 opcache。跑了下命令，发现已经被内置在了 PHP8.1 里面，应该是以前安装过吧。&lt;br /&gt;
&lt;br /&gt;
{{shc|&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install php-opcache&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|$|/home/kwy}}&lt;br /&gt;
&lt;br /&gt;
修改配置文件&lt;br /&gt;
&lt;br /&gt;
{{hc|head=/etc/php/8.1/apache2/php.ini|output=&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zend_extension=opcache&lt;br /&gt;
opcache.enable=1&lt;br /&gt;
opcache.enable_cli=1&lt;br /&gt;
opcache.memory_consumption=128&lt;br /&gt;
opcache.interned_strings_buffer=8&lt;br /&gt;
opcache.max_accelerated_files=10000&lt;br /&gt;
opcache.revalidate_freq=60&lt;br /&gt;
opcache.fast_shutdown=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
然后重启生效&lt;br /&gt;
&lt;br /&gt;
{{shc|&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl restart apache2&lt;br /&gt;
sudo systemctl restart php8.1-fpm&amp;lt;/syntaxhighlight&amp;gt;|$|/home/kwy}}&lt;br /&gt;
&lt;br /&gt;
第二步，安装 Memcached。默认配置直接安装并启动服务。&lt;br /&gt;
&lt;br /&gt;
{{shc|&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install php-memcached&lt;br /&gt;
sudo apt install memcached libmemcached-tools&lt;br /&gt;
sudo systemctl status memcached&amp;lt;/syntaxhighlight&amp;gt;|$|/home/kwy}}&lt;br /&gt;
&lt;br /&gt;
修改配置文件&lt;br /&gt;
&lt;br /&gt;
{{hc|head=LocalSettings.php|output=&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
##### memcached&lt;br /&gt;
$wgMainCacheType = CACHE_MEMCACHED;&lt;br /&gt;
$wgParserCacheType = CACHE_MEMCACHED; // 非必填&lt;br /&gt;
$wgMessageCacheType = CACHE_MEMCACHED; // 非必填&lt;br /&gt;
$wgMemCachedServers = [ &amp;#039;127.0.0.1:11211&amp;#039; ];&lt;br /&gt;
&lt;br /&gt;
# $wgSessionsInObjectCache = true; // 非必填--已在1.33版以上移除&lt;br /&gt;
$wgSessionCacheType = CACHE_MEMCACHED; // 非必填&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
安装 meidiawiki 的 Memcached 扩展可以验证服务状态&lt;/div&gt;</summary>
		<author><name>Kangkk</name></author>
	</entry>
</feed>