<?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>Rommel Santor&#039;s Clog &#187; Bugs</title>
	<atom:link href="https://rommelsantor.com/clog/category/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>https://rommelsantor.com/clog</link>
	<description>my exploits and misadventures in programming</description>
	<lastBuildDate>Thu, 04 Feb 2016 12:56:01 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>30 Second Delay with PHP and Memcache Sessions</title>
		<link>https://rommelsantor.com/clog/2016/02/02/30-second-delay-php-memcache-sessions/</link>
		<comments>https://rommelsantor.com/clog/2016/02/02/30-second-delay-php-memcache-sessions/#comments</comments>
		<pubDate>Wed, 03 Feb 2016 07:08:02 +0000</pubDate>
		<dc:creator><![CDATA[rommel]]></dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rommelsantor.com/clog/?p=459</guid>
		<description><![CDATA[We upgraded the servers at NeatoShop.com and Neatorama.com a couple of weeks ago, and in the past week we started noticing and receiving reports that on &#8220;some&#8221; page loads there was a 30-second delay where the page seemed to hang before finally returning any content. The common things we could put a finger on were [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We upgraded the servers at NeatoShop.com and Neatorama.com a couple of weeks ago, and in the past week we started noticing and receiving reports that on &#8220;some&#8221; page loads there was a 30-second delay where the page seemed to hang before finally returning any content.</p>
<p>The common things we could put a finger on were 1) it would seem to happen with a raw/initial page load (e.g., in a brand new incognito window), 2) it would not hang up anymore after that first page load, and 3) it seemed to happen only if we loaded neatoshop.com which was then redirected to www.neatoshop.com.</p>
<p>It took a ton of code profiling and countless attempts to reproduce the problem (because it didn&#8217;t happen for me on <i>every</i> new incognito page load), but I finally traced the delay down to <code>session_start()</code>. This didn&#8217;t really make sense to me because we&#8217;ve used php5-memcache (obviously with Memcached) for handling sessions with redundancy across our 7 web servers, and nothing regarding sessions nor Memcached changed on our end any time recently. So what could the problem be?</p>
<p><span id="more-459"></span>
<div style="float: left; margin: 0 10px 10px 0;"><script type="text/javascript">// <![CDATA[
google_ad_client = "ca-pub-7639656561235411";
/* Square (250x250) */
google_ad_slot = "8522038794";
google_ad_width = 250;
google_ad_height = 250;
// ]]&gt;</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">// <![CDATA[

// ]]&gt;</script></div>
</p>
<p>It started to seem like a pointless shot in the dark to keep googling for clues, but something that stuck out in my mind were reports of session <i>files</i> getting locked if there were two simultaneous requests from the same user. This didn&#8217;t seem to apply since we&#8217;re dealing with Memcached sessions and not file-based sessions, but then I noticed the new <code>memcache.lock_timeout</code> option in php5-memcache v3.0.4 which has a default value of 15 seconds.</p>
<p>Hmm&#8230; 15 seconds with a lock on two simultaneous requests seems like it could result in a 30 second delay&#8230; ya think? There&#8217;s one way to find out.</p>
<p>I tried changing the memcache.lock_timeout value to 2 seconds then trying to repro the problem. Once it seemed like I got the hang-up to occur, I held my breath and the page hung for 4 seconds before loading. Then I changed the value to 1 second and tried again, and as I&#8217;d hoped, the loading time was 2 seconds!</p>
<p>Finally, I&#8217;ve reduced the value to 0 seconds and there seems to no longer be any delay. I&#8217;m not certain of any side effects or unintended consequences of setting the value to zero, but whatever they are, they are insignificant as compared to every customer on an e-commerce site occasionally being subjected to a 30-second delay. I just thought I should share this tale of woe, as I couldn&#8217;t really find any good info on it, and I&#8217;m assuming there must be others facing the same issue.</p>
<p><b>Update!</b></p>
<p>After reducing the value to zero, I started getting reports of slow load times again, which indicates a value of zero is not valid because it causes the default of 15 seconds to be used. So we&#8217;re stuck using a 1-second lock_timeout, which is the only acceptable solution, but a 2-second delay is much better than 30 seconds!</p>
]]></content:encoded>
			<wfw:commentRss>https://rommelsantor.com/clog/2016/02/02/30-second-delay-php-memcache-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE8 Crash &#8211; Inline-Block Scroll with DOM Append</title>
		<link>https://rommelsantor.com/clog/2011/03/02/ie8-crash-inline-block-scroll-dom-append/</link>
		<comments>https://rommelsantor.com/clog/2011/03/02/ie8-crash-inline-block-scroll-dom-append/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 09:15:35 +0000</pubDate>
		<dc:creator><![CDATA[rommel]]></dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[iesucks]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[scroll]]></category>

		<guid isPermaLink="false">http://rommelsantor.com/clog/?p=148</guid>
		<description><![CDATA[Was struggling for many hours today to figure out what has turned out to be a really stupid bug in IE8. In the hopes I can prevent even a single person from wasting their day like I have trying to figure out what is wrong with my code, I&#8217;ll explain below how the bug presents [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Was struggling for many hours today to figure out what has turned out to be a really stupid bug in IE8. In the hopes I can prevent even a single person from wasting their day like I have trying to figure out what is wrong with my code, I&#8217;ll explain below how the bug presents itself with examples.<span id="more-148"></span></p>
<p>I&#8217;m not 100% certain of every variable required to cause the bug, but it definitely works in this example:<br />
<a href="http://rommelsantor.com/iesucks/ie8-inlineblock-scroll-dom.php">IE8 crash</a></p>
<p>The general structure of the page is:<br />
<pre>
&lt;body&gt;
&lt;div id="outer" style="display:inline-block;overflow:auto;height:100px;"&gt;
  ... any multi-line content that forces the div to have a scrollbar ...
&lt;/div&gt;
&lt;/body&gt;
&lt;script&gt;
$("#outer").scroll(function(){
  $("&lt;div&gt;&lt;/div&gt;").appendTo("body");
});
&lt;/script&gt;
</pre></p>

<div style="float:left;margin:0 10px 10px 0">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7639656561235411";
/* Square (250x250) */
google_ad_slot = "8522038794";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

<p>In that example &lt;body&gt; has only the one direct child element and if you scroll it causing the appendTo() function to be called, IE8 crashes. (I&#8217;ve only tested this on Windows 7 machines. IE7 does not crash.)</p>
<p><a href="http://rommelsantor.com/iesucks/ie8-inlineblock-scroll-dom-fixed.php">This is the same example</a>, but it works. The only difference is that a second &lt;div&gt; child was included within &lt;body&gt; but with that one change, the bug vanishes. Note that I&#8217;ve also tested this with multiple scrolling divs in body and the bug persists. It seems there <i>must</i> be at least one block element in &lt;body&gt; to prevent the bug.</p>
<p>Fortunately, it&#8217;s not often that one would create a page with just scrollable divs in the body.</p>
]]></content:encoded>
			<wfw:commentRss>https://rommelsantor.com/clog/2011/03/02/ie8-crash-inline-block-scroll-dom-append/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
