<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 03:28:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Enrise Blog: Debugging Your Web Application with TCPDump and Wireshark]]></title>
      <guid>http://www.phpdeveloper.org/news/18894</guid>
      <link>http://www.phpdeveloper.org/news/18894</link>
      <description><![CDATA[<p>
On the Enrise blog <i>Tim de Pater</i> has posted about a <a href="http://www.enrise.com/2012/12/debugging-your-webapplication-with-tcpdump-and-wireshark/">different sort of method for debugging</a> your web applications - using a combination of <a href="http://www.wireshark.org/">Wireshark</a> and <a href="http://www.tcpdump.org/">tcpdump</a> to monitor your application's input and output.
</p>
<blockquote>
Everything is running great, until suddenly the monitoring is yelling, the load on several servers is rising, MySQL queries/second and the memcached commands/second going through the roof, Apache processes are higher than usual, and the website starts giving timeouts. Yes, that sucks. Of course you'll first check everything that comes up in your mind like logs, diskspace, swap, etc. But then you come to a point that you really have to dive into it to find the cause of this sudden problem. There are several ways of doing this. One way I learned the last time we were in this scenario is using tcpdump and Wireshark.
</blockquote>
<p>
He gives you a brief "getting started" tutorial helping you get things set up - dumping the packets with tcpdump and sifting through the results with Wireshark. His examples are more specific to watching for memcache traffic, but it can easily be applied to more general kinds of requests. Screenshots are also included so you can be sure you're seeing the right kind of results.
</p>]]></description>
      <pubDate>Fri, 14 Dec 2012 12:50:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&uuml;ter: MySQL, Memcache, PHP revised]]></title>
      <guid>http://www.phpdeveloper.org/news/18541</guid>
      <link>http://www.phpdeveloper.org/news/18541</link>
      <description><![CDATA[<p>
<i>Johannes Schl&uuml;ter</i> has a recent post highlighting an <a href="http://schlueters.de/blog/archives/169-MySQL,-Memcache,-PHP-revised.html">interesting PHP extension</a> that can connect memcache with your MySQL server via PHP, the <a href="http://pecl.php.net/mysqlnd_memcache">PECL mysqlnd_memcache</a> extension.
</p>
<blockquote>
Now this blog entry is tagged a	s PHP. Hs is that coming into play? - Well, on the one side we have this fast memcache interface, which allows to access almost arbitrarry data from the database. On the other side we have our PHP mysqlnd plugin interface where we can add special features, like query caching or load balancing, transparently to any PHP application. Why not combine those two things? - Good question. That's what we have done in the <a href="http://pecl.php.net/mysqlnd_memcache">PECL mysqlnd_memcache</a> PHP extension.
</blockquote>
<p>
He includes some sample PHP code showing it in action - two examples: one using the "mysqlnd_memcache_set" method to set a memcache server on the MySQL connection and another showing two queries and how they're handled behind the scenes by this driver plugin.
</p>]]></description>
      <pubDate>Tue, 02 Oct 2012 09:27:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&uuml;ter's Blog: High Performance PHP Session Storage on Scale]]></title>
      <guid>http://www.phpdeveloper.org/news/17147</guid>
      <link>http://www.phpdeveloper.org/news/17147</link>
      <description><![CDATA[<p>
In <a href="http://schlueters.de/blog/archives/164-High-Performance-PHP-Session-Storage-on-Scale.html">this new post</a> to his blog, <i>Johannes Schl&uuml;ter</i> looks at a high-performance solution to the usual storing PHP session information via a memcache frontend with a MySQL Cluster backend.
</p>
<blockquote>
Unfortunately even such a system [using MySQL and InnoDB tables] has limits and unfortunately replication is no good solution here to scale further as we will always need a master for writing the updated session data. By using replication we can take some load from it and we can configure a slave which can be promoted to master to keep session alive if the primary master machine fails but at some point in time we need another solution ... but, happy news, again: One doesn't have to look far as MySQL cluster will be happy to help. MySQL Cluster "is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment," as the <a href="http://dev.mysql.com/doc/refman/5.5/en/mysql-cluster.html">MySQL documentation states</a>. 
</blockquote>
<p>
He describes the setup (after pointing to <a href="http://www.clusterdb.com/mysql-cluster/scalabale-persistent-ha-nosql-memcache-storage-using-mysql-cluster/">this post</a> about installing MySQL Cluster for memcache) and includes some sample code/SQL/ini settings you'll need to use to get PHP's <a href="http://us.php.net/manual/en/class.memcached.php">memcached</a> functionality to cooperate with it.
</p>
]]></description>
      <pubDate>Fri, 18 Nov 2011 10:13:25 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Script-Tutorials.com: How to use Memcache with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16921</guid>
      <link>http://www.phpdeveloper.org/news/16921</link>
      <description><![CDATA[<p>
In a new tutorial from the Script-Tutorials.com site, they <a href="http://www.script-tutorials.com/how-to-use-memcache-with-php/">introduce you to memcache</a>, an external caching tool that can help speed up the performance of your application dramatically.
</p>
<blockquote>
Today we will talking about caching in PHP again. I will show you how you can use Memcache in PHP. We will prepare useful class for working with Memcache for us and several examples. Memcache itself providing procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.
</blockquote>
<p>
Included in the article is a simple "CacheMemcache" class that handles the dirty work for you of connecting to the memcache instance and pushing/pulling the data from the remote source. Also included are a few examples of its use - storing simple objects, pulling the same data back out and deleting a record. The source for the tutorial can be <a href="http://www.script-tutorials.com/demos/150/source.zip">downloaded here</a>. You can also find out more about using memcache in <a href="http://php.net/memcache">the PHP manual</a> (Note: it does require <a href="http://pecl.php.net/package/memcache">an extension</a> to be loaded to support this functionality).
</p>]]></description>
      <pubDate>Wed, 28 Sep 2011 11:06:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Build Blazing Fast PHP Websites with Memcached Distributed Caching]]></title>
      <guid>http://www.phpdeveloper.org/news/16653</guid>
      <link>http://www.phpdeveloper.org/news/16653</link>
      <description><![CDATA[<p>
On PHPBuilder.com today <i>Jason Gilmore</i> has written up <a href="http://www.phpbuilder.com/columns/php-memcached/Jason_Gilmore07282011.php3">a new tutorial</a> about using memcached distributed caching for better performance in your web applications.
</p>
<blockquote>
You probably know one of the easiest ways to improve performance is by caching all or parts of a page. But what might not be so obvious is exactly how this is accomplished. As it happens, a great solution called Memcached makes it trivial to incorporate caching into your website with great effect. In fact, relied upon by some of the largest websites in the world, among them Facebook, Twitter, Zynga, and YouTube, Memcached has essentially become the de facto website caching solution!
</blockquote>
<p>
He walks you through installing the memcache extension for PHP (from <a href="http://pecl.php.net">PECL</a>) and includes a bit of sample code that caches some fetched MySQL results to to the memcache server. With the extension installed you're just a few simple function calls away from better performance.
</p>]]></description>
      <pubDate>Fri, 29 Jul 2011 11:07:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall' Blog: Asynchronous cache priming with progress bars via Gearman, Memcache and Dojo]]></title>
      <guid>http://www.phpdeveloper.org/news/16141</guid>
      <link>http://www.phpdeveloper.org/news/16141</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> has written up a new post showing how he's used memcache, Gearman and Dojo to create an <a href="http://www.davedevelopment.co.uk/2011/04/04/asynchronous-cache-priming-with-progress-bars-via-gearman-memcache-and-dojo/">asynchronous progress bar</a> he uses when generating large reports.
</p>
<blockquote>
I have a (highly optimised) report that takes way too long to generate, up to around 30 seconds. [There's] too many variables to prime caches for every possible combination [and] personally, I don't think the browsers inbuilt progress bar is enough feedback for todays web users.
</blockquote>
<p>
He generates the data into <a href="http://memcached.org/">memcache</a> when the user requests it and uses the Gearman worker processes to handle requests for data that doesn't yet exist. The progress bar is a part of <a href="http://dojotoolkit.org/">Dojo</a> and uses the <a href="http://docs.dojocampus.org/dijit/ProgressBar">dijit.ProgressBar</a> widget to keep checking the progress of the build. This way the user can even leave the page and come back if the process takes too long with no threat to the generating report. You can find all of his code he's used to make it happen <a href="https://github.com/davedevelopment/async-demo">on his github account</a>.
</p>]]></description>
      <pubDate>Mon, 04 Apr 2011 10:18:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ole Markus' Blog: High load websites: A lock on Memcached::get]]></title>
      <guid>http://www.phpdeveloper.org/news/15640</guid>
      <link>http://www.phpdeveloper.org/news/15640</link>
      <description><![CDATA[<p>
<i>Ole Markus</i> has <a href="http://olemarkus.org/2010/12/high-load-websites-a-lock-on-memcachedget/">a new post</a> to his blog looking at a technique for working with memcached and fetching data out of the store using a binary semaphore for better performance.
</p>
<blockquote>
A typical document takes but a few hundred milliseconds to generate when a single request for the document enters the backend. The problem is that this is a highload website. In its current form, the backend serves hundreds of pages per second. This pretty much guarantees that the backend will concurrently receive cache miss on multiple languages and at the same time also receive cache miss on the pre-translated document.
</blockquote>
<p>
Given that he wants the translated version to be the one that's always shared, a problem can come up when the cache request is "missed" and the document starts generating from multiple places. His fix for the situation is that only the first miss generates and all others see a lock on it and wait for it to be removed before successfully fetching the result. He provides code in a "LockedMemcached" class to help make it all more useful.
</p>]]></description>
      <pubDate>Mon, 27 Dec 2010 12:34:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Simas Toleikis' Blog: PHP data caching techniques]]></title>
      <guid>http://www.phpdeveloper.org/news/15566</guid>
      <link>http://www.phpdeveloper.org/news/15566</link>
      <description><![CDATA[<p>
<i>Simas Toleikis</i> has <a href="http://simas.posterous.com/php-data-caching-techniques">posted some caching techniques</a> he's come up with to handle a few different situations including simple file-level caching and working with memcached.
</p>
<blockquote>
Caching intermediate data is the most primitive and yet the most rewarding optimization technique where you don't need to fiddle with any complex algorithms or premature optimizations. If you are into PHP you should be aware of all the best practices and the right tools for this job to make your websites fly.
</blockquote>
<p>
He covers a few different, though common, situations you may come across in your application where caching could be very helpful:
</p>
<ul>
<li>Static scope variables
<li>APC shared memory functions
<li>Memcached for large distributed caches
<li>In-memory database tables
<li>Simple file-level caches
</ul>]]></description>
      <pubDate>Mon, 13 Dec 2010 08:45:10 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Willbanks' Blog: Zend Framework Cache Backend Libmemcached + Session Cache]]></title>
      <guid>http://www.phpdeveloper.org/news/15329</guid>
      <link>http://www.phpdeveloper.org/news/15329</link>
      <description><![CDATA[<p>
<i>Mike Willbanks</i> has a new tutorial posted to his blog today about combining <a href="http://blog.digitalstruct.com/2010/10/24/zend-framework-cache-backend-libmemcached-session-cache/">memcache and the Zend Framework's caching component</a> to work with session handling.
</p>
<blockquote>
If I haven't said it before, I suppose I will say it now, I love memcached; it is a wonderful tool to have in your tool belt. However, Zend Framework does not currently have an official cache adapter for Memcached (it has one for the extension memcache but not memcached). [...] About 6-9 months ago, I had implemented a Session_SaveHandler_Cache (although it seems some others have as well), to plug this all in together and keep things consistent in a ZF application. It now enables us to utilize the consistent hashing from the Libmemcached adapter by using the PHP Memcached extension. 
</blockquote>
<p>
He moves on into the details of how to save session information into the memcache with a Zend Framework application, using a Zend_Session_SaveHandler_Cache component (code included) as a light-weight interface between the caching server and the application. He also includes the configuration you'll need to add to your application.ini, additions to the bootstrap and a neat trick using the Subversion revision to prefix the cache entry name (a "versioned" caching system).
</p>]]></description>
      <pubDate>Mon, 25 Oct 2010 10:13:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PurpleRockScissors.com: Avoiding Cache Stampedes with Pseudo-Locks]]></title>
      <guid>http://www.phpdeveloper.org/news/15324</guid>
      <link>http://www.phpdeveloper.org/news/15324</link>
      <description><![CDATA[<p>
In <a href="http://purplerockscissors.com/php-development/avoiding-cache-stampedes-with-psedo-locks/">this quick post</a> to the Purple Rock Scissors blog, there's a suggestion from <i>Rob Zienert</i> about how you can avoid a "cache stampede" on your site's caching tool with the help of a pseudo-lock on the record.
</p>
<blockquote>
A cache stampede occurs when a cached item expires and multiple clients attempt to repopulate the cache at the same time. Take for example a page cache expires and a few thousand people try to refresh the generated HTML. That's a lot of instant load - hitting the database, re-saving the cache and so-on: it's a lot of extra processing that can bring a website to its knees. One of the many ways to avoid this from happening is to apply pseudo-locks to a cache (and works great with Memcache). 
</blockquote>
<p>
He includes a code snippet example showing how to create the lock using a Zend_Cache setup by looking for a URI-based lock file and setting a "locked" value to true when someone else is using it.
</p>]]></description>
      <pubDate>Fri, 22 Oct 2010 11:14:25 -0500</pubDate>
    </item>
  </channel>
</rss>
