 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Sébastien Thomas' Blog: Monitoring PHP APC cache usage
by Chris Cornutt October 05, 2011 @ 13: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.
voice your opinion now!
monitor cache usage apc apccchemonitor tutorial nagois
Script-Tutorials.com: How to Use APC Caching with PHP
by Chris Cornutt September 15, 2011 @ 08: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.
voice your opinion now!
caching apc tutorial class add remove fetch
DevShed: Cache Data in RAM with PHP
by Chris Cornutt June 08, 2011 @ 10: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.
voice your opinion now!
caching data ram tutorial apc filesystem interface
Zend Developer Zone: Caching of Zend Framework application configuration file
by Chris Cornutt May 27, 2011 @ 12:02:02
On the Zend Developer Zone today there's a new post showing how you can cache your application configuration file to boost the performance of your Zend Framework application just a little bit more.
If you think that you've done everything in terms of performance optimization of your Zend Framework-based project, I bet that your application configuration file was not included in that process. [...] Reason why I'm referring to application config is that its parsing is performed on every request, which is certainly unnecessary, as you don't make configuration changes very often. Solution is simple - cache it.
He opts for an APC-based solution that, in the bootstrap, reads in the configuration file and caches it as a part of a custom Zend_Application object. Code is included for both the addition to the bootstrap and the custom class extending Zend_Application to handle the actual caching.
voice your opinion now!
zendframework application configuration cache apc
Artur Graniszewski's Blog: Drupal 7 HipHop for PHP vs APC - benchmark
by Chris Cornutt May 19, 2011 @ 11:01:20
Artur Graniszewski has written up a comparison of the performance of a standard Durpal 7 installation using HipHop versus APC to handle the optimization of the application.
There have been many suggestions on improving Drupal performance, some of them recommend the use of APC module, data caching, or even compilation of the entire system through HipHop for PHP. While the first two solutions have been successfully implemented, no one was able to perform the build process. After many battles with the the compiler and the Drupal code, I present you results of the first successful translation of Drupal 7 to C++ language
He introduces the methods he used and the statistics of the platform (hardware) he tested with. He also includes the software used and compile commands used to create the compiled Drupal version. Included in the post are graphs showing CPU usage comparing the two types of testing (HipHop and APC) versus a normal PHP-based installation. It also briefly touches on concurrency levels and the different optimizations that could be made with the gcc compiler.
voice your opinion now!
drupal apc hiphop benchmark cpu usage
Simas Toleikis' Blog: PHP data caching techniques
by Chris Cornutt December 13, 2010 @ 08:45:10
Simas Toleikis has posted some caching techniques he's come up with to handle a few different situations including simple file-level caching and working with memcached.
Caching intermediate data is the most primitive and yet the most rewarding optimization technique where you don't need to fiddle with any complex algorithms or premature optimizations. If you are into PHP you should be aware of all the best practices and the right tools for this job to make your websites fly.
He covers a few different, though common, situations you may come across in your application where caching could be very helpful:
- Static scope variables
- APC shared memory functions
- Memcached for large distributed caches
- In-memory database tables
- Simple file-level caches
voice your opinion now!
caching technique situation apc memcache file memory
Till Klampaeckel's Blog: APC get a key's expiration time
by Chris Cornutt November 11, 2010 @ 11:28:55
Till Klampaeckel has shown off one of the "best kept secrets" about the APC caching tool that not many people seem to use - getting a key's expiration time that can be useful to tell other applications how long the data will be good for.
APC offers a bunch of very useful features - foremost a realpath cache and an opcode cache. However, my favorite is neither: it's being able to cache data in shared memory. How so? Simple: use apc_store() and apc_fetch() to persist data between requests. The other day, I wanted use a key's expiration date to send the appropriate headers (Expires and Last-Modified) to the client, but it didn't seem like APC supports this out of the box yet.
He includes a quick bit of sample code that defines an "apc_exire" function that grabs the expiration information as returned by apc_cache_info - the "ttl" and "creation_time" values.
voice your opinion now!
apc cache expiration time
Zend Developer Zone: Using APC with PHP
by Chris Cornutt November 02, 2010 @ 11:51:44
The Zend Developer Zone has published a new in-depth tutorial from Vikram Vaswani about using APC and PHP to get the best performance out of your application. Using this opcode caching tool can greatly speed up the execution of your site with almost no effort on your part.
dding APC to an application usually results in improved application response times, reduced server load and happier users. In this article, I'll introduce you to APC, guiding you through the process of installing and configuring it and showing you a few examples of how it works. I'll also walk you through the APC administrator interface, which lets you view APC performance in real time, and show you how you can use it with the Zend Framework
He shows you every step of the way - installation, configuration (complete with some screenshots) and the web-based interface you can enable to see the statistics about how the cache's performance is and what requests it's been handling. He mentions other abilities APC has like array and object caching, caching closures and finally a real-world example of using it to cache the results of a Twitter search request (in a Zend Framework environment).
voice your opinion now!
apc opcode cache tutorial optimize
IBuildings techPortal: Understanding APC
by Chris Cornutt October 07, 2010 @ 09:33:31
On the IBuildings techPortal today there's a new tutorial from Vito Chin that wants to help you understand what APC (the Alternative PHP Cache) is all about and get you on the road to using it in your application.
APC is a performance-enhancing extension. It should not be confused with a magic pill, although having it around does provide a positive impact on performance! If configured incorrectly, APC can cause unexpected behaviour, however when implemented optimally APC can be a useful weapon in your arsenal. In this post we will examine APC's capabilities and it's application both as an opcode cache and in its less common usage as a data cache.
He starts off by comparing/contrasting it with memcache, nothing that APC is more targeted towards PHP and is more useful for caching smaller bits of information (like objects). He talks about the importance of using APC for an application, what the system really caches and some of the limitations that come with it. There's code snippets to help illustrate some of the points and the article is rounded out with a look at file caching, the time-to-live setting and how you can monitor your cache's health.
voice your opinion now!
apc cache alternative tutorial memcache
|
Community Events
Don't see your event here? Let us know!
|