<?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>Memory &#8211; HU Xiaoxu</title>
	<atom:link href="https://blog.ihuxu.com/tag/memory/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ihuxu.com</link>
	<description>a software engineer&#039;s blog</description>
	<lastBuildDate>Wed, 18 Jun 2025 15:29:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>小型网站架构降 Apache 与 MySQL 内存占用比率</title>
		<link>https://blog.ihuxu.com/how-to-configure-the-apache-and-mysql-server-effectively-under-the-framework-of-a-small-web-site/</link>
					<comments>https://blog.ihuxu.com/how-to-configure-the-apache-and-mysql-server-effectively-under-the-framework-of-a-small-web-site/#respond</comments>
		
		<dc:creator><![CDATA[HU Xiaoxu]]></dc:creator>
		<pubDate>Tue, 13 Dec 2016 11:38:12 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Dev Problem]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Original]]></category>
		<guid isPermaLink="false">http://www.ihuxu.com/blog/?p=9365</guid>

					<description><![CDATA[前言 这篇文章以我的阿里云服务器为例（你眼前的博客正是搭在这个服务器上），阐述下小型网站（Linux+Apache+MySQL+PHP）对于内存利用率提升的配置方法的一个点。 正文 我的服务器是阿里云的，在一年前由于数据库（MySQL）频繁内存不足宕机就“潇洒”地升级了配置到2G内存。所以，目前机器的配置如下： CPU： 1核 内存： 2048 MB 操作系统： CentOS 6.5 32位 公网IP： 115.28.36.19 带宽计费方式： 按固定带宽 当前使用带宽： 1Mbps 同时，正常使用情况下的内存使用情况如下： 图中显示 MySQL 占用 440m，Apache 占用 44m。当然，这是MySQL 服务和 Apache 服务刚刚重启后的情况。实际的内存占用会比这大，因为随着业务的进行，会进行 Cache 的累积，最后导致整体的使用内存增大。 下面分别调整 MySQL 和 Apache 的配置文件。 MySQL 修改 /etc/my.cnf 文件，增加如下配置内容： 内容使用情况如下： 如图所示，在修改 MySQL 配置项后内存使用已经大幅度下降到 71m 了。所以，默认的 MySQL 配置真是不适合我们这种小型网站。同时，你会注意到运行了一段时间后，Apache 内存占比上升，使用量达到406m。真是可怕。 下面我们修改 Apache 的配置文件，httpd.conf： 由于我的 Apache 加载的是 event 模式，所以我这里修改了相应的 event 模块配置。如果你想知道你自己加载的是哪种模式，每一个配置项是什么意思，那么你可以参阅下这篇文章：apache2.4.x 三种 MPM 介绍。 修改后配置重启就 OK 了。 总结 没有总结]]></description>
		
					<wfw:commentRss>https://blog.ihuxu.com/how-to-configure-the-apache-and-mysql-server-effectively-under-the-framework-of-a-small-web-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
