News Feed
Sections




News Archive
feed this:

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

Oracle Coherence Blog:
Getting Started With The Coherence Memcached Adaptor (and PHP)
August 20, 2014 @ 10:55:45

As Chris Jones mentions in his latest post to his OTN blog, there's a tutorial that's been posted by David Felcey showing how to get started with Oracle Coherence via the memcached adapter in PHP. Coherence is Oracle's own version of a key/value storage that focuses on performance and scalability.

Coherence 12c (12.1.3) adds support for Memcached clients to directly store data a in Coherence cluster using the Binary Memcached protocol. This post outlines how to configure the Coherence Memcached Adaptor and includes a simple PHP example to show how Memecached clients can connect to a Coherence cluster.

He includes the XML configuration you'll need to create/modify on the Oracle side to make the memcached connections work and explains the different parts. With that in place, he moves on to the PHP example, showing a simple memcached request to store and retrieve a string. It's almost transparent to the PHP user save some of the configuration options required to make it work.

0 comments voice your opinion now!
oracle coherence introduction memcached adapter tutorial

Link: https://blogs.oracle.com/OracleCoherence/entry/getting_started_with_the_coherence

Mikko Koppanen:
Memcached protocol support
November 15, 2013 @ 11:15:38

Mikko Koppanen has posted about some updates he's making to the PECL memcached extension, more specifically around binary protocol support.

There are quite a few things still missing and only binary protocol is supported at the moment, but the code seems to work reasonably well in small-scale testing. I am not sure whether this is useful for anyone, but at least it allows things such as quick prototyping of network servers, exposing sqlite database over memcached protocol etc.

An example of code using this new functionality is included in the post showing how to create both a simple sever with attached "get" and "set" handlers and a client to connect to it and enable the binary protocol.

The code is still work in progress but it's available in github: https://github.com/mkoppanen/php-memcached/tree/feature-server. Note that you need to compile libmemcached with -enable-libmemcachedprotocol and the PECL memcached extension with -enable-memcached-protocol.
0 comments voice your opinion now!
memcached binary support protocol pecl update

Link: http://valokuva.org/memcached-protocol-support/

DZone.com:
PHP Performance Crash Course, Part 2 The Deep Dive
November 13, 2013 @ 10:56:33

DZone.com has posted the second part of a two-part series looking at increasing the performance of your PHP applications (part one is here). In this new post, he looks at a few topics including caching, session handling and asynchronous processing with Resque and Redis.

Ultimately, scalability is about the entire architecture, not some minor code optimizations. Often times people get this wrong and naively think they should focus on the edge cases. Solid architectural decisions like doing blocking work in the background via tasks, proactively caching expensive calls, and using a reverse proxy cache will get you much further than arguing about single quotes or double quotes.

He briefly recaps some of the "core principles" for optimizing applications and gets right into explaining the later ones on the list:

  • Optimize sessions through memcached handling
  • HTTP request/response caching
  • Caching Doctrine result sets
  • Caching the web service responses made with Guzzle
  • Handling asynchronous processing with Resque and Redis

He includes code and configuration examples for each item, helping to flesh them out a bit more. He also makes a recommendation of using something like AppDynamics to monitor the performance of your application (disclaimer: he works for them).

0 comments voice your opinion now!
performance crash course part2 series caching redis memcached session

Link: http://architects.dzone.com/articles/php-performance-crash-course-0

Aleksey Korzun:
Benchmarking Memcached and Redis Clients
June 19, 2013 @ 11:06:31

Aleksey Korzun has posted some of the results from benchmarking he performed on various Memcached and Redis clients through PHP. His tests focused on multiple PHP client libraries, both user-land and extension based.

As some of you may know, I'm crazy about speed. So when I saw that people were happily using Predis as their choice of PHP client for Redis, I was a bit confused. Why use a client written in PHP for something that should be 'fast' like Redis? That kind of defeats the purpose - unless you don't really care about response times and scalability. [...] The performance difference piqued my interest. I wanted to find out just how much performance users are sacrificing by choosing one implementation over another.

He ran his tests on VirtualBox VM instances with the same specs and the same version of PHP installed. He tested various versions of the Memcached client, Redis client, Predis and the IgBinary extension. His results (Google spreadsheet) show the requests processed using each method based on this benchmarking script.You can visit the post to see the graphs of the results too.

0 comments voice your opinion now!
benchmark memcached redis client graph results

Link: http://alekseykorzun.com/post/53283070010/benchmarking-memcached-and-redis-clients

James Fuller:
Simply scale with Nginx, Memcached, PHP-FPM and APC
February 04, 2013 @ 10:46:01

James Fuller has posted a guide to scaling your web application using the nginx web server, memcached, PHP-FPM and APC caching.

We sell an educational product that serves a predictable 15,000 requests per minute for 10+ hours/day, every day. Instead of Apache, we use nginx with PHP-FPM to handle this traffic. This is becoming a very popular setup for many companies with non-trivial traffic, but I have also found success with it in my small 256MB Ram VPS. For various reasons, nginx does a better job with memory and concurrent connection handling than Apache. In this post, I want to talk about some of the reasons you might want to go with this setup.

He talks about some of the efficiency gains that memcache and nginx can give you pretty easily and some of the common uses for nginx, including using it as a reverse proxy. He talks some about Apache's typical request handling and shows the difference between that and how nginx does its "never block, finish fast" handling. He fits in the other pieces - PHP-FPM, memcached and APC - showing how each of them offers their own types of performance gains for different areas of the application.

0 comments voice your opinion now!
scale platform nginx memcached phpfpm apc cache


Mike Purcell's Blog:
CentOS - PHP - Install Memcached (with a d) Stack
June 20, 2012 @ 09:13:59

In this new post to his blog Mike Purcell gives you the full instructions to getting a CentoOS 6 system up and running with Memcached and PHP.

Recently I started retro-fitting the MeLikeDrinks.com drink website to cache frequently used data to improve performance, as such I wrote a light, custom cache API which sits on top of PHP's Memcached API. [...] If you opt to use PHP Memcache, and because this article assumes you are using CentOS, you can simply have YUM install the entire stack for your via `yum install php-memcache`.

He describes some of the differences between the two memcache APIs available to PHP developers (memcache and memcached) and includes the instructions to get both versions installed. "Memecache" is as easy as installing the package, while "Memcached" takes a bit more work - installing dependencies, configuring and compiling a few things specific to your system.

0 comments voice your opinion now!
memcached install centos package compile tutorial


Artur Ejsmont's Blog:
Publishing queue messages from PHP using different backends
March 26, 2012 @ 11:31:53

Artur Ejsmont has a new post sharing some benchmarks he put together about the "messages per second" and "time to execute" when using PHP to pull from various messaging backends.

I have looked at the state of different messaging backends recently and i ran a little benchmark to see what is the rough comparison of message publishing throughput. Results that i got are quite surprising. What i wanted to achieve is some sort of reassurance before choosing a messaging bus for my PHP project.

Running both the PHP and the messaging test scripts on the same server, he pulled from a few different backend systems - RabbitMQ, MySQL, MongoDb, Memcached and ActiveMQ. The results were interesting, showing an interesting result in the time it took to execute versus the number of messages per second pushed in.

0 comments voice your opinion now!
benchmark message queue backend rabbitmq mysql mongodb memcached activemq


NetTuts.com:
Turbocharge your Website with Memcached
February 07, 2012 @ 10:06:40

On the NetTuts.com site there's a new tutorial showing you how to introduce the Memcached tool to your application - a quick and easy way to cache data and optimize performance.

Your latest PHP/MySQL website is finally online. And it's awesome. But it's not as fast as you want it to be, because of the many SQL queries running every time a page is generated. And above that, you have the feeling it will not scale well under heavy loads. And you are most likely right. In this tutorial, we will see how you can greatly improve your website's responsiveness [...] by implementing a cache layer between your code and your database. The good news is it is fairly easy, and can be done in a few minutes!

They help you get the memcached server installed (a one-liner in most linux distributions) and how to install the memcached extension using PECL. Code is included showing you how to connect to the server, store data into the cache based on a generated key and how to pull the same data back out.

0 comments voice your opinion now!
memcached cache data tutorial introduction


Maarten Balliauw's Blog:
Running Memcached on Windows Azure for PHP
October 24, 2011 @ 21:52:11

Maarten Balliauw has a new post to his blog with a guide to running mamcached on Windows Azure for PHP, a tool targeted towards PHP on Windows users to provide them with the ability to cache outside of their application.

While Windows Azure offers a distributed caching layer under the form of the Windows Azure Caching, that components currently lacks support for non-.NET technologies. I've heard there's work being done there, but that's not very interesting if you are building your app today. This blog post will show you how to modify a Windows Azure deployment to run and use Memcached in the easiest possible manner. Note: this post focuses on PHP but can also be used to setup Memcached on Windows Azure for NodeJS, Java, Ruby, Python...

He provides a phar-based scaffolding you can use to set up the instance and describes two ways of accomplishing it - the "short way" of relying on the scaffolding or the "long way" describing what the scaffolder does behind the scenes (complete with code). For this, you can also download the source and look through it.

0 comments voice your opinion now!
windows azure memcached caching tool tutorial


PHPBuilder.com:
Build Blazing Fast PHP Websites with Memcached Distributed Caching
July 29, 2011 @ 11:07:53

On PHPBuilder.com today Jason Gilmore has written up a new tutorial about using memcached distributed caching for better performance in your web applications.

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!

He walks you through installing the memcache extension for PHP (from PECL) 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.

0 comments voice your opinion now!
memcache memcached performance distributed cache tutorial



Community Events





Don't see your event here?
Let us know!


install zendserver community framework library api podcast symfony update language deployment opinion laravel tips series package interview list release introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework