<?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>No Droids Allowed &#187; Uncategorized</title>
	<atom:link href="http://www.nodroidsallowed.com/topics/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nodroidsallowed.com</link>
	<description>Practical techniques for raising a well-adjusted database</description>
	<lastBuildDate>Wed, 09 Jun 2010 17:49:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tips for those Applying to Founder Institute</title>
		<link>http://www.nodroidsallowed.com/2010/03/02/tips-for-those-applying-to-founders-institute/</link>
		<comments>http://www.nodroidsallowed.com/2010/03/02/tips-for-those-applying-to-founders-institute/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 19:49:48 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=184</guid>
		<description><![CDATA[I thought I'd write a little bit about what I've learned to help others get the most out of the experience.  Some of these are practical, some of these are just things to keep in mind as you progress through the semester.]]></description>
			<content:encoded><![CDATA[<p>As I mentioned previously I&#8217;ve been involved in the Winter 2009 semester of the <a href="http://founderinstitute.com">Founder Institute</a> in NYC.  I thought I&#8217;d write a little bit about what I&#8217;ve learned to help others get the most out of the experience.  Some of these are practical, some of these are just things to keep in mind as you progress through the semester.  In no particular order&#8230;.</p>
<ul>
<li><b>You&#8217;ll get the most out of it if you have an idea of what you want to do before you start</b>.  To its credit, the Institute will accept you if you don&#8217;t have an idea, but to some degree I think this is giving people just enough rope to hang themselves given the aggressive nature of the curriculum.  The fact of the matter is that those of us who got the most out of the Founder Institute came in already pretty much knowing what we wanted to do and spent a lot of time tuning and focusing it.  Yes, the first couple of sessions will be about how to develop an idea, how to research the opportunity, etc.  I found the information to be very useful, but more in a &#8220;good to know for next time&#8221; way.  It&#8217;s really hard to keep up with the later sessions if you spend the first 3 or 4 weeks vetting 5 different ideas.</li>
<li>Therefore, getting in is about you as a founder, not your idea.  <b>But staying in is about how well you execute on your idea.</b> Don&#8217;t forget that you are expected to have an incorporated company with a real business model and a real plan for success at the end of this.  It&#8217;s not as easy as it looks.</li>
<li><b>Actively seek out those who will challenge your assumptions sooner rather than later.</b>  It took me a while to realize that those who didn&#8217;t want to talk about their idea (including myself) were doing so because they didn&#8217;t want to hear the hard truth about what someone else thought.  I know it&#8217;s not easy to hear.  We&#8217;ve all convinced ourselves that whatever we&#8217;re thinking of doing can&#8217;t possibly fail and that anyone who doesn&#8217;t see it that way is wasting our time.  That&#8217;s expected.  But keeping it to yourself doesn&#8217;t prove anything.  You join this program because you want your idea to succeed. </li>
<li><b>Sign up for office hours.</b>  It&#8217;s free advice from people who have done this before and want to help you succeed.  If you&#8217;re serious about building a business there&#8217;s no excuse for passing that opportunity up.</li>
<li><b>Keep an open mind at all times.</b>  That pain you feel when someone criticizes your idea &#8211; that&#8217;s called growth.  No one&#8217;s going to plunk down a bag of cash for a clever idea.  At times someone &#8220;just won&#8217;t get it&#8221;.  When that happens you can either find a way to convince them or become defiant and disengage.  You can probably guess which one will work in your favor long term.  Take the feedback (good and bad) and get better.</li>
<li>That being said, <b>know when to take advice and when to leave it.</b>  It&#8217;s your company.  Don&#8217;t ever forget that.  It was your company before the Founder Institute.  It will be your company after the Founder Institute.  If something really matters to you, stand your ground.  Realize that you may still be wrong, but at least you learned something valuable.
<li><b>Volunteer to be president of your working group.</b>  People act like being the president of the group is like getting the plague or something.  It&#8217;s not that bad.  For the most part you&#8217;re just organizing meetings and taking notes.  Yes, there are some founders who can&#8217;t keep up and you have to find a way to motivate them.  It can be time consuming in a lot of ways, but it&#8217;s good practice and there are a number of upsides that come with the role.  I was president for the 2nd and 3rd groups and found it to be valuable.</li>
<li><b>Time is short, be ready to work.</b>  Kinda goes without saying.  There&#8217;s not a lot of time in the program and a lot to do.  If you&#8217;re going to do this right it&#8217;ll need to be a priority in your life for 3 or 4 months.  Make sure your spouse or significant other understands this as well.</li>
<li><b>Network, network, network.</b>  Get to know the other founders.  Go out for drinks after each session.  Find out about their business.  Tell them about yours.  Organize on LinkedIn.  Connect with mentors where appropriate.  These people have a stake in making sure you&#8217;re successful and you have a stake in making sure they&#8217;re successful.  A little extra effort will pay off for everyone.</li>
<li><b>The working groups can make or break your experience.</b>  A good working group can help you in more ways than you expect.  A bad working group can really tax your energy.  If things aren&#8217;t going well in your group, talk to your president.  If he or she doesn&#8217;t listen talk to your local facilitator.  Don&#8217;t let it slide.  It&#8217;s up to you to get as much value as you can out of the experience, and every week counts.</li>
<li><b>The mentors are great but aren&#8217;t everything.</b>  I came in expecting a one-on-one mentorship.  It was a bit naive.  The mentors are both successful and busy.  They are all nice, and all helpful, but don&#8217;t expect too much.  Honestly I don&#8217;t think I connected on a personal level with many of them.  Part of it is that none of them really know my space very well, and I can&#8217;t really blame them that for that.  It might speak more about my company than I want to think about.</li>
</ul>
<p>Feel free to ask questions in the comments.  If appropriate I will contact you directly via the email address you supply.  As I&#8217;m still participating in the Founder Institute I&#8217;ve tried to avoid any conclusive statements.  There&#8217;s still a lot of time left in this semester and a lot has changed even since my last post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2010/03/02/tips-for-those-applying-to-founders-institute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rackspace Email Hosting vs. Google Apps</title>
		<link>http://www.nodroidsallowed.com/2009/12/29/rackspace-email-hosting-vs-google-apps/</link>
		<comments>http://www.nodroidsallowed.com/2009/12/29/rackspace-email-hosting-vs-google-apps/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 18:04:38 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=171</guid>
		<description><![CDATA[Today I discovered that Rackspace has an email hosting solution competitor to Google Apps for your domain]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d been using <a href="http://www.google.com/apps/">Google Apps</a> for receiving emails sent to my domain up until an hour ago.  As I&#8217;ve mentioned before, I&#8217;m running my app on <a href="http://www.slicehost.com/">Slicehost</a>, and as usual they had some <a href="http://articles.slicehost.com/2007/10/25/creating-mx-records-for-google-apps">great instructions for using Google Apps for your email needs</a>.</p>
<p>That was working kinda ok but there were a couple of things that annoy me about that solution.  First is that I just don&#8217;t want Google involved in every single thing I do online.  I generally trust them, but there are some things I don&#8217;t want to use them for, namely anything to do with my business (I don&#8217;t use Google Analytics either).  The second is that I think it&#8217;s highway robbery to pay $50 per user per year for the premier account.  I only need 2 right now, but down the line I might need more.  I didn&#8217;t relish the thought of giving them $300 or $400 a year to provide a beefed up version of their free tools.</p>
<p>So today I discovered that <a href="http://www.rackspace.com/email_hosting/rackspace_email">Rackspace has an email hosting solution</a> as well.  And if you&#8217;re a Slicehost customer and need 3 or fewer inboxes (that me!) it&#8217;s only $3/month.  The normal starter package&#8217;s price is $10/month for up to 10 inboxes, which is still totally reasonable.  So in less than an hour I converted from Google Apps to Rackspace Email Hosting.  And of course they have the usual <a href="http://articles.slicehost.com/2009/11/4/creating-mx-records-for-rackspace-email-apps">helpful configuration instructions</a> to get you started.</p>
<p>I have a couple of concerns that I&#8217;ll follow up on in future posts.  The first is that according to the representative I chatted with there&#8217;s a limit of about 200 outgoing emails per hour.  I think that&#8217;s going to be ok for my app, but I guess I&#8217;ll see.  The other is that I&#8217;m pretty useless with mail configuration things and I&#8217;m a little nervous about how much effort will be involved in connecting my local postfix to their smtp server for outgoing email.  I&#8217;m sure I&#8217;ll figure that out eventually though.</p>
<p>In any case, for $3/month, moving back to Google won&#8217;t be a huge issue if it should come to that.  Hopefully it won&#8217;t.  I&#8217;ve already gotten a few small tastes of the fanatical support from Rackspace and I have to say it&#8217;s pretty nice so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/12/29/rackspace-email-hosting-vs-google-apps/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Request Translation</title>
		<link>http://www.nodroidsallowed.com/2009/08/12/request-translation/</link>
		<comments>http://www.nodroidsallowed.com/2009/08/12/request-translation/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 20:51:59 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/2009/08/12/request-translation/</guid>
		<description><![CDATA[Request: Can you give me expected adoption rates of the new XYZ feature so we can estimate whether we have sufficient capacity to handle incoming traffic?
Translation: Can you pretend to understand the unknowable well enough to pull a random but superficially believable number out of your ass which I will crucify you with later on [...]]]></description>
			<content:encoded><![CDATA[<p>Request: Can you give me expected adoption rates of the new XYZ feature so we can estimate whether we have sufficient capacity to handle incoming traffic?</p>
<p>Translation: Can you pretend to understand the unknowable well enough to pull a random but superficially believable number out of your ass which I will crucify you with later on if it turns out that whatever I did to prepare was insufficient and/or people generally believe that the failure was my fault.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/08/12/request-translation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update on nginx and Piwik</title>
		<link>http://www.nodroidsallowed.com/2009/08/11/update-on-nginx-and-piwik/</link>
		<comments>http://www.nodroidsallowed.com/2009/08/11/update-on-nginx-and-piwik/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 15:16:00 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=99</guid>
		<description><![CDATA[In my previous post I summoned some hackish magic to fix something that I didn&#8217;t really understand.  That&#8217;s usually not good practice.  Most experienced developers have a well-tuned b.s. detection system and will return to unnecessarily hackish code almost as a matter of necessity.  That was the case here, and what I [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.nodroidsallowed.com/2009/08/07/nginx-piwik-and-content-type-headers/">previous post</a> I summoned some hackish magic to fix something that I didn&#8217;t really understand.  That&#8217;s usually not good practice.  Most experienced developers have a well-tuned b.s. detection system and will return to unnecessarily hackish code almost as a matter of necessity.  That was the case here, and what I found was that the error was in my <a href="http://nginx.net/">nginx</a> conf file.  For whatever reason I had nginx misconfigured and content JavaScript, CSS, and SWF files were being served up by fast-cgi instead of being handled by nginx directly.  Here&#8217;s a relevant section of my updated conf file:</p>
<div class="ddl">
<pre>
# Stop Image and Document Hijacking
# Also have to handle these file types for piwik before they get processed by PHP below
location ~* (\.jpg|\.png|\.css|\.gif|\.jpeg|\.js|\.swf)$ {

   if ($http_referer ~* ^(http://my.domain.com) ) {
      expires max;
      break;
   }

   return 444;

}

location / {

   root   /home/public_html/my.domain.com/public/;
   index  index.php index.html;

   # this serves static files that exist without running other rewrite tests
   if (-f $request_filename) {
      expires max;
      break;
   }

   fastcgi_pass 127.0.0.1:9000;
   fastcgi_index index.php;
   include /usr/local/nginx/conf/fastcgi_params;
   fastcgi_param SCRIPT_FILENAME /home/public_html/my.domain.com/public/$fastcgi_script_name;
   include fastcgi_params;
}
</pre>
</div>
<p>Everything got better after that.  Not sure who I thought I was fooling with my first solution, but it didn&#8217;t even work on myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/08/11/update-on-nginx-and-piwik/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nginx, Piwik, and Content Type Headers</title>
		<link>http://www.nodroidsallowed.com/2009/08/07/nginx-piwik-and-content-type-headers/</link>
		<comments>http://www.nodroidsallowed.com/2009/08/07/nginx-piwik-and-content-type-headers/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 15:32:35 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=88</guid>
		<description><![CDATA[Note this Update: read update
I decided to give Piwik a try as my web analytics tool.  I&#8217;ve used Mint in the past and am mostly happy with it, but I sometimes feel Shaun Inman has no sense of urgency to make improvements to catch up to the big guys.  I also considered Google [...]]]></description>
			<content:encoded><![CDATA[<p><b>Note this Update:</b> <a href="http://www.nodroidsallowed.com/2009/08/11/update-on-nginx-and-piwik/">read update</a></p>
<p>I decided to give <a href="http://piwik.org/">Piwik</a> a try as my web analytics tool.  I&#8217;ve used <a href="http://haveamint.com/">Mint</a> in the past and am mostly happy with it, but I sometimes feel Shaun Inman has no sense of urgency to make improvements to catch up to the big guys.  I also considered <a href="http://www.google.com/analytics/">Google Analytics</a> and <a href="http://getclicky.com/">GetClicky</a> but can&#8217;t get over the idea of someone else owning my analytics data.  Sure, that&#8217;s fine for my blog or other smaller sites, but for something &#8220;important&#8221;, I&#8217;d rather hold onto it myself.</p>
<p>Piwik installation was pretty straightforward, typical fare these days.  First thing I noticed was that the site was completely broken in FireFox, but seemed to work fine in IE.  Firing up <a href="http://www.charlesproxy.com/">Charles</a> I saw 2 things that smelled wrong:</p>
<ol>
<li>Requests for JavaScript and CSS files had a cache-busting query parameters stuck on the end of it, e.g. <span class="code">/piwik/themes/default/common.css?piwik=0.4.2</span>.  The idea here is that they can set a far-futures expires header on that file and let the browser cache it forever.  When they release a new version of the site, they increment the version number on the request parameter and the browser goes and fetches the new styles or scripts.  I thought this was an interesting technique, but possibly confusing nginx because&#8230;.</li>
<li>The &#8220;Content-Type&#8221; header was coming back as &#8220;text/html&#8221; for both JavaScript and CSS files.</li>
</ol>
<p>IE doesn&#8217;t seem to mind that the content type was set incorrectly but Firefox refused to apply the styles because of it.  So I started tinkering to see what I could do.  Worst case scenario I would just have to use piwik only in IE, but that seemed kind of defeatist.  Strangely, no one else on the interwebs seemed to be having the same issue, which lead me to think it was something specific to my environment.</p>
<p>The first thing I tried was to remove the cache busting request parameter by commenting out this line of code in the piwik source code:</p>
<div class="ddl">
$this->smarty->load_filter(&#8216;output&#8217;, &#8216;cachebuster&#8217;);
</div>
<p>I found that line in the file <span class="code">core/View.php</span> on line 54 in version 0.4.2.  That got rid of the cache busting query parameter, but didn&#8217;t fix the content type issue, so I ended up putting that line back in.  I tried dropping one of the CSS files I was testing on another server and requesting that to see the headers.  They turned out to be fine, at which point I decided it had to be an nginx issue.  A couple of hacky attempts later I came up with the idea of just adding another header to JavaScript or CSS files as such:</p>
<div class="ddl">
<pre>
   if ( $request_filename ~* (\.css) ){
      add_header Content-Type "text/css; charset=UTF-8";
      break;
   }

   if ( $request_filename ~* (\.js) ){
      add_header Content-Type "application/x-javascript; charset=UTF-8";
      break;
   }
</pre>
</div>
<p>That seems to work.  Not entirely thrilled about it since I still don&#8217;t fully understand why it&#8217;s happening.  Two Content-Type headers are getting set, but Firefox is ok with that for now.  Oh well.</p>
<p><b>Note this Update:</b> <a href="http://www.nodroidsallowed.com/2009/08/11/update-on-nginx-and-piwik/">read update</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/08/07/nginx-piwik-and-content-type-headers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeIgniter and Minify Redux</title>
		<link>http://www.nodroidsallowed.com/2009/07/23/codeigniter-and-minify-redux/</link>
		<comments>http://www.nodroidsallowed.com/2009/07/23/codeigniter-and-minify-redux/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:52:10 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=64</guid>
		<description><![CDATA[My previous article about CodeIgniter and Minify was a relative hit (relative only to my other posts that is), but some thinking since the original version mixed with some of the great comments on that post have prompted me to update the integration points a little to improve the flexibility and maintainability.  Requiring a [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.nodroidsallowed.com/2008/09/22/codeignitermeet-minify/">previous article about CodeIgniter and Minify</a> was a relative hit (relative only to my other posts that is), but some thinking since the original version mixed with some of the great comments on that post have prompted me to update the integration points a little to improve the flexibility and maintainability.  Requiring a new method inside the <span class="code">MY_Includes.php</span> file for each controller got to be a bit of a bear.  Also, the wacky mapping that I did in the <span class="code">init</span> method was overkill.  Lastly, the code from the original post broke when <a href="http://codeigniter.com/">CodeIgniter 1.7.1</a> was release because of the new support for name aliasing of library classes, so it needed an update anyway.</p>
<p>What I decided to do was to export the mapping to a config file.  <a href="http://www.nodroidsallowed.com/minify/minify_config.php.txt">See an example config file here</a>.  This file goes into the <span class="code">application/config</span> directory.  You probably also want to update <span class="code">application/config/autoload.php</span> to autoload that config file:</p>
<div class="ddl">
$autoload['config'] = array(&#8216;minify_config&#8217;);
</div>
<p>It is assumed that all JavaScript files are in the same location on disk and all CSS files are all in the same location on disk.  It also assumes that all JavaScript files end with <span class="code">js</span> and all CSS files end with <span class="code">css</span>.  The rest (mostly paths) can all be configured.  I don&#8217;t show it but I have the absolute paths to the JavaScript/CSS files in the standard CodeIgniter config file.</p>
<p>The <span class="code">minify_config.php</span> config file sets up a hash where the key is the controller name and the value is an array of JavaScript or CSS filenames.  For simplicity&#8217;s sake the file name array is only one-dimensional, so you&#8217;ll notice the use of <span class="code">array_merge</span> in some spots.</p>
<p>The <span class="code">MY_Includes</span> class itself is greatly simplified now, but at its core performs the same task as the <a href="http://www.nodroidsallowed.com/2008/09/22/codeignitermeet-minify/">previous version</a>, building a list of files to be included and passing them off to <a href="http://code.google.com/p/minify/">Minify</a> for processing.  The <a href="http://www.nodroidsallowed.com/minify/includetag.php.txt">includetag.php</a> controller is unchanged.</p>
<p>So the new and improved steps for integration are:</p>
<ol>
<li>Download <span class="code">MY_Includes.php</span> (<a href="http://www.nodroidsallowed.com/minify/MY_Includes.php.txt">here</a>) and put it in your <span class="code">/system/applications/libraries</span> directory</li>
<li>Download <span class="code">minify_config.php</span> (<a href="http://www.nodroidsallowed.com/minify/minify_config.php.txt">here</a>) and put it in your <span class="code">application/config</span> directory</li>
<li>Edit the <span class="code">init</span> method inside of <span class="code">MY_Includes.php</span> to include the correct path to your Minify installation</li>
<li>(Optional) Edit the <span class="code">compileTags</span> method inside of <span class="code">MY_Includes.php</span> to include any special rules.  Out of the box it will include a config item named <span class="code">global</span> on every request, then check to see if there are any controller-specific files to include.</li>
<li>Download <span class="code">includetag.php</span> (<a href="http://www.nodroidsallowed.com/minify/includetag.php.txt">here</a>) and put it in the <span class="code">/system/applications/controllers</span> directory</li>
<li>Add the two code fragments commented with the text &#8220;for globally included header file&#8221; below to the appropriate file in your application</li>
<li>Fire it up</li>
</ol>
<div class="ddl">
//for globally included header file (e.g. header.php)<br />
//so know which CSS or JS files to include<br />
$pageName  = $this->uri->segment(1, 0);<br />
$pageName .= &#8220;/&#8221; . $this->uri->segment(2, &#8220;index&#8221;);<br />
$this->load->library(&#8220;MY_Includes&#8217;, $pageName);
</div>
<div class="ddl">
        &lt;!&#8211; for globally included header file (e.g.header.php) &#8211;&gt;<br />
        &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;&lt;?= $this->CI->my_includes->cssTag(); ?&gt;&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; /&gt;<br />
        &lt;script src=&#8221;&lt;?= $this->CI->my_includes->jsTag(); ?&gt;&#8221; type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;&lt;/script&gt;
</div>
<p>Feel free to post a comment if you have troubles and I’ll walk you through it or edit the post to fix any errors as needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/07/23/codeigniter-and-minify-redux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Say it Ain&#8217;t So Memcache</title>
		<link>http://www.nodroidsallowed.com/2009/06/13/say-it-aint-so-memcache/</link>
		<comments>http://www.nodroidsallowed.com/2009/06/13/say-it-aint-so-memcache/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 20:19:55 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=47</guid>
		<description><![CDATA[I will never claim that application profiling and stress testing are my strongpoints, but I&#8217;m having a really difficult time understanding the results of some tests I&#8217;ve been performing on my application.
Here&#8217;s the setup.  My application is on 2 256 slices, 1 running nginx and PHP through fast cgi.  The other is running [...]]]></description>
			<content:encoded><![CDATA[<p>I will never claim that application profiling and stress testing are my strongpoints, but I&#8217;m having a really difficult time understanding the results of some tests I&#8217;ve been performing on my application.</p>
<p>Here&#8217;s the setup.  My application is on 2 <a href="http://www.slicehost.com">256 slices</a>, 1 running <a href="http://nginx.net/">nginx</a> and PHP through fast cgi.  The other is running MySQL.  Outside of things like monit and munin, there is nothing else running on these slices.  Perfect time to do some stress testing.  The application is fairly database heavy, so I long ago decided to integrate <a href="http://www.danga.com/memcached/">memcache</a> with an eye towards boosting peformance.  Or so I thought (notice ominous foreshadowing).</p>
<p>My strategery with memcache is to never assume that it is either running, working, or contains the data I need.  So my app will use it if it&#8217;s there but will carry on unaffected if it&#8217;s not.  I left hooks in the app to be able to shut off memcache through config changes for cases where I&#8217;m testing via <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> and don&#8217;t have memcache running locally.  This turned out to be very useful.</p>
<p>I have a third slice (which runs this blog and a couple of other smaller sites) that I installed <a href="http://acme.com/software/http_load/">http_load</a> on.  I used this box to drive the load tests.</p>
<p>One thing about http_load is that it doesn&#8217;t understand cookies.  You provide it a URL or list of URLs and it just whacks on them until the server breaks.  That poses a problem for apps like mine where being logged in is essential to the experience.  So I had to make a few changes to the application to support a load testing mode.  Once I change to this mode it will take the session identifier out of my config file instead of the cookie.  No muss, no fuss, no meaningful change to the app&#8217;s behavior while in test mode, which is essential to ensure I&#8217;m comparing apples to apples.</p>
<p>OK, enough setup.  Here&#8217;s one of my test scripts:</p>
<div class="ddl">http_load -parallel 5 -seconds 30 test.url > test.out</div>
<p>So, run 5 threads for 30 seconds.  While that&#8217;s going on I&#8217;m checking top on my nginx and MySQL slices.  First thing I notice &#8211; MySQL is pretty much sleeping through the test.  Good news.  Load on that slice barely breaks above .2.  But the fast-cgi processes on the nginx box launch to the top and hog up CPU and memory at an alarming rate.  Before the 30 seconds is over load on the nginx box is over 3.  Not good.  End result was about 27 requests per second.  Not horrible, but there&#8217;s no way the box could maintain that kind of load long term.  I ran this test:</p>
<div class="ddl">http_load -rate 20 -seconds 30 test.url > test.out</div>
<p>Which simulates 20 requests a second.  So what I&#8217;m trying to do there is find a reasonable amount of traffic that will stress the server but not kill it.  That seemed to be about the breaking point.  The server handled 20 requests a second with some negative effects but it seemed it could be stable at that level.</p>
<p>So, had to do some thinking.  In an effort to cheer myself up, I figured I&#8217;d disable memcache and see how bad it would be without its help.  If I got between 20 and 30 with memcache surely I&#8217;d only get between 15 and 20 without it.</p>
<p>Well, guess what, nerd.  Not so much.  To my amazement, the result came in around 36 requests per second without memcache.  Not only that, CPU consumption by the fast-cgi threads was reduced and their memory consumption was totally normal.  Beyond that, load on the database server didn&#8217;t budge.</p>
<p>It&#8217;s almost like memcache is penalizing me.  Things got a little weirder when I commented out the code to pull some objects out of memcache but left others in.  The results got down to 10 per second, which is nearly unbearable.  I wish I had a conclusive summary to give but right now my thinking is that the overhead of connecting to memcache and hydrating objects is slower than just getting the data from the database.  Or maybe I&#8217;m just overusing memcache &#8211; storing and retrieving too many small objects for example.</p>
<p>So for the meantime I&#8217;m running without memcache, despite the hours and hours of work I put in to integrate it, and all the hopes and dreams of the children.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/06/13/say-it-aint-so-memcache/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Year 2009 Alert</title>
		<link>http://www.nodroidsallowed.com/2009/06/08/year-2009-alert/</link>
		<comments>http://www.nodroidsallowed.com/2009/06/08/year-2009-alert/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 14:25:38 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=44</guid>
		<description><![CDATA[Note to LAMP interviewees.  It&#8217;s now 2009.  Boasting that you wrote your own PHP framework is ridiculous and unimpressive.  I&#8217;m sure you&#8217;re very clever but no, I will never agree to letting my project use 10K lines of unproven code that&#8217;s running your blog.  Yea, we all can (and have) written [...]]]></description>
			<content:encoded><![CDATA[<p>Note to LAMP interviewees.  It&#8217;s now 2009.  Boasting that you wrote your own PHP framework is ridiculous and unimpressive.  I&#8217;m sure you&#8217;re very clever but no, I will never agree to letting my project use 10K lines of unproven code that&#8217;s running your blog.  Yea, we all can (and have) written a database interface class.  Still not interested.  Sorry.</p>
<p>Also, it might be a good idea to have some understanding of what the term &#8220;unit testing&#8221; means.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/06/08/year-2009-alert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Autoloading and Performance</title>
		<link>http://www.nodroidsallowed.com/2009/06/04/codeigniter-autoloading-and-performance/</link>
		<comments>http://www.nodroidsallowed.com/2009/06/04/codeigniter-autoloading-and-performance/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 03:04:30 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=42</guid>
		<description><![CDATA[Got some interesting results tonight from my adventures with xdebug and CodeIgniter, specifically with the autoloading feature.
I had run xdebug to collect stats on my app&#8217;s landing page, the page where all users will be redirected after login.  I&#8217;d naturally expect this to be one of the most heavily visited pages, therefore has to [...]]]></description>
			<content:encoded><![CDATA[<p>Got some interesting results tonight from my adventures with <a href="http://www.xdebug.org/">xdebug</a> and <a href="http://codeigniter.com/">CodeIgniter</a>, specifically with the <a href="http://codeigniter.com/user_guide/general/autoloader.html">autoloading</a> feature.</p>
<p>I had run xdebug to collect stats on my app&#8217;s landing page, the page where all users will be redirected after login.  I&#8217;d naturally expect this to be one of the most heavily visited pages, therefore has to be as optimized as possible.  After running the results of xdebug&#8217;s profiler (&#8220;xdebug.profiler_enable=On&#8221; in php.ini) through <a href="http://sourceforge.net/projects/wincachegrind/">WinCacheGrind</a> I found something like 300+ calls being made to the method CodeIgniter uses to load a library file/class.  I had long suspected that liberal use of $CI->load->library(&#8216;MY_Blah&#8217;) wasn&#8217;t necessarily good practice, but I didn&#8217;t suspect it could have been that bad.</p>
<p>So I decided to put my most-frequently loaded libraries into the autoload.php and remove any calls to load them in my libraries, controller, and views.  The difference was noticeable, and a second pass through xdebug and WinCacheGrind proved the improvement was real.  I tried not to go overboard by loading too many classes, and it seems like I was able to strike the right balance by autoloading less than ten of my dozens of classes.</p>
<p>Another interesting result was integrating memcache to save some of the objects that are frequently loaded on the landing page.  These objects are for the most part shared across all users on the site.  For some reason after I integrated memcache the memory usage for the controller (according to CodeIgniter) went up to around 8MB from 2MB.  Very weird results that I&#8217;m going to have to think about.  Database load on the page is near nothing, which is good news.  I&#8217;m assuming the problem is in copying the objects out of memcache and creating PHP objects out of them.</p>
<p>Guess I&#8217;ll be doing some more profiling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/06/04/codeigniter-autoloading-and-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scary Moments in Administering nginx</title>
		<link>http://www.nodroidsallowed.com/2009/06/04/scary-moments-in-administering-nginx/</link>
		<comments>http://www.nodroidsallowed.com/2009/06/04/scary-moments-in-administering-nginx/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 21:01:43 +0000</pubDate>
		<dc:creator>vdibart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nodroidsallowed.com/?p=38</guid>
		<description><![CDATA[So I was trying to install xdebug on my Slicehost slice and I couldn&#8217;t get the damn module to load.  
I was following these instructions &#8211; installed via PECL, added the line to php.ini, restarted the web server, etc.  Nothing.  Wasn&#8217;t showing up in either &#8220;php -m&#8221; or the output of phpinfo().
So [...]]]></description>
			<content:encoded><![CDATA[<p>So I was trying to install <a href="http://xdebug.org/index.php">xdebug</a> on my <a href="http://www.slicehost.com/">Slicehost</a> slice and I couldn&#8217;t get the damn module to load.  </p>
<p>I was following <a href="http://devzone.zend.com/article/2803-Introducing-xdebug">these instructions</a> &#8211; installed via PECL, added the line to php.ini, restarted the web server, etc.  Nothing.  Wasn&#8217;t showing up in either &#8220;php -m&#8221; or the output of phpinfo().</p>
<p>So then I decided to compile from source, using instructions on the same page.  Now it actually got worse.  I was getting a 502 error and this in the logs:</p>
<p><strong>2009/06/04 16:50:46 [error] 4461#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: XXX.XXX.XXX, server: myserver.com, request: &#8220;GET /index.php HTTP/1.1&#8243;, upstream: &#8220;fastcgi://127.0.0.1:9000&#8243;, host: &#8220;myserver.com&#8221;</strong></p>
<p>Begin freakout.</p>
<p>Nothing was working.  Bounce web server.  Nothing.  Bounce slice.  Nothing.</p>
<p>Continue freakout.</p>
<p>Don&#8217;t totally know why I decided to restart fastcgi, but sweet mother that worked.  And not only that, xdebug was loading as expected.</p>
<p><strong>sudo /etc/init.d/php-fastcgi restart</strong></p>
<p>End freakout.</p>
<p>(To be more precise, I restarted nginx first and then restarted fastcgi.)  Hope that helps someone out there.  Certainly scared the tuna salad out of me for a good half hour.  Oh the joys of system administration for developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nodroidsallowed.com/2009/06/04/scary-moments-in-administering-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.530 seconds -->
<!-- Cached page served by WP-Cache -->
