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

BinaryTides.com:
Install Nginx + Php FPM + APC on CentOS 6.4
Nov 11, 2013 @ 16:10:50

On the BinaryTides site a new tutorial has been posted walking you through all the steps to getting Nginx, PHP FPM and APC working on a CentOS installation, complete with all commands and configuration updates you'll need.

A lamp server runs Nginx web server along with Php and Mysql or MariaDB on a Linux system. Nginx is increasing becoming popular because of its lightweight structure and ability to handle large amounts of traffic in an optimum manner. Mariadb is the replacement for mysql because mysql is not very free anymore. In this tutorial we shall be setting up Nginx with Php FPM on CentOS. The instructions to instal MariaDB shall be covered in another post.

The rest of the post helps you:

  • Install and configure Nginx
  • Create a virtual host
  • Install PHP and FPM (and set up Nginx to use it)
  • Install APC (the "Alternative PHP Cache")
tagged: install nginx phpfpm centos apc tutorial configure

Link: http://www.binarytides.com/install-nginx-php-fpm-centos/

Davey Shafik:
Everything You Need to Know About OpCode Caches
Oct 01, 2013 @ 15:49:48

Davey Shafik has a new post to his site today sharing everything you need to know about opcode caches, the mechanism that's works "behind the scenes" to cache the execution of the opcode paths for later reuse.

Last year I wrote a talk called “Fast, Not Furious: How to Find and Fix Slow Code” - a performance talk covering profiling, memcache and some other stuff. As I often do - to hedge my bets = I stuck a few slides on the end “just in case” I ran through everything too quickly and needed to fill in time. These slides were on APC, the Alternative PHP Cache, and went just a little into tokens and how APC works under the hood. I really enjoyed presenting those 6 slides, and I’ve been wanting to expand on that topic ever since then. Well, after a few weeks of hard work, some input from some great people, including Sara Golemon, Elizabeth Smith and Julien Pauli, I’m so very happy to publish PHP Performance I: Everything You Need to Know About OpCode Caches.

The result is published over on the Engine Yard Developer Center and has been made into a 20 minute screencast (with original slides here). He covers what they are, which ones are out there, the common execution cycle and what happens when the opcodes are cached.

tagged: opcode cache presentation screencast guide tutorial apc zend opcache

Link: http://daveyshafik.com/archives/68838-everything-you-need-to-know-about-opcode-caches.html

BinaryTides.com:
Setup Nginx + php-FPM + apc + MariaDB on Debian 7 - The perfect LEMP server
Aug 09, 2013 @ 16:58:39

On the BinaryTides.com site today there's a tutorial they've posted walking you through the full install process to get Nginx, PHP-FPM (with APC) and MariaDb working together on Debian, complete with configuration changes and all the commands you'll need.

Debian is a great choice for setting up linux webservers. According to current stats it is the most popular server OS followed closely by centos. I am a great fan of the apt/dpkg/gdebi commands, which make it so easy to install and update packages on the system. To setup a complete functional php webserver, you need to install a couple of extra things which include a webserver and a database. In this post we shall be setting up nginx, php, php-fpm, apc and maridb.

The tutorial is broken up into three main steps, each with clarification of what's involved:

  • Install Nginx on Debian
  • Install php and php-fpm
  • Install MariaDB on Debian
tagged: lemp server debian phpfpm mariadb apc

Link: http://www.binarytides.com/install-nginx-php-fpm-mariadb-debian

James Fuller:
Simply scale with Nginx, Memcached, PHP-FPM and APC
Feb 04, 2013 @ 16: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.

tagged: scale platform nginx memcached phpfpm apc cache

Link:

Zumba Engineering Blog:
Some CakePHP optimizations
Nov 07, 2012 @ 15:31:20

For those out there using the CakePHP framework to create your applications, you might be interested in these quick tips from Juan Basso on the Zumba Engineering Blog for both the architecture and actual code to optimize the performance of the app.

Our site and system has a lot of throughput and it make us use more instances and try to reduce the load in every part. It makes the company happy (save money) and also make the customer happy (faster load). On this article I will go over few things in terms of architecture and some code changes/strategies that could make your application faster as well.

Some of the recommendations include:

  • Installing the APC/opcode caching to help save execution time
  • Avoiding as many network requests as possible
  • Use local file/data caching
  • Using the "requestAction" inside controllers with its built-in caching
tagged: cakephp optimize caching apc opcode file resource

Link:

DZone.com:
Using APC correctly
Aug 01, 2012 @ 16:09:52

In this new post to DZone.com, Giorgio Sironi shares a few helpful hints on using the APC tool to help improve the performance of your web applications.

APC (Alternative PHP Cache) is one of the orthogonal tools you can use to speed up the execution of PHP code. This article explains from scratch the correct use of APC's system cache (not touching the user cache, which is just a standard key/value map). APC has also other features like upload progress support, but the system cache is its main features and has such a little footprint on your code that you should throw an apc.php file to everyone picking on you for writing strings in single or double quotes.

He describes what the APC cache does for you (both on a lower, opcode and a higher, performance levels) and how it relates to the shared processes a web server uses. He finishes off the post with a quick guide to getting it installed and working ("pecl install") and some of the common settings to tweak to get the most of the functionality.

tagged: apc install tutorial usage opcode cache perfromance

Link:

Sébastien Thomas' Blog:
Monitoring PHP APC cache usage
Oct 05, 2011 @ 18:11:14

Sébastien Thomas has a recent post to his blog shows how (with just a bit of code) you can monitor your APC cache usage on your local host.

I won't go deep into how OpCode caches work, you will find a lot of docs, just google for APC, Xcache, eAccelerator... What I can say is that APC (as other caches do) will save binary parts of your PHP code into memory and use it when you call for the same PHP function again. This way you save all the PHP file opening, parsing, etc. [...] One thing you won't come accross often on internet is How (the hell) do I know if APC is performing well ?

His answer comes in the form of code based on the APC-PHP-Monitor script. He changed it slightly to allow for use in other places, like with Nagios monitoring. A Nagois template is included to query the cache and report back a hit ratio. An example of the full cache results can be seen here complete with general cache info, hits, misses and file versus user caching stats.

tagged: monitor cache usage apc apccchemonitor tutorial nagois

Link:

PHPClasses.org:
Lately in PHP Episode 16 - APC in PHP, MODX CMS, Top Developers
Sep 30, 2011 @ 14:11:53

PHPClasses.org has posted their latest episode of their "Lately In PHP" podcast today - PHP 5.4.0 Will not Include APC, Is MODX CMS better than Wordpress? Top PHP Developers in Every Country.

PHP 5.4 beta 1 was released but APC is not going to be included at least in PHP 5.4.0. Manuel Lemos and Ernani Joppert discuss this and other happenings in the PHP world, like the adoption of more robust Continuous Integration methods to prevent shipping buggy PHP versions like what happened with PHP 5.3.7.

The podcast also features an interview with Bob Ray, an author and contributor to the MODX CMS platform project. You can listen to this latest episode either through the in-page player, by downloading it directly or by subscribing to their feed and getting this and past shows automatically.

tagged: modx cms podcast latelyinphp apc developers

Link:

Script-Tutorials.com:
How to Use APC Caching with PHP
Sep 15, 2011 @ 13:29:14

On Script-Tutorials.com today there's a new article introducing you to using APC caching in your PHP applications. Their simple example sets up a caching class that handles the dirty work for you.

Today I have another interesting article for PHP. We will talking about caching, and practice of using caching in php. I will make review of APC caching and will show you how you can use APC in PHP. [...] Now people have learned to use the server memory for data storage. RAM much faster than hard disk, and the price of memory falls all the time, so let’s use all these advantages of this.

Included in the post is the code for a few different files - the caching class itself that implements the APC functions in PHP and some examples of it in use: saving objects, fetching data from the cache and removing things from the cache.

tagged: caching apc tutorial class add remove fetch

Link:

DevShed:
Cache Data in RAM with PHP
Jun 08, 2011 @ 15:48:23

DevShed has posted a new article in their series looking at storage interfaces and how to use them. In this latest article they show how to create a caching layer that will allow you to work with any sort of caching backend you'd like.

As with other elements of object-oriented programming, it’s possible to use segregated interfaces in a great variety of scenarios and conditions and, therefore, enjoy the benefits that they provide right out of the box. [...] My goal in this article is to create an extendable caching system based on the contract defined by a segregated interface. To achieve this, the first step we need to take is to create the interface in question.

He shows how to create the "CacheableInterface" that provides the structure for the child interfaces to follow. It provides methods for setting, getting, deleting and checking to see if a key exists. They illustrate its use with an interface to an APC cache, a file caching and a class that uses dependency injection to define the interface to use.

tagged: caching data ram tutorial apc filesystem interface

Link:


Trending Topics: