<?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>IT Know-It-All &#187; vps</title>
	<atom:link href="http://itkia.com/tag/vps/feed/" rel="self" type="application/rss+xml" />
	<link>http://itkia.com</link>
	<description>Applications, OS, Networking, Data</description>
	<lastBuildDate>Mon, 02 Apr 2012 15:00:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>JaguarPC, I Recommend Them</title>
		<link>http://itkia.com/jaguarpc-i-recommend-them/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jaguarpc-i-recommend-them</link>
		<comments>http://itkia.com/jaguarpc-i-recommend-them/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 22:05:20 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=331</guid>
		<description><![CDATA[When I don&#8217;t have the proper home internet service to run my own public servers I get an unmanaged Virtual Private Server (VPS). I&#8217;ve spent quite a few years running everything off of a VPS because I&#8217;ve been moving from &#8230; <a href="http://itkia.com/jaguarpc-i-recommend-them/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I don&#8217;t have the proper home internet service to run my own public servers I get an unmanaged Virtual Private Server (<a href="http://www.jaguarpc.com/vps-hosting/">VPS</a>). I&#8217;ve spent quite a few years running everything off of a VPS because I&#8217;ve been moving from home to home. I am settled now, have the home internet service and servers ready and am about to cancel my VPS, but I wanted to thank <a href="http://www.jaguarpc.com/">JaguarPC</a> (<a href="http://twitter.com/JaguarPC">Twitter</a>, <a href="mailto:sales@jaguarpc.com">email</a>) for their proactive service and their equal interest in keeping existing customers and getting new customers. (JaguarPC also offers managed VPSes and other hosting products.)</p>
<p>I&#8217;ve had bad experiences with other hosting providers, both mine and for my clients. With other hosts I&#8217;ve often had host-related problems while their reporting services claim that their services are up and their support line doesn&#8217;t answer, later to find out they&#8217;ve had major problems. At least in the age of Twitter it&#8217;s easy to find other clients of the same host and verify the problem is with the hosting company and not with my or my client&#8217;s server.</p>
<p>But when I decided to leave my previous ill-behaved host who had my VPS down for 5 days and couldn&#8217;t tell me if or when it would be back up—thankfully I keep my own backups—I looked for a VPS hosting provider that had been around for many years, appeared to care about existing customers and offered a good value. I picked JaguarPC partially because of some recommendations and partially because they had a special running where I could get my umanaged VPS with 390 MB of RAM for the price of 256 MB.</p>
<p>Well, the special never ended like I thought it might. In fact, three years later they—on their own initiative—upgraded me to a new plan that had over three times more storage, three times the RAM (four times the RAM of the base plan I had) and ten times the monthly bandwidth at a lower plan cost. They explained in the email that they want to thank and retain their existing customers. The actual upgrade itself caused no issues, outages or reboots on my VPS. (This is possible due to the VPS solution they are using.)</p>
<p>I have not known of any outages or slow server issues since I&#8217;ve been with them. I haven&#8217;t had to contact them once since I opened the account. However, they proactively notified me of a DDoS issue that they were experiencing and thought might affect me, and they kept an updated status report available. I checked my server and didn&#8217;t seem to be affected, but it was very refreshing to hear from the hosting provider and having regular updates. That is vastly superior to any other host I&#8217;ve dealt with.</p>
<p>I semi-publicly shared the adventure with some online friends. I posted the following on May 10, 2008 about my leaving my previous host and starting with JaguarPC:</p>
<blockquote><p>When I suggested he [the VPS reseller] set up a new VPS for me he liked the idea at first but then asked if I wanted to go direct with the company that hosted my old server. That&#8217;s the second time he&#8217;s tried to pawn me off onto another company, and I suddenly recalled I had been concerned about performance issues, anyway, and now he suggests I go with the company who apparently lost a host server and can&#8217;t seem to get it back up? Nope, time to go with someone totally new. JaguarPC apparently has been doing this 10 years, so hopefully after 3 years they&#8217;ll still want my business. Plus they were having a sale that&#8217;s supposed to give me more RAM at the same price which should help with the concurrent requests I&#8217;ve talked about before.</p>
<p>I haven&#8217;t closed the old account yet. I don&#8217;t really expect for them to bring my VPS back up as it was, but I&#8217;d like to see how my backups restore before I totally give up on it. So far I think I&#8217;m missing a few emails, a static website I forgot to back up (no biggie) and perhaps some config info that might be handy to look at but isn&#8217;t critical.</p></blockquote>
<p>I posted the following on January 19, 2011:</p>
<blockquote><p>Well, so far I&#8217;m pleased with JaguarPC. There have been no major issues for me overall, and they emailed me an outage notice yesterday and linked to a support thread that was keeping running updates on a DDoS attack that was affecting several of their servers and networks. And as far as I can tell my server didn&#8217;t even go down, but I got the updates anyway.</p>
<p>It&#8217;s so nice to find out about a problem from the hosting company and be offered a place to find updates before I even know there is a problem.</p>
<p>The last two major host company problems I&#8217;ve had (with other host companies) usually involved no public mention of the issue for at least an hour or two after a major outage, and support lines and support system jammed and giving no information or false positive information. Here they have proactively notified me, so if I start having problems I know what&#8217;s probably going on and know where to look for updates rather than waste hours trying to troubleshoot something I have no control over.</p></blockquote>
<p>I posted the following on February 4, 2011:</p>
<blockquote><p>Wow! JaguarPC just auto-upgraded me to a new plan that is cheaper and has 3-10 times the specs the old plan has! I&#8217;ll post a redacted form of the email later when I&#8217;m not on my Droid. The jist is they want to treat existing customers as well as new ones.</p>
<p>Hoo boy, now I can increase the concurrency here and give some more cache RAM to the database.</p>
<p>So yeah, apparently JaguarPC does still want my business after nearly 3 years.</p></blockquote>
<p>This is the (redacted) email they sent me about the February 2011 upgrade:</p>
<blockquote><p>We are very pleased to inform you of an immediate upgrade of your VPS package. This free automatic update is to express gratitude to our loyal customers like yourself. We are upgrading all our VPS plans in next several weeks and today your VPS was upgraded on the new plan.</p>
<p>No action is required on your end. There is no other change to your hosting, domains, or IP.</p>
<p>&#8220;It is common in the web hosting industry to promote plans to attract new customers, but we really wanted to do something that was a way of saying thank you to our existing customers,” says Greg Landis , CEO of JaguarPC. “We could not imagine a better way to do that to give more for less. Our philosophy has always been to treat our customers with utmost respect regardless of their size, and we hope to maintain our strong customer loyalty with this movement.&#8221;</p>
<p>The upgrade details are as follows:</p>
<p>[server account name]</p>
<p>Your old VPS plan name: VPS &#8211; Freedom Plan<br />
Your old VPS plan cost: $[...] + addons<br />
Your old VPS plan specs: 15GB Disk, 256MB RAM, 300GB Bandwidth + addons</p>
<p>Your new VPS plan name: Linux VPS Pro<br />
Your new VPS plan cost: $[...] + addons<br />
Your new VPS plan specs: 50GB Disk, 1024MB RAM, 3000GB Bandwidth + addons</p>
<p>[VPS management products info]</p>
<p>We just turned 12 years old in last October and getting stronger in 13th year of business! This is a tribute to the loyalty of our clients and reflects our business concepts of good value, integrity, and honesty. It wouldn&#8217;t be possible without the ongoing trust and business from clients such as yourself. Thank you all again for your business and referrals. We wish you all the very best.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/jaguarpc-i-recommend-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multithreaded Apache In Small VPS</title>
		<link>http://itkia.com/multithreaded-apache-in-small-vps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multithreaded-apache-in-small-vps</link>
		<comments>http://itkia.com/multithreaded-apache-in-small-vps/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 22:48:39 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_fcgid]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=57</guid>
		<description><![CDATA[My detailed report configuring multithreaded Apache mod_fcgid for PHP with limited resources. <a href="http://itkia.com/multithreaded-apache-in-small-vps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p><strong>July 2011 Note: mod_fcgid has changed its behavior in opening and closing processes since I wrote this article. <a href="http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html">mod_fcgid is now an Apache project</a>, and limiting it to 4 processes with the configuration I have below caused me problems when I migrated to a server with the newer mod_fcgid. mod_fcgid now opens a new process for each &#8220;class&#8221; which for our php purposes means each .php file location requested by a URL, and it tries to keep 3 processes open for each class by default. Since I limited the max processes to 4, it will not close enough idle processes to allow new classes to open processes, and the pages fail. I think this may be fixable with settings, but I had other upgrade frustrations during the migration and am not now constrained by a small VPS, so I haven&#8217;t yet been motivated to figure out how to get the newer mod_fcgid to operate well in a small VPS.</strong></p>
<p>My best-performing small VPS setup was with lighttpd and FastCGI PHP, but I got tired of trying to make rewrites work in lighttpd and switched to a two-process prefork Apache with mod_php and Squid as a web accelerator. That worked pretty well, but not as fast as lighttpd and FastCGI. What I really want is a multithreaded Apache and a FastCGI PHP that will fit in my small, cheap VPS.</p>
<p>I had tried Apache&#8217;s worker MPM and FastCGI before, but at the time both Apache and the PHP FastCGI process bloated and took up all my RAM despite my settings. Recently I decided to try again and was able to find out how to make it work.</p>
<p>Under Linux, by default each thread is assigned 8MB of stack memory, so an Apache process with 25 threads would try to take up 25*8=200MB of RAM!!! Plus the size of the Apache parent process, plus anything else that runs on my VPS. Not going to work in my small VPS. However, each thread doesn&#8217;t really need that much RAM. In fact, 128k is working fine for me so far. Apache 2.2 has a new directive ThreadStackSize for the worker MPM, and I set mine to &#8220;ThreadStackSize 131072&#8243;, and now I can have two Apache processes with 25 threads each taking up about 25MB worth of privvmpages. Another way to accomplish this is add &#8220;ulimit -s 128&#8243; to the Apache startup scripts. For Apache 2.0 you have to do it this way. Since I am using Apache 2.2 I didn&#8217;t have to use ulimit, but when I was testing the effects of changing the stack size I used this script which worked as a temporary measure:</p>
<pre>#!/bin/sh

ulimit -s 128
/usr/sbin/invoke-rc.d apache2 restart</pre>
<p>My 25 MB RAM usage above is without mod_php, though. Google searches lead to conflicting information about whether PHP is thread safe, so I want to use FastCGI. My problem with Apache FastCGI before was that it spawned several times as many PHP processes as I thought I had told it to. I was using mod_fcgid and pointing it to the same FastCGI PHP wrapper script that I had used for lighttpd. But that script set PHP to launch child processes, and I have since learned that mod_fcgid does not multiplex and therefore will not use the child processes. Instead it launches as many processes as it sees fit, and my configuration had each of those launching 4 children. No wonder my RAM got chewed up so quickly. So now I am letting mod_fcgid call /usr/bin/php-cgi directly:</p>
<pre>&lt;IfModule mod_fcgid.c&gt;
        AddHandler fcgid-script .fcgi .php
        # Where to look for the php.ini file?
        DefaultInitEnv PHPRC        "/etc/php5/cgi"
        # Maximum requests a process should handle before it is terminated
        MaxRequestsPerProcess       1000
        # Maximum number of PHP processes
        MaxProcessCount             4
        # Number of seconds of idle time before a php-cgi process is terminated
        IPCCommTimeout              120
        IdleTimeout                 120
        #Or use this if you use the file above
        FCGIWrapper /usr/bin/php-cgi .php
&lt;/IfModule&gt;</pre>
<p>Unfortunately, since each PHP processes is launched separately, any caching such as eAccelerator or APC will not be shared across each process. And each process uses up another X MB of RAM for the cache. So if I&#8217;m using APC with the default 30 MB cache and have 4 FastCGI PHP processes going, my APC caches are taking up 120 MB all by themselves! At the moment this is exactly what I&#8217;m doing, because I&#8217;ve moved up from a 256 MB VPS to a 390 MB VPS, and my total memory usage seems to be hovering near 256 MB when all processes are running. However, when PHP processes aren&#8217;t needed, mod_fcgid will kill them off to save memory, so most of the time I&#8217;m using much less RAM. I will see if I can set up the FastCGI processes like I did with lighttpd and then connect to it from Apache. I think it&#8217;s doable, but I haven&#8217;t tried yet.</p>
<p>I like using the worker MPM and FastCGI better than using the prefork MPM, mod_php and Squid. First of all the log files are a lot easier to parse. Apache (as I have it configured) can handle 50 concurrent static requests including 4 concurrent PHP requests, and I was able to enable KeepAlives again so my sites feel more responsive. With prefork Apache and Squid I could see a row of GIF smileys load up left-to-right when posting a reply in one of my forums. Now it happens so fast I can&#8217;t see it anymore. If I can get the PHP cache&#8211;previously eAccelerator, but I just switched to APC&#8211;to share itself across all my PHP processes then the overal RAM usage will be much lower, and I&#8217;ll be able to have more PHP processes.</p>
<p>And I like the new setup better than lighttpd because I can use the Apache rewrite rules provided by software programs like Drupal and SMF rather than try to translate them into lighttpd rewrites.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/multithreaded-apache-in-small-vps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2008 Update on Running Drupal on a Small VPS</title>
		<link>http://itkia.com/2008-update-on-running-drupal-on-a-small-vps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=2008-update-on-running-drupal-on-a-small-vps</link>
		<comments>http://itkia.com/2008-update-on-running-drupal-on-a-small-vps/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:26:05 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=53</guid>
		<description><![CDATA[Using Squid as a web accelerator to improve Apache mod_php efficiency with limited resources. <a href="http://itkia.com/2008-update-on-running-drupal-on-a-small-vps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>For a year or two I was successfully running Drupal with lighttpd and fastcgi. Lighttpd is very efficient, and having 4 fastcgi PHP processes let me limit the memory php used while keeping my small sites responsive enough. But redirects and URL rewriting are done differently, and it was tricky at times to get it to work the way I wanted with Drupal. I eventually got tired of wrestling with rewrites and redirects with every new non-Drupal php-based app I wanted to try, so I started thinking about how to make Apache work for a small site.</p>
<p>Now I am running Apache2/mod_php with a <a href="http://www.squid-cache.org/">Squid</a> front-end cache. If you&#8217;re not familiar with Squid, in brief it is a web proxy that caches web requests. It is often used to speed up clients but can be reversed to cache requests on the server end in web accelerator mode. Apache uses more RAM than lighttpd/fastcgi, and Squid uses RAM for itself and the cache, so I had to cut back two 2 Apache processes.</p>
<p>That may sound like too little, but here&#8217;s how it works well: the threads aren&#8217;t stuck delivering a request to a slow remote client because the local Squid cache accepts the request locally and then delivers it to the client freeing up the Apache process to handle the next request. 2 processes can handle my traffic because they can quickly deliver their payload to the cache and move on, and Squid can handle the delivery over the network to the client.</p>
<p>Of course sometimes the processes get hung up on slow MySQL queries or slow PHP queries, so occasionally I had delays. In particular I got rid of my RSS requests, because the Apache process had to wait while requesting RSS feeds from other sites, and sometimes that got slow or even timed out leaving just one Apache process handling requests, and if it stumbled on something then I&#8217;d have client requests waiting in line not getting served. So I got rid of my news feeds. Note that I am talking about my web site pulling feeds from other sites; of course I can offer RSS feeds for my Drupal blog with no such PHP delays. I also strive to keep my MySQL running smoothly, but everyone should do that, anyway.</p>
<p>The downside of using Squid is logging. Since Squid is my front-end web server I have Apache listen on 127.0.0.1:80, and Squid accesses it there. So my Apache log files show all requests coming from 127.0.0.1, and many static page or image requests don&#8217;t come through because Squid has them cached. However I configured Squid to log in Apache log format and just use those logs instead.</p>
<p>Of course dynamic content from Drupal has the nocache header, so Squid isn&#8217;t caching the dynamic content for future requests, but it still frees up Apache while delivering it to the client. It does cache the static files like images, style sheets and javascript files, so the Apache threads mostly focus on dynamic content only.</p>
<p>Another way I keep memory usage down is with <a href="http://eaccelerator.net/">eaccelerator</a>. It caches PHP scripts so they don&#8217;t have to recompile every time they&#8217;re run. This can save memory in addition to processor time. After changing Drupal or any of my scripts I usually delete the cache and click around my sites to force all the php to run so eaccelerator will cache it. Then I restart my php processes (Apache2 in the case of Apache/mod-php or the fastcgi server if using fastcgi) to lower their memory usage. After that the cached scripts should run and the PHP processes shouldn&#8217;t bloat as much. Note that every time PHP is updated eaccelerator must be recompiled. In older PHP versions it would crash if you didn&#8217;t, but now it just silently (except for a log entry) fails to cache your scripts if you forget to recompile after a PHP update.</p>
<p>With lighttpd/fastcgi I was able to run 4 PHP processes (memory_limit from 8MB &#8211; 16MB), lighttpd, MySQL and Exim (my mail daemon) in a 256mb VPS with good speed. With Apache2/mod_php I am running 2 Apache2/mod_php processes, Squid (8 MB cache memory), MySQL and Exim in a 256mb VPS. Having only two processes forces me to watch for slow requests like a hawk, but Squid takes care of slow clients. I still ran into memory problems occasionally, but now I have a 384mb VPS and haven&#8217;t had a privvm failure yet.</p>
<p>You may also be interested in <a href="http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/">Using Squid To Cache Apt Updates</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/2008-update-on-running-drupal-on-a-small-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VPS and Sneaky CPU Problems</title>
		<link>http://itkia.com/vps-and-sneaky-cpu-problems/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vps-and-sneaky-cpu-problems</link>
		<comments>http://itkia.com/vps-and-sneaky-cpu-problems/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 03:09:45 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=51</guid>
		<description><![CDATA[My scheduled backup processes made web apps unresponsive. <a href="http://itkia.com/vps-and-sneaky-cpu-problems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>While trying to find the perfect balance to make my sites run well out of my small VPS I noticed that my CPU usage was spiking. Unlike memory issues the Virtuozzo Power Panel didn&#8217;t issue a QoS alert for CPU overages. Apparently when you use too much CPU you just don&#8217;t get cycles for a while. Due to the spiky nature of CPU usage you don&#8217;t see the problem unless you catch it near the top of a spike.</p>
<p>I realized that my backup processes were helping to spike the CPU. I have a cron job to a mysql dump, and I have a remote machine regularly ssh/rsync in to copy files off. ssh and rsync use quite a bit of CPU. I should&#8217;ve realized that would happen, but &#8220;duhhhh&#8221;. I changed all my nonessential scripts to &#8220;nice&#8221; the commands. rsync was a bit tricky to get &#8220;nice&#8221;d, but I found the answers via Googling. What&#8217;s interesting is that Virtuozzo doesn&#8217;t seem to count the nice&#8217;d processes against the VPS&#8217;s CPU usage. They used spare host cycles apparently, and there are tons of spare host cycles. I think I actually sped my backups up with &#8220;nice&#8221;.</p>
<p>It&#8217;s tempting to try to run services nice&#8217;d, because I seem to get more &#8220;spare&#8221; cpu cycles than I get normal ones, but I have a feeling that will cause one problem or another down the line.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/vps-and-sneaky-cpu-problems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Drupal and Small VPSes: Resource Issues</title>
		<link>http://itkia.com/drupal-and-small-vpses-resource-issues/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=drupal-and-small-vpses-resource-issues</link>
		<comments>http://itkia.com/drupal-and-small-vpses-resource-issues/#comments</comments>
		<pubDate>Sat, 14 Oct 2006 03:00:26 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/2006/10/drupal-and-small-vpses-resource-issues/</guid>
		<description><![CDATA[Switched to lighttpd and fastcgi to improve PHP website performance. <a href="http://itkia.com/drupal-and-small-vpses-resource-issues/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>I never did upgrade my VPS RAM. Part of it is laziness, but part of it is that I keep thinking my web server doesn&#8217;t do enough and isn&#8217;t busy enough for 256mb to not be enough.</p>
<p>I&#8217;m using mod_php for drupal and CivicSpace on several sites. I&#8217;m running Apache 2 with the prefork MLM. The problem with this setup and limited resources is that the running Apache processes bloat to handle the biggest PHP script they&#8217;ve run. To counter that I reduced the number of Apache processes. Per earlier blogs, I also deleted unused drupal modules and all my sites work fine under a PHP memory limit of 12mb. Between those two things I&#8217;ve kept my memory issues at bay.</p>
<p>However, running only 4 Apache proceses is causing problems, too. If a PHP script is slow to complete due to business or MySQL slowness, then that thread can&#8217;t handle any more requests.</p>
<p>Using the Apache worker MLM would relieve both the sustained memory bloat issues (memory can be released upon completing the PHP script) and the concurrent connection issues (no problem to make a new thread to handle a new request), but then you have all that PHP &amp; thread stuff to worry about.</p>
<p>I started looking into another solution that I&#8217;m going to try: FastCGI. With FastCGI you take mod_php out of the web server and run a persistent PHP (or other language) interpreter. The web server passes requests to the persistent interpreter. In PHP&#8217;s case, the php-cgi program will spawn multiple child processes to handle requests. I got this working on my home server and it works fine. Now the web server (I also switched to lighttp, but Apache can do FastCGI, too) can handle tons of requests with little resource usage and pass off the PHP scripts to the persistent php-cgi group. Sure, I can still overload my php-cgi group, but at least I can keep servicing small requests while PHP is jammed up. And I&#8217;m not servicing small requests with fat processes. But the biggie is now I can seperately manage my web server resources and my PHP resources for better fine tuning.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/drupal-and-small-vpses-resource-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory Hogging</title>
		<link>http://itkia.com/memory-hogging/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memory-hogging</link>
		<comments>http://itkia.com/memory-hogging/#comments</comments>
		<pubDate>Sat, 22 Apr 2006 19:25:59 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=42</guid>
		<description><![CDATA[Drupal module admin page loads inactive modules bloating limited RAM. <a href="http://itkia.com/memory-hogging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>I&#8217;ve been hitting the limit of my VPS&#8217;s (virtual private server) 256mb RAM limit since installing CivicSpace, and I keep adjusting the php limit to try to avoid having forked processes fail, but then CivicSpace will fail on certain admin pages.</p>
<p>I now understand that when looking at the module activate/deactivate page it loads *every* module installed, even if it&#8217;s not activated. (For other pages it only loads activated modules.) Since CivicSpace includes so many modules, this almost guarantees I&#8217;m going to run out of php memory if I have the limit set at 20mb or 16mb, and that&#8217;s about the same range where I bump my head on the server privvmpages limit given my current configuration.</p>
<p>I don&#8217;t think I&#8217;ve had this problem with Drupal yet, but I probably will as I keep adding modules.</p>
<p>As a temporary fix I&#8217;m going to remove modules that aren&#8217;t used and aren&#8217;t likely to be used. For a more permanent fix I&#8217;m going to pay more to get a higher RAM configuration. Instead of just picking 384mb or 512mb I&#8217;d like to look into how I want Apache, MySQL and PHP tuned and figure out how much RAM should be dedicated to each. I might also setup my own test box and run stress tests on Drupal with various configurations. Then I&#8217;ll know my RAM target.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/memory-hogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

