<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Why Swapping is bad for MySQL Performance ?</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Brice Figureau</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712282</link>
		<dc:creator>Brice Figureau</dc:creator>
		<pubDate>Wed, 20 Jan 2010 07:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712282</guid>
		<description>@Peter,

Of cource you&#039;re right. And I reported the bug several month ago:
http://bugs.mysql.com/bug.php?id=47991

Since it&#039;s not an high traffic issue I&#039;m not sure it will be fixed, though.</description>
		<content:encoded><![CDATA[<p>@Peter,</p>
<p>Of cource you&#8217;re right. And I reported the bug several month ago:<br />
<a href="http://bugs.mysql.com/bug.php?id=47991" rel="nofollow">http://bugs.mysql.com/bug.php?id=47991</a></p>
<p>Since it&#8217;s not an high traffic issue I&#8217;m not sure it will be fixed, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712280</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 20 Jan 2010 07:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712280</guid>
		<description>Vadim,

Yes... Depending on Kernel version you can get rather &quot;fun&quot; swapping behavior, even with swappiness=0 kernel may decide it is better to start swapping rather than shrink cache.    The silly but practical &quot;solution&quot; is to ensure kernel can have some space for cache as it wants.  Happily we&#039;re probably speaking about 10% of physical memory here.</description>
		<content:encoded><![CDATA[<p>Vadim,</p>
<p>Yes&#8230; Depending on Kernel version you can get rather &#8220;fun&#8221; swapping behavior, even with swappiness=0 kernel may decide it is better to start swapping rather than shrink cache.    The silly but practical &#8220;solution&#8221; is to ensure kernel can have some space for cache as it wants.  Happily we&#8217;re probably speaking about 10% of physical memory here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712278</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 20 Jan 2010 06:57:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712278</guid>
		<description>Brice,

MySQL may have memory leaks like any software. Its best to report it and get them fixed.</description>
		<content:encoded><![CDATA[<p>Brice,</p>
<p>MySQL may have memory leaks like any software. Its best to report it and get them fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712277</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 20 Jan 2010 06:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712277</guid>
		<description>CYTech,

There is &quot;memlock&quot; option which locks MySQL process in memory. The danger with it is increased change of MySQL Server being killed if no memory is available.   It also not very commonly used and people reported problems with some Linux kernel versions.</description>
		<content:encoded><![CDATA[<p>CYTech,</p>
<p>There is &#8220;memlock&#8221; option which locks MySQL process in memory. The danger with it is increased change of MySQL Server being killed if no memory is available.   It also not very commonly used and people reported problems with some Linux kernel versions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Isotopp</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712028</link>
		<dc:creator>Isotopp</dc:creator>
		<pubDate>Tue, 19 Jan 2010 19:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712028</guid>
		<description>Swapping out hashes, which are data structures with no locality of reference, creates a lot of excessive disk seeks. And hashes there are a lot inside the node heap.

# echo vm.swappiness = 0 &gt;&gt; /etc/sysctl.conf
# sysctl -p

will make sure the kernel decreases the fs buffer cache to a minimum before initiating swap. The system can still swap, but it is the last thing the kernel tries in a low memory situation. You want that in all your mysqld-machines and in all your httpd-machines.</description>
		<content:encoded><![CDATA[<p>Swapping out hashes, which are data structures with no locality of reference, creates a lot of excessive disk seeks. And hashes there are a lot inside the node heap.</p>
<p># echo vm.swappiness = 0 &gt;&gt; /etc/sysctl.conf<br />
# sysctl -p</p>
<p>will make sure the kernel decreases the fs buffer cache to a minimum before initiating swap. The system can still swap, but it is the last thing the kernel tries in a low memory situation. You want that in all your mysqld-machines and in all your httpd-machines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Tocker</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-712009</link>
		<dc:creator>Morgan Tocker</dc:creator>
		<pubDate>Tue, 19 Jan 2010 18:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-712009</guid>
		<description>@Pedro: Even with swapiness to zero, at some point a system still swaps :(

@Peter: I would be interested to hear your comments about solving this via large pages (which I don&#039;t believe are swapped out).  It&#039;s a common recommendation for other databases, but I&#039;ve not seen many comment on it for MySQL:

http://dev.mysql.com/doc/refman/5.0/en/large-page-support.html
http://harrison-fisk.blogspot.com/2009/01/enabling-innodb-large-pages-on-linux.html</description>
		<content:encoded><![CDATA[<p>@Pedro: Even with swapiness to zero, at some point a system still swaps <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>@Peter: I would be interested to hear your comments about solving this via large pages (which I don&#8217;t believe are swapped out).  It&#8217;s a common recommendation for other databases, but I&#8217;ve not seen many comment on it for MySQL:</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/large-page-support.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/large-page-support.html</a><br />
<a href="http://harrison-fisk.blogspot.com/2009/01/enabling-innodb-large-pages-on-linux.html" rel="nofollow">http://harrison-fisk.blogspot.com/2009/01/enabling-innodb-large-pages-on-linux.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giedrius</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-711855</link>
		<dc:creator>Giedrius</dc:creator>
		<pubDate>Tue, 19 Jan 2010 11:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-711855</guid>
		<description>So, the only possible solution for that: increase virtual memory on the server?</description>
		<content:encoded><![CDATA[<p>So, the only possible solution for that: increase virtual memory on the server?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro Melo</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-711851</link>
		<dc:creator>Pedro Melo</dc:creator>
		<pubDate>Tue, 19 Jan 2010 11:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-711851</guid>
		<description>Vadim,

I think that what you want is to tweak /proc/sys/vm/swapiness (more info on http://lwn.net/Articles/83588/). Set it to 0.

But Peter is sure to have a better answer.

Bye,</description>
		<content:encoded><![CDATA[<p>Vadim,</p>
<p>I think that what you want is to tweak /proc/sys/vm/swapiness (more info on <a href="http://lwn.net/Articles/83588/" rel="nofollow">http://lwn.net/Articles/83588/</a>). Set it to 0.</p>
<p>But Peter is sure to have a better answer.</p>
<p>Bye,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vadim</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-711741</link>
		<dc:creator>Vadim</dc:creator>
		<pubDate>Tue, 19 Jan 2010 07:22:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-711741</guid>
		<description>Peter,

Would be good to give some input why having 1.5GB is OS cached Linux may prefer to swap instead of freeing OS cache. And also how to fix it. This issues happens every so often.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Would be good to give some input why having 1.5GB is OS cached Linux may prefer to swap instead of freeing OS cache. And also how to fix it. This issues happens every so often.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brice Figureau</title>
		<link>http://www.mysqlperformanceblog.com/2010/01/18/why-swapping-is-bad-for-mysql-performance/comment-page-1/#comment-711739</link>
		<dc:creator>Brice Figureau</dc:creator>
		<pubDate>Tue, 19 Jan 2010 07:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2115#comment-711739</guid>
		<description>I totally agree, but sometimes the excessive memory consumption is coming from MySQL itself and is out of your (direct) control (see http://www.masterzen.fr/2009/10/15/mysql-innodb-and-table-renaming-dont-play-well/ and http://bugs.mysql.com/bug.php?id=47991).

It&#039;s not only a matter of configuration, as I discovered myself :-)</description>
		<content:encoded><![CDATA[<p>I totally agree, but sometimes the excessive memory consumption is coming from MySQL itself and is out of your (direct) control (see <a href="http://www.masterzen.fr/2009/10/15/mysql-innodb-and-table-renaming-dont-play-well/" rel="nofollow">http://www.masterzen.fr/2009/10/15/mysql-innodb-and-table-renaming-dont-play-well/</a> and <a href="http://bugs.mysql.com/bug.php?id=47991" rel="nofollow">http://bugs.mysql.com/bug.php?id=47991</a>).</p>
<p>It&#8217;s not only a matter of configuration, as I discovered myself <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

