<?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>Inkzee &#187; php</title>
	<atom:link href="http://blog.inkzee.com/index.php/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.inkzee.com</link>
	<description>How to read more in less time</description>
	<lastBuildDate>Wed, 12 May 2010 13:23:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>		<item>
		<title>Efficent comunication protocols are critical</title>
		<link>http://blog.inkzee.com/index.php/2009/12/26/efficent-comunication-protocols-are-critical/</link>
		<comments>http://blog.inkzee.com/index.php/2009/12/26/efficent-comunication-protocols-are-critical/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 14:30:55 +0000</pubDate>
		<dc:creator>abarrera</dc:creator>
				<category><![CDATA[inkzee]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[communication protocol]]></category>
		<category><![CDATA[cpickle]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.inkzee.com/?p=78</guid>
		<description><![CDATA[As we said before, one on the problems we had when migrating to AWS was that the backend system was putting a lot of stress on the server. After a week of benchmarking we realized that the protocol we where using to communicate between the different subsystems we have was the main responsible for the [...]]]></description>
			<content:encoded><![CDATA[<p>As we <a href="http://blog.inkzee.com/index.php/2009/12/24/christmas-updates/">said before</a>, one on the problems we had when migrating to AWS was that the backend system was putting a lot of stress on the server. After a week of benchmarking we realized that the <strong>protocol</strong> we where using to <strong>communicate</strong> between the different subsystems we have was the <strong>main responsible for the load increment</strong>.</p>
<p>From day one we didn&#8217;t want to use complex and cryptic protocols so we chose <strong>xmlrpc</strong> for our communication channel. It was easy to implement, had wide support in php and python and was very easy to debug. We knew that at some point <strong>we would need to switch</strong> to a more efficient protocol, but we didn&#8217;t know it was going to be so soon.</p>
<p>After doing some <strong>extensive benchmarking</strong> we realize that the <strong>through output of the protocol was very low</strong>, not only that, if too many xmlrpc connections were spawned it would eventually consume all resources of the process (file descriptors, sockets and memory). This was a painful lesson to learn, but we did. So we <strong>switched</strong> to the most efficient protocol we could found, that is <strong>binary</strong>. To be more precise we employ <strong>python&#8217;s cPickle binary protocol</strong>. Saying that the use of this is orders of magnitude more efficient is not even close <img src='http://blog.inkzee.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>So after switching each subsystem to the new protocol we saw the load of the machines going down. As with all big changes in the backend of any system, it took a while to stabilize it. To avoid any havoc we actually put it into production subsystem by subsystem so <strong>during some time we had both protocols running at the same time</strong>.</p>
<p>And so, always remember that the choices you make will come to hunt you if not done correctly <img src='http://blog.inkzee.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inkzee.com/index.php/2009/12/26/efficent-comunication-protocols-are-critical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
