<?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>Low End Box &#187; mysql</title>
	<atom:link href="http://www.lowendbox.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lowendbox.com</link>
	<description>Hosting Websites on Bare Minimum VPS/Dedicated Servers</description>
	<lastBuildDate>Wed, 08 Feb 2012 08:33:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Reducing MySQL Memory Usage for Low End Boxes</title>
		<link>http://www.lowendbox.com/blog/reducing-mysql-memory-usage-for-low-end-boxes/</link>
		<comments>http://www.lowendbox.com/blog/reducing-mysql-memory-usage-for-low-end-boxes/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 01:46:27 +0000</pubDate>
		<dc:creator>LowEndAdmin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Tuning]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.lowendbox.com/blog/reducing-mysql-memory-usage-for-low-end-boxes/</guid>
		<description><![CDATA[MySQL is pretty much the de facto database engine for most open source scripts, and it is almost-always installed on hosted servers. However the default MySQL installation on Debian/Ubuntu takes around 25MB RSS on a cold-start. Well, not too bad I guess, unless you are running a tight ship with only 64MB of total memory. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mysql.com/">MySQL</a> is pretty much the <em>de facto</em> database engine for most open source scripts, and it is almost-always installed on hosted servers. However the default MySQL installation on Debian/Ubuntu takes around 25MB RSS on a cold-start. Well, not too bad I guess, <em>unless</em> you are running a tight ship with only 64MB of total memory. Depending on how important MySQL is to your stack, you might wish to bring the memory usage down so you can fit other applications in memory.</p>
<p>The easiest way is to start from an existing configuration file to bring down the memory usage, and then tune it to bring back adequate performance. On Debian/Ubuntu you might wish to replace your installed <code>/etc/mysql/my.cnf</code> with <code>my-small.cnf</code> that can be found in <code>/usr/share/doc/my-server-5.0/examples</code>. I am also attaching a <a href="http://www.lowendbox.com/media/mysql/my-lxadmin-centos.cnf">my.cnf here</a> that is taken out from CentOS 4 installation of <a href="http://lxlabs.com/software/lxadmin-sse/">LxAdmin</a> (which has been famous for its low-memory foot print). It is pretty much based on <code>my-small.cnf</code>. Some important notes:</p>
<ul>
<li>
<p><code>skip-bdb</code> and <code>skip-innodb</code> are added, so you don&#8217;t get BSD DB nor InnoDB support. BSD DB support in MySQL is pretty much obsolete, and many open source scripts don&#8217;t rely on the presence of InnoDB. A low end VPS is not likely to enjoy the concurrency InnoDB is offering anyway. Transaction and referential integrity? Real Programmers<sup>TM</sup> write their own rollback routines :)</p>
</li>
<li>
<p><code>key_buffer</code> is <em>only</em> 16K which is far from enough. <code>key_buffer</code> is pretty much one of the most important parameter for MyISAM tables and I usually bump it up to at least 1MB. The same can be said about <code>table_cache</code> &#8212; 4 is way too small. A WordPress page will likely touch 10 tables, and much more for apps like Drupal or MediaWiki.</p>
</li>
<li>
<p>Query cache <em>might</em> be a good thing if you intend to run a busy site on such a low end VPS (provided that it has small data set, mostly read, like blogs, news sites, etc). I have my <code>query_cache_limit</code> set to 256K and <code>query_cache_size</code> set to 4M here.</p>
</li>
</ul>
<p>After a few adjustment you should be able to start mysqld at around 5-6MB RSS. You might need to check the runtime variables to monitor the performance and how everything works out.</p>
<div style="display:none">38.107.179.231</div><hr/><div>Copyright &copy; <a href="http://www.lowendbox.com/">LowEndBox.com</a>. All Rights Reserved.</div>]]></content:encoded>
			<wfw:commentRss>http://www.lowendbox.com/blog/reducing-mysql-memory-usage-for-low-end-boxes/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

