Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tideways.io:
PHP Session Garbage Collection: The unknown performance bottleneck
May 09, 2016 @ 17:49:22

On the Tideways.com blog there's a tutorial talking about the "unknown performance bottleneck" that can be caused by PHP's own session garbage collection. This garbage collection happens when sessions expire and they need to be removed from the current set/data source.

Here is one performance setting in your PHP configuration you probably haven't thought about much before: How often does PHP perform random garbage collection of outdated session data in your application? Did you know that because of the shared nothing architecture PHP randomly cleans old session data whenever session_start() is called? An operation that is not necessarily cheap.

It's his general advice to avoid PHP's random garbage collection (it happens one in every 1000 requests, randomly) and opt for a more consistent method using background scripts. He gives an example using the Laravel framework and it's modified session garbage collection happening every 50th request (making use of the Symfony Finder component). He points out the problem with its implementation and the negative impact it could have on large, highly used applications. They share some of their own statistics and how to change this default (modifying the lottery option and making a custom "cleanup" command).

tagged: session garbage collection performance bottleneck unknown modify laravel symfony

Link: https://tideways.io/profiler/blog/php-session-garbage-collection-the-unknown-performance-bottleneck

DZone.com:
GladiusDB and Firebird: Databases for Your PHP Apps
Aug 13, 2012 @ 15:45:16

On Dzone.com Leigh Shevick continues her series looking at some of the "unknown databases" out there that PHP developers might not be aware of (but could be very useful in their applications). In this second part of the series, she looks at GladiusDB and Firebird.

In this next installment, we’ll be looking at two (arguably very contrasting) databases. The first is Gladius DB, which is a flat file database written in pure PHP. The second is Firebird, another database veteran, which has features similar to some of the better-known databases, such as Microsoft SQLServer.

She gives a brief introduction of each and includes links to two resources to help you get connected to each. A bit of sample code shows how to make the connections and pull information out of simple tables (SELECTed).

tagged: gladiusdb firebird database unknown tutorial

Link:

DZone.com:
The Best Unknown Databases for PHP Apps
Aug 06, 2012 @ 15:49:50

In this new post to DZone.com today Leigh Shevchik kicks off a series of posts looking at the "unknown databases" that PHP developers might not think about when working on their applications.

In this day and age, there a plethora of options available to us. In this three part series, I'm going to walk you through five alternative databases that you may or may not have heard of. [...] Whether you're involved in embedded development, OLTP, OLAP, massive scalability and storage or simple database-backed applications, you're not going to walk away with the same perspective that you had before you started reading these posts. So without further ado, let's get started with a look at a veteran of the Internet: Berkeley DB.

She covers some of the database's basic features and a bit about its history (available for years) as well as some detail on how requests to the database work. To make the connection from your application, you'll need to install the dba PHP extension. She provides two examples of code that uses the database - one that just connects and deletes a record, another that adds/removes/finds users from an "address book" database.

tagged: database type unknown berkeleydb tutorial dba extension

Link:


Trending Topics: