<?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>Wed, 22 May 2013 16:13:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPWomen.org: One way to handle concurrency in a multi-user web app]]></title>
      <guid>http://www.phpdeveloper.org/news/18510</guid>
      <link>http://www.phpdeveloper.org/news/18510</link>
      <description><![CDATA[<p>
In <a href="http://www.phpwomen.org/wordpress/2012/09/24/one-way-to-handle-concurrency-in-a-multi-user-web-app?">this new post</a> to the PHPWomen site, <i>Kim Rowan</i> shows one way that you can effectively handle concurrency in your applications (in her case, a Symfony app).
</p>
<blockquote>
Concurrent user activity on the web can take many forms.  For example, two online shoppers may simultaneously try to buy the last pair of 'gotta-have-em' shoes in stock.  Presumably one potential outcome in this scenario is to place the shoes on back-order for the slower shopper.  The concurrency challenge I faced recently, however, was a bit different...
</blockquote>
<p>
She uses a "last updated" data field in her form to see when the record in question was last changed. When the form is submitted the script checks against the updated date on the record to see if it's later than the one submitted. If it's more recent, the user's request could cause errors, so it fails. 
</p>]]></description>
      <pubDate>Mon, 24 Sep 2012 10:40:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[TechnoSophos .com: A 53,900% speedup: Nginx, Drupal, & Memcache]]></title>
      <guid>http://www.phpdeveloper.org/news/14236</guid>
      <link>http://www.phpdeveloper.org/news/14236</link>
      <description><![CDATA[<p>
On the TechnoSophos blog there's a recent post looking at how the swapping of a few technologies has made for a <a href="http://technosophos.com/content/53900-speedup-nignx-drupal-and-memcache-bring-concurrency-and-page-load-time-way-down">huge performance jump</a> for a Drupal-based website.
</p>
<blockquote>
With a clever hack utilizing Memcache, Nginx, and Drupal, we have been able to speed the delivery time of many of our major pages by 53,900% (from 8,100 msec to 15 msec, according to siege and AB benchmarks). Additional, we went from being able to handle 27 concurrent requests to being able to handle 3,334 concurrent requests (a 12,248% increase). While we performed a long series of performance optimizations, this article is focused primarily on how we managed to serve data directly from Memcached, via Nginx, without invoking PHP at all.
</blockquote>
<p>
They describe how, by just changing out the web server to <a href="http://nginx.org/">mginx</a> and a highly tuned <a href="http://memcached.org/">memcached</a> installation, they could get huge jumps in response times. They pushed it even more when they changed the nginx configuration to directly interact with the memacahed server instead of having to rely on PHP's interface. Details on how to get this setup working and an overall view of how it works are also included in the post.
</p>]]></description>
      <pubDate>Tue, 23 Mar 2010 14:53:42 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Perplexed Labs Blog: PHP Forking to Concurrency with pcntl_fork()]]></title>
      <guid>http://www.phpdeveloper.org/news/14164</guid>
      <link>http://www.phpdeveloper.org/news/14164</link>
      <description><![CDATA[<p>
On the Perplexed Labs blog there's a recent post looking at how to <a href="http://blog.perplexedlabs.com/2010/03/02/php-forking-to-concurrency/">fork processes in PHP</a> with the help of the <a href="http://php.net/pcntl_fork">pcntl_fork</a> function and the process management extension.
</p>
<blockquote>
Let's say you want to take advantage of more than one core for a given process. Perhaps it performs many intensive computations and on a single core would take an hour to run. Since a PHP process is single threaded you won't optimally take advantage of the available multi-core resources you may have. Fortunately, via the Process Control (<a href="http://php.net/manual/en/book.pcntl.php">PCNTL</a>) extension, PHP provides a way to fork new child processes.
</blockquote>
<p>
He gives a quick snippet of code showing how to spawn off a few new processes, get their process IDs and watches a max number of children until one dies (then starts another).
</p>]]></description>
      <pubDate>Wed, 10 Mar 2010 13:05:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage's Blog: Scaling Up: Reducing Drag, Increasing Lift]]></title>
      <guid>http://www.phpdeveloper.org/news/12014</guid>
      <link>http://www.phpdeveloper.org/news/12014</link>
      <description><![CDATA[<p>
<i>Brandon Savage</i> has posted <a href="http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/">the next article</a> in his "Scaling Up" series, a look at reducing the amount of "drag" your application makes through its processing path and some tips to help increase its "lift" out of some common problems.
</p>
<blockquote>
The intuitive will note that many if not most of these suggestions are performance enhancements, not scaling techniques. Why then are they in an series about scaling? Scaling is about more than just adding hardware. It's also about making sure your system runs better. You can add lots and lots of hardware but you will someday be unable to compensate for bad queries and poor optimization.
</blockquote>
<p>
Some of his suggestions include taking care of any sort of errors or notices (anything that could slow the script down by writing to a log), defining virtual hosts instead of making excessive use of .htaccess files and installing caching software to maximize code and information reuse.
</p>]]></description>
      <pubDate>Tue, 24 Feb 2009 15:13:15 -0600</pubDate>
    </item>
  </channel>
</rss>
