<?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>TheHippo &#187; virtual server</title>
	<atom:link href="http://blog.thehippo.de/tag/virtual-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thehippo.de</link>
	<description>if (i=1) throw null;</description>
	<lastBuildDate>Thu, 05 Aug 2010 18:10:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to run VMware Server under Ubuntu 10.04 LTS</title>
		<link>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/</link>
		<comments>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 10:10:16 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Tools and Software]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>
		<category><![CDATA[virtual server]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware server]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=258</guid>
		<description><![CDATA[A while ago I used VMware server to running a few virtual instances for testing purposes. Everything worked really flawless. Yesterday I wanted to have some virtual server on my home computer again and encountered many problem with the current version of VMware Server on my Ubuntu 10.04 LTS. There where some problems with the [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I used <a title="VMware server" href="http://www.vmware.com/products/server/" target="_blank">VMware server</a> to running a few virtual instances for testing purposes. Everything worked really flawless. Yesterday I wanted to have some virtual server on my home computer again and encountered many problem with the current version of VMware Server on my Ubuntu 10.04 LTS.<br />
There where some problems with the installation, some to get the VMware console running and also a few the keyboard input on the console.</p>
<p>It took a while to get everything running and I pulled all the information I needed from many different sites. So pulled them all together in this blog entry:<span id="more-258"></span></p>
<ol>
<li>Register at the VMware page. Download the package for VMware server as *.tar.gz. Extract the archive.</li>
<li>Current VMware products do not support the Linux kernel 2.6.32. Therefor you need a patch for the installation archive. Download the patch from the following link and extract it in the parent folder of you VMware download: <a href="http://codebin.cotescu.com/vmware/vmware-server-2.0.x-kernel-2.6.3x-install.sh" target="_blank">VMware patch for Linux kernel 2.6.32</a>. More information could found on <a title="VMware and Linux kernel 2.6.32" href="http://communities.vmware.com/message/1401588#1401588" target="_blank">this page</a> and pages linked on this page.</li>
<li>Run the script with super-user rights. It is quite simple to install. Most of the times you could just hit enter for every question of the installer. At one point the installer ask for a system user which runs the Vmware instances. If you leave it at the default choice, root will be the user. Make sure you have password to log in as root user. (You can set a root password by running the following command on a terminal:<br />
<blockquote><p>sudo passwd root</p></blockquote>
</li>
<li>If you are running a new Ubuntu system you might have get a <a title="Firefox" href="http://www.mozilla-europe.org/en/firefox/" target="_blank">Firefox</a> version &gt;= 3.6. In these versions the VMware console plugin for the browser won&#8217;t work, so download a older version of Firefox from <a title="Older Firefox version download" href="http://www.mozilla.com/en-US/firefox/all-older.html" target="_blank">this page</a> (3.5.9 should be highest working version number).<br />
Extract it somewhere and run it:</p>
<blockquote><p>./firefox -no-remote -P</p></blockquote>
<p>You might create a new Firefox profile (<em>-P</em>) and make sure a new instance of the Firefox is starting (<em>-no-remote</em>)</li>
<li>On a few guest operating systems you might have some trouble with some of the arrow keys of you keyboard. To get them working run this command from a terminal:<br />
<blockquote><p>sudo echo &#8220;xkeymap.nokeycodeMap = true&#8221; &gt;&gt;  /etc/vmware/config</p></blockquote>
<p>You need to run this on the computer where you want to start the VMware console. More Informations could be found <a title="Arrow keys in VMware console" href="http://ubuntuforums.org/showthread.php?t=1116511" target="_blank">here</a>.</li>
<li>Browse to you VMware administration panel (<a title="VMware adminstration panel" href="http://localhost:8222" target="_blank">http://localhost:8222</a> or <a title="VMware adminstration panel" href="https://localhost:8333" target="_blank">https://localhost:8333</a>). Create and start a virtual machine. Install the browser plug-in. Launch the console.</li>
</ol>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 610px"><a href="http://blog.thehippo.de/wp-content/uploads/2010/06/screenshot1.png"><img class="size-large wp-image-270" title="VMware admin &amp; console" src="http://blog.thehippo.de/wp-content/uploads/2010/06/screenshot1-1024x566.png" alt="VMware admin &amp; console" width="600" height="331" /></a><p class="wp-caption-text">VMware admin &amp; console</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2010/06/server/vmware-server-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crashing virtual servers</title>
		<link>http://blog.thehippo.de/2009/08/server/crashing-virtual-servers/</link>
		<comments>http://blog.thehippo.de/2009/08/server/crashing-virtual-servers/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 11:14:36 +0000</pubDate>
		<dc:creator>Hippo</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[1und1]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vHost]]></category>
		<category><![CDATA[virtual server]]></category>

		<guid isPermaLink="false">http://blog.thehippo.de/?p=36</guid>
		<description><![CDATA[After leaving my last company I rented a small virtual server at 1und1. I took the XL vHost package which contains: 20 GB Raid 5 Storage 512 MB RAM, max 2 GB RAM 2 TB Traffic At this time I thought it would be nice to install every thing by myself, so I choose a [...]]]></description>
			<content:encoded><![CDATA[<p>After leaving my last company I rented a small virtual server at <a title="1und1" href="http://www.1und1.info" target="_blank">1und1</a>. I took the <a title="1und1 XL virtual host package" href="http://www.1und1.info/xml/order/VirtualServerXL" target="_blank">XL vHost</a> package which contains:</p>
<ul>
<li>20 GB Raid 5 Storage</li>
<li>512 MB RAM, max 2 GB RAM</li>
<li>2 TB Traffic</li>
</ul>
<p>At this time I thought it would be nice to install every thing by myself, so I choose a plain &#8220;Ubuntu 8.04 LTS 64 bit minimal&#8221; as operating system for my vHost. I installed Apache2, PHP5, MySQL and all the stuff I needed. It all works fine and I was really impressed by the speed of this virtual server.</p>
<p>Then I moved <a title="www.sportinleipzig.de" href="http://www.sportinleipzig.de" target="_blank">sportinleipzig.de</a>, which I made during the time at my last company to this new server. This page does not have a very high traffic (200 unique visitors a day), but a lot of content (at least 5000 &#8220;static&#8221; pages). After 2 days the server crashed the first time, whereas crash means, that he is still alive, but does not respond to anything more then a simple ping. I restarted the server over the admin panel. Half a week later the server crashed the next time. Investigating the cause for these crashed I found out a few interesting things.<span id="more-36"></span></p>
<p>First a blamed <a title="mod_tora" href="http://ncannasse.fr/blog/mod_tora" target="_blank">mod_tora</a> which I installed on this virtual server to check if it is ready to use for some production code. Then I deactivated <a title="eAccelerator" href="http://blog.thehippo.de/2009/08/server/eaccelerator-on-ubuntu/" target="_blank">eAccelerator</a>, because I thought it could be possible that it has some memory leaks. I even deactivated <a title="Piwik" href="http://piwik.org/" target="_blank">Piwik</a> which I use as a tracking system for all the visitors on the pages of this server. (It is very nice! If you need some visitor tracking, give it a try.) But the server still crashed ever few days.</p>
<p>Later I recognized that these crashes possibly occur when Google starts to crawl the page, as the page was not completely indexed anymore. So I started to do some load test on the server. A good page to start is <a title="loadimpact.com" href="http://loadimpact.com" target="_blank">loadimpact.com</a> and the Apache command line tool <a title="Apache Benchmark" href="http://httpd.apache.org/docs/2.0/programs/ab.html" target="_blank">ab</a>, which both give you the possibility to run a lot of requests on you own server. Having a ssh session open and refreshing the status page of the Virtuozzo panel it became more and more clear. These kind of virtual server are very restricted how many resources they could consume and there a few limit that are easy to reach:</p>
<ul>
<li><strong>kmemsize</strong>:<br />
<blockquote><p>The size of unswappable kernel memory allocated for the internal kernel structures for the processes of a particular VPS.</p></blockquote>
</li>
<li><strong>shmpages</strong>:<br />
<blockquote><p>The total size of shared memory (including IPC, shared anonymous mappings and tmpfs objects) allocated by the processes of a particular VPS, in pages.</p></blockquote>
</li>
<li><strong>numproc</strong> (maximum set to 128!):<br />
<blockquote><p>The maximal number of processes the VPS may create.</p></blockquote>
</li>
<li><strong>numfile</strong> (maximum set to 8192, this is okay):<br />
<blockquote><p>The number of files opened by all VPS processes.</p></blockquote>
</li>
<li><strong>numtcpsock</strong> and <strong>numothersock</strong> (both set to 720, means: no socket servers on virtual servers!):<br />
<blockquote><p>he number of TCP sockets (PF_INET family, SOCK_STREAM type). This parameter limits the number of TCP connections and, thus, the number of clients the server application can handle in parallel.</p></blockquote>
<blockquote><p>The number of sockets other than TCP ones. Local (UNIX-domain) sockets are used for communications inside the system. UDP sockets are used, for example, for Domain Name Service (DNS) queries. UDP and other sockets may also be used in some very specialized applications (SNMP agents and others).</p></blockquote>
</li>
</ul>
<p>There are a lot of other limits set to the server, but the first three are these limits that made my server crash, when having tons of requests on the Apache.</p>
<p>I am using the Apache2 in the prefork mode (this is default if you install it via the Ubuntu repositories). This means the Apache spawns a few processes to handle the requests. If load raises more processes will be created, if load goes down unused processes will be destroyed. Forking new processes cost a little bit time so the Apache keeps some processes ready just in the case of load peak. During the time google crawls the page many processes where created to handle the load. The problem was that these processes consumed to much memory (probably this could be a memory leak in one of the PHP  scripts) and some of some became zombies, leading the virtual server to consume all resources and then crash.</p>
<p><strong>The solution</strong>:<br />
Edit you &#8220;/etc/apache2/apache2.conf&#8221;. Search for this section:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1"># prefork MPM</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># StartServers: number of server processes to start</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># MinSpareServers: minimum number of server processes which are kept spare</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># MaxSpareServers: maximum number of server processes which are kept spare</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1"># MaxClients: maximum number of server processes allowed to start</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1"># MaxRequestsPerChild: maximum number of requests a server process serves</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">StartServers</span> &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">10</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">MinSpareServers</span> &nbsp; &nbsp; &nbsp;<span class="nu0">10</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">MaxSpareServers</span> &nbsp; &nbsp; &nbsp;<span class="nu0">20</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">MaxClients</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">100</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">MaxRequestsPerChild</span> <span class="nu0">500</span></div>
</li>
</ol>
</div>
<p>You could read in the comment of the config the impact of every parameter. The important one is the last one which is set to &#8220;0&#8243; by default, which means that processes live as long as possible. Setting it to &#8220;500&#8243;, which is quite conservative, makes every process ends after serving 500 request. This also makes sure that all the allocated memory is freed. That causes that processes need to be created more often, so I also raised &#8220;MinSpareServers&#8221; and &#8220;MaxSpareServers&#8221;, which are the processes keept ready for load peak.<br />
In conclusion my server spends a little more time on spawning new Apache processes, but this makes sure memory is cleaned more often and finally solved my problem!</p>
<p>P.S.: I don&#8217;t know if this is on all virtual servers, but the vHosts at 1und1 have a &#8220;/proc/&#8221;-entry for reading the limits of you server. You type into the terminal:</p>
<pre>root@foo:~# cat /proc/user_beancounters</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.thehippo.de/2009/08/server/crashing-virtual-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.221 seconds -->
