 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
James Fuller: Simply scale with Nginx, Memcached, PHP-FPM and APC
by Chris Cornutt 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.
voice your opinion now!
scale platform nginx memcached phpfpm apc cache
Mike Purcell's Blog: CentOS - PHP - Install Memcached (with a d) Stack
by Chris Cornutt 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.
voice your opinion now!
memcached install centos package compile tutorial
Artur Ejsmont's Blog: Publishing queue messages from PHP using different backends
by Chris Cornutt 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.
voice your opinion now!
benchmark message queue backend rabbitmq mysql mongodb memcached activemq
NetTuts.com: Turbocharge your Website with Memcached
by Chris Cornutt 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.
voice your opinion now!
memcached cache data tutorial introduction
Maarten Balliauw's Blog: Running Memcached on Windows Azure for PHP
by Chris Cornutt 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.
voice your opinion now!
windows azure memcached caching tool tutorial
PHPBuilder.com: Build Blazing Fast PHP Websites with Memcached Distributed Caching
by Chris Cornutt 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.
voice your opinion now!
memcache memcached performance distributed cache tutorial
Andrew Johnstone's Blog: Memcached multigets - ubuntu vs debian
by Chris Cornutt June 14, 2011 @ 12:07:29
Andrew Johnstone came across an interesting problem when he tried to use memcached multigets with a large number of keys - it was throwing failures, but only when he tried it on Ubuntu.
I Spent a little while yesterday investigating why memcached causes problems with multigets returning results and ended up comparing debian vs ubuntu. [...] A larger number of keys than 200 causes memcached to fail to return valid responses, additionally the key length greatly varies the number items you can pull back within a single multiget on Ubuntu, Debian implementation of memcached is able to handle all requests regardless of key length size.
He includes the code for his brief test and the output of the test runs on both Ubuntu and Debian systems. They clearly show the failures on the Ubunut side, with it throwing errors about "memcached_oi_read" and a zero length value returned to recv().
voice your opinion now!
memcached ubuntu debian multigets failure issue
Elijaa.org: Using cas() command from PECL Memcached
by Chris Cornutt October 06, 2010 @ 09:16:44
On Elijaa.org there's an interesting post (from back in May 2010) about using the "cas()" command in the memcached PECL extension to update the cached value of an object while preventing collisions with other scripts that might be updating the same value.
A series of commands is not atomic. If you issue a 'get' against an item, operate on the data, then wish to 'set' it back into memcached, you are not guaranteed to be the only process working on that value. In parallel, you could end up overwriting a value set by something else. [...] But PECL Memcached come with a useful function : cas().
The "cas()" function uses a checksum pulled out when the data is uplled using "get()". This token along with the updated data is passed into the "cas()" method that does the additional checking for you. A code snippet is included to show you its use.
voice your opinion now!
pecl memcached cas checksum tutorial
Developer.com: Getting Started with Memcached Distributed Memory Caching
by Chris Cornutt September 02, 2010 @ 09:40:02
On Developer.com today there's a new article talking about memcache and how you can implement it in your application to provide a performance boost for applications in a distributed environment.
As distributed system is part of the Memcached definition, you can install Memcached on various servers to make a larger caching server. In this way, Memcached helps reduce database loads to a minimum, resulting in faster and more responsive Web applications
They take some time to explain what memcache is - a simple to use caching system that reduces the dependency on other data sources - and how to get it installed (via the package manager of your choice). They suggest times on when and when not to use it as well as some of the security implications you'll need to worry about when implementing it. There's also a bit of sample code to help you get started in your application. You'll need the memcached extension to make it all work, though.
voice your opinion now!
memcache distributed caching tutorial memcached
|
Community Events
Don't see your event here? Let us know!
|