<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

	<title>Tom Martin</title>
	<link href="http://devart.org/atom.xml" rel="self"/>
	<link href="http://devart.org/"/>
	<updated>2011-04-04T20:27:11+01:00</updated>
	<id>http://devart.org/</id>
	<author>
		<name>Tom Martin</name>
		<email>tom@devart.org</email>
	</author>

	
	<entry>
		<title>Monitoring Varnish with Server Density</title>
		<link href="http://devart.org/mointoring-varnish-with-server-density"/>
		<updated>2011-04-04T00:00:00+01:00</updated>
		<id>http://devart.org/mointoring-varnish-with-server-density</id>
		<content type="html">&lt;p&gt;Varnish is a high performance &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Cache and provides incredible performance for sites and applications. &lt;a href=&quot;http://www.serverdensity.com/&quot;&gt;Server Density&lt;/a&gt; is a hosted server monitoring application, which deals with reporting, managing and alerting you to any server issues. Server Density has support metrics such as Apache, Nginx, MySQL but not Varnish.&lt;/p&gt;
&lt;p&gt;Varnish support isn&amp;#8217;t provided by default, so here&amp;#8217;s a &lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;Server Density Varnish plugin&lt;/a&gt; which will provide loverly looking graphs like:&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;&lt;img src=&quot;/images/assets/varnish-sd-usage.png&quot; title=&quot;Varnish Usage&quot; alt=&quot;Varnish Usage&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Usage gives you a good breakdown of cache hits vs cache misses.&lt;/p&gt;
&lt;h2&gt;Cache Percentage&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;&lt;img src=&quot;/images/assets/varnish-sd-cache-percentage.png&quot; title=&quot;Varnish Cache Percentage&quot; alt=&quot;Varnish Cache Percentage&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cache Percentage is a pretty important metric, the higher the value the more performance you&amp;#8217;ll get out of Varnish.&lt;/p&gt;
&lt;h3&gt;Backends&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;&lt;img src=&quot;/images/assets/varnish-sd-backend.png&quot; title=&quot;Varnish Backend&quot; alt=&quot;Varnish Backend&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Gives you a good breakdown of how you backends, import metrics to notice are backend_busy and backend_fail&lt;/p&gt;
&lt;h3&gt;Total Bytes&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;&lt;img src=&quot;/images/assets/varnish-sd-total-bytes.png&quot; title=&quot;Varnish Total Bytes&quot; alt=&quot;Varnish Total Bytes&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s probably the least useful day to day, but can let you know if you&amp;#8217;ve just served a surge of traffic.&lt;/p&gt;
&lt;p&gt;With any of these graphs, Server Density allows you to set alerts for any important metrics.&lt;/p&gt;
&lt;p&gt;Installing the plugin is fairly straightforward, Varnish needs to be running with the &lt;a href=&quot;http://www.varnish-cache.org/trac/wiki/ManagementPort&quot;&gt;management port&lt;/a&gt; enabled next you&amp;#8217;ll just need to edit the plugin to provide the port and IP address, next you&amp;#8217;ll need to setup the graph groups from within SD. Unfortunately there isn&amp;#8217;t any way to preload a plugin with graphs or provide configuration options.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;ve got some improvements to make, please &lt;a href=&quot;https://github.com/deplorableword/sd-varnish&quot;&gt;fork the plugin&lt;/a&gt; and send me a pull request.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Building a hack night</title>
		<link href="http://devart.org/building-a-hacknight"/>
		<updated>2011-03-29T00:00:00+01:00</updated>
		<id>http://devart.org/building-a-hacknight</id>
		<content type="html">&lt;p&gt;I&amp;#8217;ve often been envious of hack nights that happen in SF, NY and many other two letter american states. I&amp;#8217;m also especially jealous of all of the great events that happen in London town, stuff like the &lt;a href=&quot;http://www.meetup.com/London-Web-Performance-Group/&quot;&gt;Web Performance Group&lt;/a&gt; and the &lt;a href=&quot;http://lrug.org/&quot;&gt;London Ruby Group&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, I created HydraHack, a meetup for developers in Birmingham who want to hack on projects with other developers or just grab some time for working on their own code. It should be less about sitting for 40 minutes though a presentation and more about meeting other people and sharing ideas and code.&lt;/p&gt;
&lt;h2&gt;Begin&lt;/h2&gt;
&lt;p&gt;Picking a date was the first step, even before I had a name or any idea who should turn up. Pick a name, book a location, now I had a deadline. I fired a few emails off to some local devs for a sanity check &amp;#8220;Yep, good idea.&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://stuffage.tumblr.com/&quot;&gt;Justine&lt;/a&gt; helped me figure out the name. &lt;a href=&quot;http://www.hydrahack.co.uk/&quot;&gt;HydraHack&lt;/a&gt;&lt;/p&gt;
&lt;div id=&quot;gallery&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/thedeplorableword/5573104761/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5135/5573104761_e56686380a.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Promote&lt;/h2&gt;
&lt;p&gt;To get some interest, I threw up a static page running on Heroku with the details and got the domain. I added a Twitter button which broadcast the meetup to anyone that RSVPed. Although I had to push a new version of the site anytime anyone actually pressed it, was actually quicker than writing any real code.&lt;/p&gt;
&lt;p&gt;I had a few local developers in my Twitter list so they all got an invite, there&amp;#8217;s also a couple of local &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; and Ruby meetups, they were a great place to get some initial interest. To find people outside my regular network I used really ugly services like &lt;a href=&quot;http://www.twellow.com/search?q=birmingham&amp;amp;search_cat=106&quot;&gt;Twellow&lt;/a&gt; to find some other web folk, there&amp;#8217;s quite a high noise rate but I stumbled across a few people I&amp;#8217;d never met before.&lt;/p&gt;
&lt;p&gt;I also put the event up on &lt;a href=&quot;http://lanyrd.com/2011/hydrahack-march/&quot;&gt;Laynrd&lt;/a&gt; which is becoming the best place to &lt;span class=&quot;caps&quot;&gt;RSVP&lt;/span&gt;/ Track events. Not only is tied in to everyone&amp;#8217;s social graph, it helped me find a bunch of similar events and more local developers to share the event with.&lt;/p&gt;
&lt;h2&gt;Profit!&lt;/h2&gt;
&lt;p&gt;Kindly &lt;a href=&quot;http://www.campaignmonitor.com/&quot;&gt;Campaign Monitor&lt;/a&gt; agreed to sponsor the drinks for the first meetup. With the lure of free coffee we managed we got 16 developers crammed into &lt;a href=&quot;http://www.urbancoffee.co.uk/&quot;&gt;Urban Coffee Company&lt;/a&gt; hacking away on various projects. I&amp;#8217;d just like to say thanks again to everyone that turned up, I couldn&amp;#8217;t of asked for a better start.&lt;/p&gt;
&lt;div id=&quot;gallery&quot;&gt;

&lt;a href=&quot;http://www.flickr.com/photos/andydev/5553807585/in/set-72157626336048022/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5301/5553807585_2177239684_m.jpg&quot; title=&quot;HydraHackMarch&quot; alt=&quot;HydraHackMarch&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.flickr.com/photos/andydev/5553820363/in/set-72157626336048022/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5173/5553820363_823a891eec_m.jpg&quot; title=&quot;HydraHackMarch&quot; alt=&quot;HydraHackMarch&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.flickr.com/photos/andydev/5554397012/in/set-72157626336048022/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5301/5554397012_2cfb198460_m.jpg&quot; title=&quot;HydraHackMarch&quot; alt=&quot;HydraHackMarch&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.flickr.com/photos/andydev/5553816927/in/set-72157626336048022/&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5229/5553816927_eae193ecd7_m.jpg&quot; title=&quot;HydraHackMarch&quot; alt=&quot;HydraHackMarch&quot; /&gt;&lt;/a&gt;

&lt;/div&gt;
&lt;h2&gt;Next&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;m busy organising the second meetup, tracking down developers, getting a sponsor  and finding shiny free tech for people to play with. I have no idea how it will evolve, but I like &lt;a href=&quot;http://thedeplorableword.net/post/4185806684/making-things-fast&quot;&gt;making things fast&lt;/a&gt; and watching what happens.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Jekyll on Heroku using Sinatra</title>
		<link href="http://devart.org/jeykll-on-heroku-with-sinatra"/>
		<updated>2011-01-16T00:00:00+00:00</updated>
		<id>http://devart.org/jeykll-on-heroku-with-sinatra</id>
		<content type="html">&lt;p&gt;This site runs on Jekyll, the static site generator written in Ruby. It&amp;#8217;s running on Heroku and thanks to Sinatra, it can take advantage Heroku&amp;#8217;s &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Caching library to give a huge increasing in performance.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/mojombo/jekyll&quot;&gt;Jekyll&lt;/a&gt; is a pretty amazing little gem, it allows you to quickly build a static site (the output is entirely &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;) it uses a great tempting engine and an easy to understand folder structure. It&amp;#8217;s no wonder that this has made an excellent choice for a simple blog, simply drop a textfile in the &lt;code&gt;/_posts&lt;/code&gt; regenerate your site and you&amp;#8217;ve just made a new post.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://heroku.com/&quot;&gt;Heroku&lt;/a&gt; an extremely easy to use Ruby host, you can use it for free to to deploy Ruby on Rails and Rack applications. For Rack, you just need to drop in the &lt;a href=&quot;http://docs.heroku.com/rack:correct&quot;&gt;correct config&lt;/a&gt; config and off you go. But what about Jekyll? Heroku uses a Read-Only file system so you can&amp;#8217;t use Jekyll to automatically generate static pages on Heroku, instead you need to run Jekyll before you deploy creating all your pages and then push the entire app (including rendered &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;) to Heroku.&lt;/p&gt;
&lt;p&gt;A Jekyll site doesn&amp;#8217;t really fit into either the Ruby on Rails or standard Rack app pattern, so if you simply push the site up, Heroku will reject the application because it&amp;#8217;s not a Rack or Ruby or Rails app.&lt;/p&gt;
&lt;h2&gt;Gem to the rescue.&lt;/h2&gt;
&lt;p&gt;When my initial push failed I went around looking for a solution, there&amp;#8217;s a &lt;a href=&quot;https://github.com/bry4n/rack-jekyll&quot;&gt;Rack-Jeykll&lt;/a&gt; gem which will transform your standard Jeykll site into a Rack application.&lt;/p&gt;
&lt;p&gt;Unfortunately the way the Rack-Jeykll gem works, it doesn&amp;#8217;t seem possible to add any kind of &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; headers within the app. What &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; headers would you want to add you ask? Well, to increase application performance you typically want to allow browsers and any proxies to cache anything which won&amp;#8217;t change for a while. Heroku also runs &lt;a href=&quot;http://www.varnish-cache.org/&quot;&gt;Varnish&lt;/a&gt;, a &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Cache in front of your application, this will any request straight out of the Varnish without even hitting your application. It can give it a pretty sizeable speed boost, especially when using the free plan.&lt;/p&gt;
&lt;h2&gt;Welcome Sinatra&lt;/h2&gt;
&lt;p&gt;After a little searching, it turns out you can use &lt;a href=&quot;http://jstorimer.com/2009/12/29/jekyll-on-heroku.html&quot;&gt;Sinatra  with Jeykll&lt;/a&gt; to easily run your app.&lt;/p&gt;
&lt;p&gt;You config.ru file just needs to require your app.&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/781871.js?file=config.ru&quot;&gt;&lt;/script&gt;&lt;p&gt;And your app just needs to require the Sinatra gem, and route any requests though to the correct file in your _site folder. This allows any cache control headers to be set so both browsers and Varnish will cache the resources to improve performance.&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/781871.js?file=devart.rb&quot;&gt;&lt;/script&gt;&lt;p&gt;This setup allows you to use Jekyll to serve static files while still using Sinatra for any custom routes or 404 pages. This setup also allows me to use the the post slug as the &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; and remove the date.&lt;/p&gt;</content>
	</entry>
	
	<entry>
		<title>Monitoring Memcached with Server Density</title>
		<link href="http://devart.org/mointoring-server-density-memcached"/>
		<updated>2011-01-06T00:00:00+00:00</updated>
		<id>http://devart.org/mointoring-server-density-memcached</id>
		<content type="html">&lt;p&gt;Server Density is a fantastic product for monitoring server performance, but by default Memcached it not a supported service, fortunately you can write plugins in Python to extend monitoring to any kind of metric.&lt;/p&gt;
&lt;p&gt;For Memcached there was a &lt;a href=&quot;https://gist.github.com/340666/65888413a3930a56e3bf9bf3ad6ffbc94107d5ad&quot;&gt;pre-existing plugin&lt;/a&gt; written by chrisreid, but this depends on the python-memcached library, which as a total newcomer to Python and packaging for Red Hat I found pretty difficult to install.&lt;/p&gt;
&lt;p&gt;So I tried the simplest thing which could possibly work, turns out you can telnet into the memcached port 11211 and ask for stats. So with a little knowledge of Python regex and lots of  tinkering I present a &lt;a href=&quot;https://github.com/deplorableword/sd-memcached&quot;&gt;Server Density Memcached plugin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/deplorableword/sd-memcached&quot;&gt;&lt;img src=&quot;/images/assets/memcached-serverdensity-plugin.png&quot; title=&quot;quite a boring screenshot of memcached working as expected&quot; alt=&quot;quite a boring screenshot of memcached working as expected&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Install instructions are really easy to follow and hopefully you won&amp;#8217;t have too much trouble getting it setup, if the server is running on another IP or port to the defaults (127.0.0.1:11211) you&amp;#8217;ll need to hack the plugin as there&amp;#8217;s no way for me to allow config in SD.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s great about any of the plugins you install for SD is that they all act the same as the native metrics, so if you want to get alerted when your Memcached misses grow larger than your hits you can create an alert just as easy as you would for a high load or memory.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;ve got some improvements to make, please &lt;a href=&quot;https://github.com/deplorableword/sd-memcached&quot;&gt;fork the plugin&lt;/a&gt; and send me a pull request, the plugin source is released under the New &lt;span class=&quot;caps&quot;&gt;BSD&lt;/span&gt; License.&lt;/p&gt;</content>
	</entry>
	

</feed>
