<?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>Indistinguishable from Jesse &#187; Blogging</title>
	<atom:link href="http://www.squarefree.com/categories/blogging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.squarefree.com</link>
	<description>Jesse Ruderman on Firefox, security, and more</description>
	<lastBuildDate>Wed, 14 Jul 2010 22:29:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Squarefree succumbs to the Digg effect</title>
		<link>http://www.squarefree.com/2006/09/24/squarefree-succumbs-to-the-digg-effect/</link>
		<comments>http://www.squarefree.com/2006/09/24/squarefree-succumbs-to-the-digg-effect/#comments</comments>
		<pubDate>Sun, 24 Sep 2006 23:38:41 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/2006/09/24/squarefree-succumbs-to-the-digg-effect/</guid>
		<description><![CDATA[Yesterday, at around 4pm, I noticed that the content on squarefree.com was missing, and the main page was an empty directory listing. I ssh'ed to my web server and noticed that the "squarefree.com" directory had been renamed to "squarefree.com_DISABLED_BY_DREAMHOST". Then I checked my email and saw a message from DreamHost support: Hello, I just had [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, at around 4pm, I noticed that the content on squarefree.com was missing, and the main page was an empty directory listing.  I ssh'ed to my web server and noticed that the "squarefree.com" directory had been renamed to "squarefree.com_DISABLED_BY_DREAMHOST".  Then I checked my email and saw a message from <a href="http://www.dreamhost.com/">DreamHost</a> support:</p>

<blockquote>
<p>Hello,</p>

<p>I just had to disable your site squarefree.com as it's coming under some
load and spawning countless php processes that are crashing the
webserver.  I wasn't able to figure out exactly what's going on, as
leaving it up for more than a minute pretty much toasts the server.
Please don't re-enable it until you've figured out what's going on, or
disabled any possibly problematic php.</p>

<p>Thanks,</p>

<p>James</p>
</blockquote>

<p>I jumped into #dreamhost on irc.freenode.net and started looking through my web server logs for suspicious requests.  I was expecting to find that my blog had been DDoSed, perhaps by someone trying to leave comment spam.  Instead, I found a large number of requests for non-existant files, falling into two categories:</p>

<ul>

<li>Requests for favicon.ico, a file that does not exist on my site.  Some of these requests are expected: most browsers with tabs request favicon.ico to display it in the tab bar.  But there were also hundreds of IP addresses that requested nothing but favicon.ico for the entire day, and some requested it many times.  About 100 of these IPs were Internet Explorer users with the Google Toolbar, so apparently I was getting <a href="http://thecoder.blog.com/1057698/">DDoS'ed by a bug in the Google Toolbar</a>.  Another 100 were Firefox users; I haven't figured out why Firefox would request nothing but favicon.ico over and over.</li>

<li>Requests due to people using my <a href="http://www.squarefree.com/htmledit/">Real-time HTML Editor</a> to edit pages that used relative URLs for images, iframes, etc.  One user made dozens of requests for a file named "border=0".  Another user made a request for 14 gif files every time the editor refreshed.  I also saw from referrers that <a href="http://digg.com/programming/Real_Time_HTML_editor">the Real-time HTML Editor had been featured on Digg</a>, greatly increasing its traffic.</li>

</ul>

<p>But why would 404 requests create PHP processes?  Due to a recent change in WordPress, Apache was directing each 404 request to WordPress.  WordPress used to put detailed rules in .htaccess -- for example, it would ask Apache to direct requests for http://www.squarefree.com/2005/ to WordPress using <tt>RewriteRule ^([0-9]{4})/?$</tt>.  But newer versions of WordPress instead ask Apache to send it all requests for nonexistent files.  I imagine this puts less strain on Apache when a site uses lots of <a href="http://codex.wordpress.org/Pages">WordPress Pages</a>, but it hurts when a site gets lots of 404 requests.  Several months ago, I had instructed WordPress to serve <a href="http://www.squarefree.com/2004/08/22/custom-404-page/">my custom 404 page</a> for these requests, but WordPress still had to do a lot of work to determine that the requests should be treated as 404s.</p>

<p>Once I realized what had happened, and determined that reconfiguring WordPress would be difficult, I did what I could to reduce the number of 404 requests WordPress would have to handle.  I created a tiny favicon.ico file so those requests wouldn't be 404s, and I moved the Real-time HTML Editor onto <a href="http://htmledit.squarefree.com/">its own subdomain</a> so WordPress wouldn't handle the 404s it causes.  My site was only down for 40 minutes, with the Real-time HTML Editor down a little longer while I waited for the new subdomain's DNS to propagate.</p>

<p>Some things DreamHost could have done better:</p>

<ul>
<li>It would have been nice if James had disabled PHP for my domain instead of disabling my site entirely.  <a href="http://www.squarefree.com/pornzilla/">Pornzilla</a> did not need to be down due to PHP problems.</li>
<li>A per-user process limit might have allowed my site to send "503 Service Unavailable" in response to some requests instead of being down entirely.  It would have also prevented my site from causing problems for other sites on the shared server.</li>
<li>Better performance diagnostics would have helped both James and me isolate the problem.  For example, it would have been great to have a list of PHP processes showing the request URL that caused each PHP instance to be triggered, the lifetime of each process, and perhaps some performance information (CPU used, RAM used, number of database requests).</li>
</ul>

<p>Some things DreamHost did right:</p>

<ul>
<li>DreamHost allowed me to restore my site myself once I fixed the problems.  All I had to do was rename "squarefree.com_DISABLED_BY_DREAMHOST" back to "squarefree.com".</li>
<li>Knowing about <a href="http://www.squarefree.com/2005/05/02/snapshots-on-dreamhost/">DreamHost's .snapshot feature</a> kept me from panicking about data loss when my site appeared to have disappeared.</li>
<li>The employees in #dreamhost were helpful.</li>
</ul>

<p>If anyone is wondering: yes, I still <a href="http://www.squarefree.com/2004/12/23/why-i-love-dreamhost/">love DreamHost</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2006/09/24/squarefree-succumbs-to-the-digg-effect/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Now using wp-cache</title>
		<link>http://www.squarefree.com/2005/08/15/wp-cache/</link>
		<comments>http://www.squarefree.com/2005/08/15/wp-cache/#comments</comments>
		<pubDate>Tue, 16 Aug 2005 06:57:46 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[DreamHost]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/2005/08/15/wp-cache/</guid>
		<description><![CDATA[DreamHost sent me automated notices that I was using over 100 CPU minutes a day on slaw.dreamhost.com, a web server with over 300 accounts. In other words, I was using at least 1/60 the capacity of the quad-core server. I guessed that a lot of my CPU usage was from the 10,000 hits a day [...]]]></description>
			<content:encoded><![CDATA[<p>DreamHost sent me automated notices that I was using over 100 CPU minutes a day on slaw.dreamhost.com, a web server with over 300 accounts.  In other words, I was using at least 1/60 the capacity of the quad-core server.  I guessed that a lot of my CPU usage was from the 10,000 hits a day for The Burning Edge's feed, so I installed <a href="http://mnm.uib.es/gallir/wp-cache-2/">wp-cache</a> for The Burning Edge.  The plugin doesn't seem to break anything; I think it invalidates its entire cache when anything changes (except for templates).</p>

<p>Installing the plugin for The Burning Edge reduced my CPU usage to about 55 minutes a day, low enough to stop the automated notices but still not within <a href="https://panel.dreamhost.com/kbase/index.cgi?area=3079">the desired range of 30-40 minutes a day</a>.  I just installed it for this blog too.</p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2005/08/15/wp-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code in comments</title>
		<link>http://www.squarefree.com/2005/05/23/code-in-comments/</link>
		<comments>http://www.squarefree.com/2005/05/23/code-in-comments/#comments</comments>
		<pubDate>Tue, 24 May 2005 06:55:59 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/?p=260</guid>
		<description><![CDATA[I made some changes to my WordPress install to make it easier to post code in comments. You can now post code by enclosing it in &#60;code&#62; or &#60;pre&#62;. You still have to escape &#60;, &#62;, and &#38; as &#38;lt;, &#38;gt;, and &#38;amp;, but you no longer have to worry about wrapping, indentation, and smart [...]]]></description>
			<content:encoded><![CDATA[<p>I made some changes to my WordPress install to make it easier to post code in comments.  You can now post code by enclosing it in &lt;code&gt; or &lt;pre&gt;.  You still have to escape &lt;, &gt;, and &amp; as &amp;lt;, &amp;gt;, and &amp;amp;, but you no longer have to worry about wrapping, indentation, and smart quotes.</p>

<p>Making these changes was harder than I expected.</p>

<span id="more-260"></span>

<h4>Allowing &lt;pre&gt; tags</h4>

<p>I edited <code>wp-includes/kses.php</code> to allow <code>&amp;lt;pre&amp;gt;</code> tags.  I will have to do this again every time I reinstall WordPress.</p>

<h4>Preserving spacing and avoiding smart quotes</h4>

<p>I installed <a href="http://www.coffee2code.com/archives/2005/03/29/plugin-preserve-code-formatting/">Preserve code formatting</a>.  I edited it to only touch comments (I had <a href="http://www.squarefree.com/2005/03/13/switching-from-movable-type-to-wordpress/">already</a>  turned off formatting and texturizing for posts using <a href="http://dev.wp-plugins.org/wiki/TextControl">Text Control</a>).  I also edited it to not try to escape HTML, because I consider that incorrect and because it was doing so in a way that caused &gt; to be double-escaped.</p>

<h4>Styles</h4>

<p>I edited styles.css to make the rule for <code>code</code> also apply to <code>pre</code>, and added</p>

<pre><pre>&nbsp;&nbsp;text-align: left;
&nbsp;&nbsp;white-space: pre;</pre></pre>

<p>to that rule.</p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2005/05/23/code-in-comments/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Valid XHTML user script</title>
		<link>http://www.squarefree.com/2005/05/16/valid-xhtml-user-script/</link>
		<comments>http://www.squarefree.com/2005/05/16/valid-xhtml-user-script/#comments</comments>
		<pubDate>Mon, 16 May 2005 13:22:48 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[User Scripts]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/2005/05/16/valid-xhtml-user-script/</guid>
		<description><![CDATA[The Valid XHTML user script is an adaptation of the blogidate XML well-formedness bookmarklet. It shows a line of text under each textarea indicating whether the text is well-formed XHTML. When the text is not well-formed XHTML, it displays Gecko's error message and gives you a link that selects the location of the error in [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="https://www.squarefree.com/userscripts/valid-xhtml.user.js">Valid XHTML</a> user script is an adaptation of the <a href="http://www.squarefree.com/2003/08/26/blogidate-xml-well-formedness">blogidate XML well-formedness</a> bookmarklet.   It shows a line of text under each textarea indicating whether the text is well-formed XHTML.  When the text is not well-formed XHTML, it displays Gecko's error message and gives you a link that selects the location of the error in the textarea.  When the text is well-formed XHTML, it displays links that let you check whether the XHTML is valid in addition to being well-formed.</p>

<p>By default, it only runs on admin posting pages for <a href="http://www.sixapart.com/movabletype/">Movable Type</a> and <a href="http://wordpress.org/">WordPress</a> and on archive pages for <a href="http://simon.incutio.com/">Simon Willison's blog</a>.  You can use Greasemonkey's interface to make it run on the sites on which you edit XHTML.</p>

<p><a href="http://www.squarefree.com/blogimages/valid-xhtml.png">Screenshots</a></p>

<p><a href="https://www.squarefree.com/userscripts/demo-pages/valid-xhtml.html">Demo for Firefox and other Gecko browsers</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2005/05/16/valid-xhtml-user-script/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New name</title>
		<link>http://www.squarefree.com/2005/05/09/new-name/</link>
		<comments>http://www.squarefree.com/2005/05/09/new-name/#comments</comments>
		<pubDate>Tue, 10 May 2005 05:28:08 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/2005/05/09/new-name/</guid>
		<description><![CDATA[This blog is now called "Indistinguishable from Jesse" instead of "Jesse Ruderman". The pages for some categories have special names, such as "Indistinguishable from Gravity" for the Physics category.]]></description>
			<content:encoded><![CDATA[<p>This blog is now called "Indistinguishable from Jesse" instead of "Jesse Ruderman".  The pages for some categories have special names, such as "Indistinguishable from Gravity" for the <a href="http://www.squarefree.com/categories/physics/">Physics category</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2005/05/09/new-name/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Ask Jesse answer: WordPress</title>
		<link>http://www.squarefree.com/2005/05/02/ask-jesse-answer-wordpress/</link>
		<comments>http://www.squarefree.com/2005/05/02/ask-jesse-answer-wordpress/#comments</comments>
		<pubDate>Tue, 03 May 2005 06:58:41 +0000</pubDate>
		<dc:creator>Jesse Ruderman</dc:creator>
				<category><![CDATA[Ask Jesse]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Bookmarklets]]></category>

		<guid isPermaLink="false">http://www.squarefree.com/2005/05/02/ask-jesse-answer-wordpress/</guid>
		<description><![CDATA[Joey also asked: As a fellow WordPress user (only other system I’ve ever used is Blogger), what plugins do you have installed, and do you use the bookmarklet? I love the spell checker and just got a crossposting plugin to work, crossposting to Xanga since all my friends don’t know too much, if anything, about [...]]]></description>
			<content:encoded><![CDATA[<p>Joey <a href="http://www.squarefree.com/2005/05/01/ask-jesse/#comment-1153">also asked</a>:</p>

<blockquote><p>As a fellow WordPress user (only other system I’ve ever used is Blogger), what plugins do you have installed, and do you use the bookmarklet? I love the spell checker and just got a crossposting plugin to work, crossposting to Xanga since all my friends don’t know too much, if anything, about the Internet.</p></blockquote>

<p>I don't use the WordPress bookmarklet because I post URLs on <a href="http://del.icio.us/jesser/">my del.icio.us account</a> instead of on my blog most of the time.  I do use a del.icio.us bookmarklet, of course.  I used the <a href="http://www.extensionsmirror.nl/index.php?showtopic=617">favicon picker</a> extension to give the del.icio.us bookmarklet the del.icio.us icon and then gave it an empty name, so it takes up little space on my toolbar.</p>

<p>The only WordPress plugin I use is <a href="http://dev.wp-plugins.org/wiki/TextControl">Text Control</a>, which I use to disable WordPress's buggy auto-formatting and auto-texturizing.  See <a href="http://www.squarefree.com/2005/03/13/switching-from-movable-type-to-wordpress/">my post about switching from Movable Type to WordPress</a> for details.  I haven't tried any spell checking plugins; which one do you recommend?</p>]]></content:encoded>
			<wfw:commentRss>http://www.squarefree.com/2005/05/02/ask-jesse-answer-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
