<?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>Netscraps &#187; perl</title>
	<atom:link href="http://blog.netscraps.com/category/perl/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.netscraps.com</link>
	<description>A windsurfing, CSS-grudging, IE-hating, web-developing, gigantic-machine-puzzling blog</description>
	<lastBuildDate>Thu, 10 May 2012 15:44:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Lost Connection To MySQL Server on MediaTemple Grid Server</title>
		<link>http://blog.netscraps.com/bugs/lost-connection-to-mysql-server-on-mediatemple-grid-server.html</link>
		<comments>http://blog.netscraps.com/bugs/lost-connection-to-mysql-server-on-mediatemple-grid-server.html#comments</comments>
		<pubDate>Fri, 25 Feb 2011 16:39:46 +0000</pubDate>
		<dc:creator>Wick</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[MediaTemple]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://blog.netscraps.com/?p=217</guid>
		<description><![CDATA[I&#8217;ve been a MediaTemple Grid Server (gs) customer since it was released. From the beginning, Mediatemple has had MySQL problems with &#8220;Lost connection to MySQL server during query at [script name] [line number]&#8221; errors. I have several system update Perl &#8230; <a href="http://blog.netscraps.com/bugs/lost-connection-to-mysql-server-on-mediatemple-grid-server.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.netscraps.com/wp-content/uploads/2011/02/logo.png"><img class="alignleft size-full wp-image-218" title="Beyond MediaTemple's level of support, apparently." src="http://blog.netscraps.com/wp-content/uploads/2011/02/logo.png" alt="" width="300" height="150" /></a>I&#8217;ve been a MediaTemple Grid Server (gs) customer since it was released. From the beginning, Mediatemple has had MySQL problems with <em>&#8220;Lost connection to MySQL server during query at [script name] [line number]</em>&#8221; errors.</p>
<p>I have several system update Perl scripts for <a title="Car Problems and Complaints" href="http://www.carcomplaints.com">CarComplaints.com</a> that I run as cron jobs or from the command line that take a few minutes to run. They access a MySQL database via the standard DBI Perl module. Maybe 1/3 of the time, the mysql connection is lost 2-3 minutes into the update.</p>
<p>I&#8217;ve ignored MediaTemple&#8217;s lost mysql connection problem for years. Lately though, the dropped connection errors have become more of a headache so I decided to do some troubleshooting.</p>
<p>I upgraded from the MediaTemple MySQL SmartPool to a MySQL Container &amp; played around with the various mysql config timeout settings, but there was no change in when &amp; how often the lost mysql connections occurred. Everything pointed to a connectivity issue with MediaTemple&#8217;s service.</p>
<p>Next move was to contact MediaTemple support about the issue. MediaTemple has a pretty good reputation for customer service. Wow. Turns out lost MySQL connections are their Achilles&#8217; heel.</p>
<p>First they blamed slow mysql queries. I pointed out the scripts encountering the error are not public-facing, so 300,000 queries or 1 query that evaluates 300,000 rows in one shot makes no difference. All my slightly &#8220;slow queries&#8221; are for good reason &#8212; the tables have the proper indexes, etc.</p>
<p>Next they blamed cron job processing limitations. I reiterated that the lost mysql connections errors happen just as often when the script is run manually from the command prompt, &amp; that the errors occur very inconsistently indicating a time/cpu limit is probably not involved.</p>
<p>Finally they combined both theories (!!) to suggest the lost mysql connections were &#8220;a problem with MySQL optimization&#8221; &amp; also that I may be &#8220;overloading the GridContainer&#8221; by running scripts concurrently with cron jobs &#8230; definitely not happening.</p>
<p>And the kicker from MediaTemple support tech &#8220;Joel M.&#8221;:</p>
<blockquote><p>Please note that (mt) Media Temple only supports the basic operation and uptime of your (gs) Application Container Technology.</p></blockquote>
<p>&#8230; conveniently implying that lost mysql connections on the GridServer were not an issue of basic operation &amp; uptime. I&#8217;d love to hear the logic behind that one.</p>
<p>At that point I decided my time would be better spent coding a way around MediaTemple&#8217;s Grid Server / MySQL / tech support shortcomings.</p>
<p>I wrote a MySQL reconnection handler so that it reconnects a few times before giving up. So far so good.</p>
<p>Here are <a href="http://expressionengine.com/archived_forums/viewthread/145249/" target="_blank">more people</a> <a href="http://wordpress.org/support/topic/wordpress-database-error-lost-connection-to-mysql-server-during-query-1" target="_blank">experiencing this same problem</a> <a href="http://www.vbulletin.com/forum/showthread.php/341346-Vbulletin-database-error-but-i-can-still-access-database-via-phpMyAdmin-wat-s-wrong" target="_blank">with lost mysql connections</a> <a href="http://aytemir.com/blog/2009/11/30/dont-believe-the-hype-of-gridservice/" target="_blank">on Mediatemple</a>.</p>
<p><a title="Lost connection to MySQL server" href="http://dev.mysql.com/doc/refman/4.1/en/error-lost-connection.html" target="_blank">MySQL.com has some advice about &#8220;Lost connection to MySQL server&#8221; errors</a>:</p>
<blockquote><p>Usually it indicates network connectivity trouble and you           should check the condition of your network if this error           occurs frequently. If the error message includes “during           query,” this is probably the case you are experiencing.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.netscraps.com/bugs/lost-connection-to-mysql-server-on-mediatemple-grid-server.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prototype mismatch: sub main::head ($) vs none</title>
		<link>http://blog.netscraps.com/bugs/prototype-mismatch-sub-mainhead-vs-none.html</link>
		<comments>http://blog.netscraps.com/bugs/prototype-mismatch-sub-mainhead-vs-none.html#comments</comments>
		<pubDate>Thu, 09 Jul 2009 18:12:45 +0000</pubDate>
		<dc:creator>Wick</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://blog.netscraps.com/uncategorized/prototype-mismatch-sub-mainhead-vs-none.html</guid>
		<description><![CDATA[Turns out that when you use the LWP::Simple &#38; CGI modules together in a Perl script, each has a conflicting head() function that throws that error. Who knew? Everyone who took the time to read the CAVEAT note at the &#8230; <a href="http://blog.netscraps.com/bugs/prototype-mismatch-sub-mainhead-vs-none.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Turns out that when you use the LWP::Simple &amp; CGI modules together in a Perl script, each has a conflicting head() function that throws that error. Who knew? Everyone who took the time to read the CAVEAT note at the end of the LWP::Simple docs, apparently:</p>
<blockquote><p>Note that if you are using both LWP::Simple and the very popular CGI.pm module, you may be importing a <code>head</code> function from each module, producing a warning like &#8220;Prototype mismatch: sub main::head ($) vs none&#8221;. Get around this problem by just not importing LWP::Simple&#8217;s <code>head</code> function, like so:</p>
<pre><em>use LWP::Simple qw(!head);
use CGI qw(:standard);  # then only CGI.pm defines a head()</em></pre>
<p>Then if you do need LWP::Simple&#8217;s <code>head</code> function, you can just call it as <code>LWP::Simple::head($url)</code>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.netscraps.com/bugs/prototype-mismatch-sub-mainhead-vs-none.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

