<?xml version="1.0" encoding="utf-8"?>
		<feed xmlns="http://www.w3.org/2005/Atom">
		  <title type="text">Slicehost Forum - Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		  <updated>2010-09-09T19:14:47+00:00</updated>
		  <id>http://forum.slicehost.com/</id>
		  <link rel="alternate" type="text/html" hreflang="en" href="http://forum.slicehost.com/comments.php?DiscussionID=3397"/>
		  <link rel="self" type="application/atom+xml" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Feed=Atom"/>
		  <generator uri="http://getvanilla.com/" version="1.1.8">
			 Lussumo Vanilla
		  </generator>
		  <entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18859#Comment_18859" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18859#Comment_18859</id>
		<published>2009-04-05T00:45:02+00:00</published>
		<updated>2009-04-06T05:36:52+00:00</updated>
		<author>
			<name>jords</name>
			<uri>http://forum.slicehost.com/account.php?u=1353</uri>
		</author>
		<summary type="text" xml:lang="en">
			Ok, i've been having a issue for some time (about 7 months) with my slice where it goes down occasionally - about once a month. It still accepts http requests, but they just time out. Can't login via ...
		</summary>
		<content type="html">
			<![CDATA[Ok, i've been having a issue for some time (about 7 months) with my slice where it goes down occasionally - about once a month. It still accepts http requests, but they just time out. Can't login via ssh, same timeout problem. Only way to get it back up is a hard reboot.<br /><br />When I have a look in the slicehost console, I see messages about the slice being out of memory and killing either mysql or apache2 (seems to vary). What I can't work out is what is causing it to run out of memory  - never actually managed to run top in this state. However, I think it happens quickly because when I had munin running (uninstalled it now) I didn't see a gradual increase in ram usage before it crashes - still 300-400mb swap free on the last time munin refreshes before the crash.<br /><br />I got a kernel log showing it doing the killing, don't think it has any clues in it as to what's taking up the ram though: http://pastebin.com/f3393c4bc<br /><br />My apache mpm settings: (My sites are all quite low traffic)<br /><ifmodule ><br />    StartServers          3<br />    MinSpareServers       1<br />    MaxSpareServers       3<br />    MaxClients           50<br />    MaxRequestsPerChild   1000<br /></ifmodule><br />I'm using mod_php. I've tried switching to nginx + fastcgi,  but a few of the older sites hosted on my server use php in .html files so that doesn't seem to be a option.<br /><br />My slice had 6 hours of downtime yesterday because it went down while i was asleep - it'd be really nice to finally fix this.<br /><br />Thanks<br />Jordan]]>
		</content>
	</entry>
	<entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18865#Comment_18865" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18865#Comment_18865</id>
		<published>2009-04-05T14:48:37+00:00</published>
		<updated>2010-09-09T19:14:47+00:00</updated>
		<author>
			<name>MWB123</name>
			<uri>http://forum.slicehost.com/account.php?u=2046</uri>
		</author>
		<summary type="text" xml:lang="en">
			Jordan,

These links may provide some assistance in tuning MySQL and Apache appropriately for your slice. I would recommend that you review ...
		</summary>
		<content type="html">
			<![CDATA[Jordan,<br /><br />These links may provide some assistance in tuning MySQL and Apache appropriately for your slice. I would recommend that you review them.<br /><br /><a href="http://chrisjohnston.org/2008/configuring-a-lightweight-apache-mysql-install-on-debian-ubuntu" target="_blank" rel="nofollow">http://chrisjohnston.org/2008/configuring-a-lightweight-apache-mysql-install-on-debian-ubuntu</a><br /><br /><a href="http://www.onlamp.com/pub/a/onlamp/2004/02/05/lamp_tuning.html" target="_blank" rel="nofollow">http://www.onlamp.com/pub/a/onlamp/2004/02/05/lamp_tuning.html</a><br /><br />-Mark]]>
		</content>
	</entry>
	<entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18882#Comment_18882" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18882#Comment_18882</id>
		<published>2009-04-06T04:23:24+00:00</published>
		<updated>2010-09-09T19:14:47+00:00</updated>
		<author>
			<name>ismail</name>
			<uri>http://forum.slicehost.com/account.php?u=2591</uri>
		</author>
		<summary type="text" xml:lang="en">
			Addition the links Mark gave, you may check here for the apache tuning:http://httpd.apache.org/docs/2.0/misc/perf-tuning.html
		</summary>
		<content type="html">
			<![CDATA[Addition the links Mark gave, you may check here for the apache tuning:<a href="http://httpd.apache.org/docs/2.0/misc/perf-tuning.html" target="_blank" rel="nofollow">http://httpd.apache.org/docs/2.0/misc/perf-tuning.html</a>]]>
		</content>
	</entry>
	<entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18883#Comment_18883" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18883#Comment_18883</id>
		<published>2009-04-06T05:28:30+00:00</published>
		<updated>2010-09-09T19:14:47+00:00</updated>
		<author>
			<name>jords</name>
			<uri>http://forum.slicehost.com/account.php?u=1353</uri>
		</author>
		<summary type="text" xml:lang="en">
			Ok, I have tuned my apache and mysql based on those sites, but it seems to me that the settings I had would run less servers than recommended than those, so how could increasing the number of servers ...
		</summary>
		<content type="html">
			<![CDATA[Ok, I have tuned my apache and mysql based on those sites, but it seems to me that the settings I had would run less servers than recommended than those, so how could increasing the number of servers to start stop me running out of ram? Unfortunately it's really hard to know if the problem's been fixed because it only happens occasionally...<br /><br />My ram usage normally is and has always been quite low with at max say 50-100mb swap used and not with many writes/reads. It does seem to be something that happens suddenly, not a gradual gain in ram usage.<br /><br />Also, when my slice has crashed and I go to slice stats, it says i have 100% cpu usage - which is very strange? Also a bit bad because that can't be good for the other slices on the server :&lt;.<br /><br />Thanks<br />Jordan]]>
		</content>
	</entry>
	<entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18968#Comment_18968" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18968#Comment_18968</id>
		<published>2009-04-08T16:52:32+00:00</published>
		<updated>2010-09-09T19:14:47+00:00</updated>
		<author>
			<name>scotts</name>
			<uri>http://forum.slicehost.com/account.php?u=2724</uri>
		</author>
		<summary type="text" xml:lang="en">
			a MaxClients setting of 50 seems high if you have a 256MB slice... if each client is around 15MB (as it is one mine), that could be a problem.

On some distros the allowed PHP memory size in ...
		</summary>
		<content type="html">
			<![CDATA[a MaxClients setting of 50 seems high if you have a 256MB slice... if each client is around 15MB (as it is one mine), that could be a problem.<br /><br />On some distros the allowed PHP memory size in php.ini is set extraordinarily high (&gt;100MB)... it could be that a poorly written PHP script is consuming all the memory...<br /><br />You can also use the apache "ab" program to simulate the load and see if/when it swaps.]]>
		</content>
	</entry>
	<entry>
		<title>Slice starts swapping, runs out of memory, and dies... once or twice a month</title>
		<link rel="alternate" href="http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18976#Comment_18976" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.slicehost.com/comments.php?DiscussionID=3397&amp;Focus=18976#Comment_18976</id>
		<published>2009-04-08T22:26:13+00:00</published>
		<updated>2010-09-09T19:14:47+00:00</updated>
		<author>
			<name>jords</name>
			<uri>http://forum.slicehost.com/account.php?u=1353</uri>
		</author>
		<summary type="text" xml:lang="en">
			Well, my php memory limit was set to 128mb - so that does seem entirely plusable that it is a poorly written script (the biggest site on the server is my dad's, and some of his code is ... ...
		</summary>
		<content type="html">
			<![CDATA[Well, my php memory limit was set to 128mb - so that does seem entirely plusable that it is a poorly written script (the biggest site on the server is my dad's, and some of his code is ... functional). I've reduced it to 20mb which seems more reasonable.<br /><br />I guess all i can do now is wait and see if it happens again... thanks a lot for the help.]]>
		</content>
	</entry>
	
		</feed>