<?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, 25 May 2013 21:03:03 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mfana Ronald Conco's Blog: RabbitMQ and PHP Part 2 - Durable Queues and Persistent Messages]]></title>
      <guid>http://www.phpdeveloper.org/news/17717</guid>
      <link>http://www.phpdeveloper.org/news/17717</link>
      <description><![CDATA[<p>
<i>Mfana Ronald Conco</i> has posted the second part of his RabbitMQ and PHP series to his blog today. This time he looks at <a href="http://www.theprogrammer.co.za/2012/03/19/rabbitmq-and-php-part-2-durable-queues-and-persistent-messages/">durable queues and persistent messages</a>
</p>
<blockquote>
You now have a queuing system that works and generates pdfs which are sent to users as per <a href="http://www.theprogrammer.co.za/2012/03/14/rabbitmq-and-php-part-1/">RabbitMQ and PHP Part 1</a> of this article. A week later after launching the queuing system you get one or two queries from users who claim to have made a request to get the pdf report but it never arrived. Okay, what could have happened ? well you go through the application log files and as suspected  - An Exception was thrown by one your classes as the consumer was trying to create the pdf and that is why it was never sent. Now this compromises the queuing system Totally, But wait there is a way to help prevent such.
</blockquote>
<p>
He shows how to make your queues "durable", meaning they'll survive a broker restart and they require a response from the consumer before being removed. He shows how (via the <a href="http://www.php.net/manual/en/book.amqp.php">php-ampq</a> functionality) to add the "AMPQ_DURABLE" flag to the queue definition. He also includes some code showing how to send back the acknowledgement so the entry can be removed from the queue. He also includes an update to the code that calls "publish" to make the messages persistent too.
</p>]]></description>
      <pubDate>Thu, 22 Mar 2012 13:39:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&uuml;ter's Blog: Testing persistent connection and thread-safety features in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17712</guid>
      <link>http://www.phpdeveloper.org/news/17712</link>
      <description><![CDATA[<p>
In <a href="http://schlueters.de/blog/archives/166-Testing-persistent-connection-and-thread-safety-features-in-PHP.html">this recent post</a> to his blog <i>Johannes Schl&uuml;ter</i> he talks about a way that he's come up with to test functionality that uses persistent connections (and an module he created to help).
</p>
<blockquote>
In a few rare cases this is not what people like, for that PHP introduced "persistent connections" of different kinds. Testing those is a bit annoying as you have to configure a webserver and ensure to hit the same instance over the course of a test and then use a load generator, probably one which can detect a failure. Additionally by having a webserver in the game there is more code being executed, which might mean an additional source for trouble while debugging. An alternative might be using FastCGI, while that adds it's own issues for such a test. To solve this for myself I, some time ago, wrote a PHP SAPI module called <a href="https://github.com/johannes/pconn-sapi">pconn</a> and pushed it to github. 
</blockquote>
<p>
The extension provides a way to emulate requests by executing a script multiple times automatically, making it easier to test things that require checking against multiple things simultaneously. While the <a href="http://us2.php.net/manual/en/features.commandline.webserver.php">built-in webserver</a> (PHP 5.4) can be used to test some of these things too, <i>Johannes'</i> extension can also be compiled to help with testing of threading in applications as well.
</p>]]></description>
      <pubDate>Thu, 22 Mar 2012 09:51:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shay Ben Moshe's Blog: PDO Persistent Connection Analysis]]></title>
      <guid>http://www.phpdeveloper.org/news/16526</guid>
      <link>http://www.phpdeveloper.org/news/16526</link>
      <description><![CDATA[<p>
<i>Shay Ben Moshe</i> has a new post to his blog today looking at <a href="http://blog.shay.co/pdo-persistent-connection-analysis/">some of the benefits</a> that using the persistent connections offered in <a href="http://php.net/pdo">PDO</a> can have on your application.
</p>
<blockquote>
<a href="http://php.net/manual/en/book.pdo.php">PDO</a> is an abstraction layer for database connections in PHP, and it became increasingly popular in the past few years. PDO gives us the option to use a persistent connection. If we don't use this option, a new connection is created for each request. If we do use this option, the connection is not closed at the end of the script, and it is then re-used by other script requests.
</blockquote>
<p>
He shares the setup for his testing (hardware and MySQL configuration) and some of the results from his tests using the Apache <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab tool</a> for making web requests against an application. You'll need to <a href="http://blog.shay.co/files/pdo.rar">download the archived file</a> to see the results, though. It also includes the files he used to test with, comparing regular connections to the persistent ones.
</p>]]></description>
      <pubDate>Tue, 28 Jun 2011 08:11:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alex Mills' Blog: Why WordPress Doesn't Have Built-In Persistent Caching]]></title>
      <guid>http://www.phpdeveloper.org/news/14957</guid>
      <link>http://www.phpdeveloper.org/news/14957</link>
      <description><![CDATA[<p>
<i>Alex Mills</i> has <a href="http://www.viper007bond.com/2010/08/10/why-wordpress-doesnt-have-built-in-persistent-caching/">a interesting post</a> to his blog answering a question he and several of the other WordPress developers at Automatic get about their blogging engine - why it doesn't including a default caching layer.
</p>
<blockquote>
WordPress does actually have a built-in cache called the object cache. It was introduced way back in 2005 1 and it basically caches database query results. [...] However as soon as the page is done being generated, that object cache is discarded. Initially the object cache cached these little chunks of data to the filesystem so that they could be reused on subsequent pageviews. While great in theory, the concept turned out to be terrible in practice.
</blockquote>
<p>
They opted out of the persistent object caching because, well, it was slower than some of the preexisting alternatives out there like database caching and caching plugins (with WP Super Cache).
</p>]]></description>
      <pubDate>Fri, 13 Aug 2010 11:20:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Internet Super Hero Blog: PHP 5.3: Persistent Connections with ext/mysqli]]></title>
      <guid>http://www.phpdeveloper.org/news/11981</guid>
      <link>http://www.phpdeveloper.org/news/11981</link>
      <description><![CDATA[<p>
The Internet Super Hero blog has <a href="http://blog.ulf-wendel.de/?p=211">posted some statistics</a> comparing the connections per second that can be made with the newly introduced persistent connection support coming with PHP 5.3 in the <a href="http://php.net/mysqli">mysqli (ext/mysqli)</a> driver.
</p>
<blockquote>
Persistent Connections have been a mixed bag. They can give you a significant performance boost by caching (pooling) connections although MySQL is already comparatively fast at establishing connections. However,connections are stored "as-is" in the cache. They are not "cleaned up".
</blockquote>
<p>
The ext/mysqli driver takes care of this and a few other problems surrounding the persistent connections by cleaning up things like rolling back active transactions, unlocking tables, closing prepared statements and closing handlers. The trick is in a call to the C-API function  <a href="http://dev.mysql.com/doc/refman/6.0/en/mysql-change-user.html">mysql_change_user() (= COM_CHANGE_USER)</a>.
</p>]]></description>
      <pubDate>Thu, 19 Feb 2009 09:31:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: Persistent connections with MSSQL]]></title>
      <guid>http://www.phpdeveloper.org/news/11555</guid>
      <link>http://www.phpdeveloper.org/news/11555</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> is <a href="http://pooteeweet.org/blog/0/1370#m1370">looking for a little help</a> on a strange problem he's seeing connecting to a SQL Server with persistent connections:
</p>
<blockquote>
We are connecting to SQL Server via mssql_pconnect(). MaxChilds is set to 256 and we are only establishing one connection per request. So as a result I am expecting a maximum of 256 established connections. A client went into production yesterday and due to a missing index the server ended up being insanely loaded, as the queries started to block each other. The sysadmin checked the state of things via netstat and found that there were close to 500 tcp connections to the SQL Server. What gives?
</blockquote>
<p>
He checked FreeTDS and the MaxRequestsPerChild settings to ensure that nothing there could have caused the problem, but hasn't found any hints so far. If he can't solve it right away, he also wonders if there's a way to kill idle connections if they're not used in a certain amount of time.
</p>
<p>
There's already one connect that mentions a similar issue but with Oracle connections, also on RHEL, but no definitive answers so far.
</p>]]></description>
      <pubDate>Thu, 11 Dec 2008 12:01:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Maggie Nelson's Blog: To persist or not to persist?]]></title>
      <guid>http://www.phpdeveloper.org/news/10882</guid>
      <link>http://www.phpdeveloper.org/news/10882</link>
      <description><![CDATA[<p>
On her blog, Objectively Oriented, <i>Maggie Nelson</i> looks at <a href="http://www.objectivelyoriented.com/2008/08/to_persist_or_not_to_persist.html">a topic</a> she was debating for a new application - whether or not to use persistent connections to her database.
</p>
<blockquote>
There's a connection already waiting for you. Yay, right? Well, with MySQL, connecting is actually really really cheap, and frankly, if you are using persistent connections, you might encounter some issues with Apache going zombie on processes that use a connection, effectively taking that connection out of use. Grrr.
</blockquote>
<p>
She <a href="http://www.objectivelyoriented.com/2008/08/to_persist_or_not_to_persist.html">did some research</a> on the topic but found contradicting evidence for both sides. Eventually, what her choice boiled down to was this possible issue mentioned by <i>Jay Pipes</i> (of MySQL):
</p>
<blockquote>
If you use Apache, Apache can zombie a PHP process and cause the mysql connection to be held until the mysql server restarts...
</blockquote>]]></description>
      <pubDate>Fri, 22 Aug 2008 11:18:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alison Holloway's Blog: Int'l PHP Magazine Article - The Oracle PHP Connection]]></title>
      <guid>http://www.phpdeveloper.org/news/7752</guid>
      <link>http://www.phpdeveloper.org/news/7752</link>
      <description><![CDATA[<p>
Those of you out there that work with PHP and Oracle might want to check out <a href="http://blogs.oracle.com/alison/2007/05/02#a45">the new article</a> that <i>Alison Halloway</i> mentions in her blog today - a reprint of a fellow Oracler - <i>Richard Rendell</i>'s article, <a href="http://www.oracle.com/technology/tech/php/pdf/php-oracle-connection-magazine-reprint.pdf">"The Oracle PHP Connection"</a> [pdf].
</p>
<blockquote>
In this article we take a look the connection methods used for PHP and Oracle database using the PHP OCI8 extension. Specifically we cover non-persistent and persistent connections while offering some suggestions for choosing the right approach. In addition we will cover some upcoming features in the next major release of the Oracle database to significantly improve scalability of PHP applications.
</blockquote>
<p>
He <a href="http://www.oracle.com/technology/tech/php/pdf/php-oracle-connection-magazine-reprint.pdf">talks about</a> [pdf] the types of Oracle->PHP connections, what the database name connection strings are (with examples) the environment variables for connections, closing the connections, a look at connection pooling, and an overview of using DRCP (Database Resident Connection Pooling) to accomplish it.
</p>]]></description>
      <pubDate>Wed, 02 May 2007 08:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DeveloperTutorials.com: Developing State-enabled Applications With PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7620</guid>
      <link>http://www.phpdeveloper.org/news/7620</link>
      <description><![CDATA[<p>
The Developer Tutorial website has a <a href="http://www.developertutorials.com/tutorials/php/developing-state-enabled-applications-with-php-060829/page1.html">new article</a> posted today about the creation of "state-enabled applications" with PHP. Basically, a chunk of functionality to keep user data persistent throughout the whole time they're on the site.
</p>
<blockquote>
A major drawback is that while browsing from one page to another, the website does not remember the State of the browsing session. This make interactivity almost impossible. In order to increase interactivity, the developer can use the session handling features of PHP to augment the features of HTTP in order to remember the State of the browsing session.
</blockquote>
<p>
They <a href="http://www.developertutorials.com/tutorials/php/developing-state-enabled-applications-with-php-060829/page1.html">look at two solutions</a> - using cookies and using sessions. Cookies are simple enough, but when it comes to sessions, there's actually two different roads to follow: with cookies enabled and without. They have to be handled slightly differently, but both essentially work the same way.
</p>]]></description>
      <pubDate>Fri, 13 Apr 2007 08:55:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tobias Schlitt's Blog: Object relation mapping in eZ Components]]></title>
      <guid>http://www.phpdeveloper.org/news/7366</guid>
      <link>http://www.phpdeveloper.org/news/7366</link>
      <description><![CDATA[<p>
<i>Tobias Schlitt</i> has <a href="http://schlitt.info/applications/blog/index.php?/archives/528-Object-relation-mapping-in-eZ-Components.html">pointed out</a> a new <a href="http://ez.no/community/articles/the_persistentobject_ez_component_putting_relations_where_relations_belong">article he's written up</a> that acts as an introduction to the features of the new ORM component of the eZ Components application framework - the <a href="http://ez.no/doc/components/view/latest/(file)/classtrees_PersistentObject.html">PersisteneObject</a>.
</p>
<blockquote>
For me the coolest feature of PersistentObject is, that the component does not require you're ORM enabled classes to inherit from a certain base to allow your objects to be stored in a database (made persistent).
</blockquote>
<p>
This new object gives you a "wapper" of sorts to make any of the pre-existing objects in your application persistent. Check out <a href="http://ez.no/community/articles/the_persistentobject_ez_component_putting_relations_where_relations_belong">the article</a> for more.
</p>]]></description>
      <pubDate>Thu, 01 Mar 2007 10:03:00 -0600</pubDate>
    </item>
  </channel>
</rss>
