<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Shane Sveller &#187; server</title>
	<atom:link href="http://shanesveller.com/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://shanesveller.com</link>
	<description>Somewhere between happy and total f**king wreck</description>
	<lastBuildDate>Thu, 07 Jan 2010 18:31:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Passenger and RubyEnt updates</title>
		<link>http://shanesveller.com/2008/08/11/passenger-and-rubyent-updates/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=passenger-and-rubyent-updates</link>
		<comments>http://shanesveller.com/2008/08/11/passenger-and-rubyent-updates/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 15:01:00 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://shanesveller.com/?p=73</guid>
		<description><![CDATA[My webserver is now running Phusion Passenger 2.0.3 for Ruby/Rails apps using Ruby Enterprise Edition 1.8.6-20080810. This greatly simplifies application deployment and helps improve performance and memory usage.]]></description>
			<content:encoded><![CDATA[<p>Updated my web server with <a href="http://rubyenterpriseedition.com">Ruby Enterprise Edition</a> 1.8.6-20080810 and <a href="http://modrails.com">Phusion Passenger</a> 2.0.3 successfully. Both releases feature bugfixes for security issues and the like. My web server currently powers this blog, a <a href="http://www.redmine.org">Redmine</a> instance for my own projects, and some &#8220;production&#8221; servers for a few <a href="http://isgilded.com">Rails apps</a> I&#8217;m writing right now.</p>
<p>I&#8217;d highly recommend Passenger and RubyEnt for low-volume or even high-traffic production Rails servers. It has greatly simplified my deployment and performance on a VPS with, say, 540MB of RAM is stellar. If you set the idle timeout to something huge, you can get almost Nginx+Mongrel/Thin level performance even on a low-traffic server; otherwise you have to wait a brief time (10-15 seconds) when the app has been idle for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://shanesveller.com/2008/08/11/passenger-and-rubyent-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>God is watching over my Rails</title>
		<link>http://shanesveller.com/2008/04/07/god-is-watching-over-my-rails/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=god-is-watching-over-my-rails</link>
		<comments>http://shanesveller.com/2008/04/07/god-is-watching-over-my-rails/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 19:48:58 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[god]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://shanesveller.com/?p=32</guid>
		<description><![CDATA[On my home server, I'm using <a href="http://god.rubyforge.org">God</a> to monitor many server daemons using clean, elegant Ruby code.]]></description>
			<content:encoded><![CDATA[<p>On my home server I&#8217;m toying with some Rails clustering and such, using nginx and thin, and now <a href="http://god.rubyforge.org/">God</a> to watch over things.<br />
With this setup, I can add apps and port-ranges to monitor any time I like, and I can split off a particularly specific configuration group if an app has unusual trends or requirements, such as using loads of memory.<br />
<span id="more-17"></span></p>
<pre class="brush: ruby">RAILS_ROOT = &#039;/var/www/rails&#039;

APPS = {
  &#039;redmine&#039; =&amp;gt; %w{5000 5001 5002 5003 5004},
  &#039;typo5&#039; =&amp;gt; %w{4000 4001 4002}
  }

for app in APPS.keys
  for port in APPS[app]
    God.watch do |w|
      w.name = &#039;#{app}-thin-#{port}&#039;
      w.interval = 30.seconds # default
      w.start = &#039;thin start -C #{RAILS_ROOT}/#{app}/config/thin.yml -o #{port}&#039;
      w.stop = &#039;thin stop -C #{RAILS_ROOT}/#{app}/config/thin.yml -o #{port}&#039;
      w.restart = &#039;thin restart -C #{RAILS_ROOT}/#{app}/config/thin.yml -o #{port}&#039;
      w.start_grace = 10.seconds
      w.restart_grace = 10.seconds
      w.pid_file = File.join(RAILS_ROOT, &#039;/#{app}/tmp/pids/thin.#{port}.pid&#039;)

      w.behavior(:clean_pid_file)

      w.start_if do |start|
        start.condition(:process_running) do |c|
          c.interval = 5.seconds
          c.running = false
        end
      end

      w.restart_if do |restart|
        restart.condition(:memory_usage) do |c|
          c.above = 80.megabytes
          c.times = [3, 5] # 3 out of 5 intervals
        end

        restart.condition(:cpu_usage) do |c|
          c.above = 50.percent
          c.times = 3
        end
      end

      # lifecycle
      w.lifecycle do |on|
        on.condition(:flapping) do |c|
          c.to_state = [:start, :restart]
          c.times = 5
          c.within = 5.minute
          c.transition = :unmonitored
          c.retry_in = 10.minutes
          c.retry_times = 5
          c.retry_within = 2.hours
        end
      end
    end
  end
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shanesveller.com/2008/04/07/god-is-watching-over-my-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
