"PHP cache slam defense using (memcached) semaphore to prevent dogpile effect (aka clobbering updates, stampending herd or Slashdot effect).
Problem: too many requests hit your website at the same time to regenerate same content slamming your database. It might happen after the cache was expired.
Solution: first request generates new content while all the subsequent requests get (stale) content from cache until it's refreshed by the first request."
To that end Aesop consists of three main functions and goals:
Pre-compile and package HPHP - The idea here is simple. To get us up and running as quickly as possible I’ve packaged the HPHP binaries in the full download version of Aesop. This means we no longer have to worry about compiling HPHP, which saves time and possible headache. We needn’t use this version though, we can still download a minimal, Aesop only version complete with full source code.
Compile – Compiling HPHP applications from the command line means well, using a command line, setting environmental variables, and so on. Thus, we remove this burden and instead focus on making sure our code-base is acceptable to HPHP.
Aesop builds the file lists HPHP requires for code-compilation, sets environment variables, displays errors, and also manages the results of HPHP for the other main function of Aesop…
Manage Servers – Compiling code is only half the story. Once compiled HPHP has literally created a server-in-a-box for us. It’s a single executable that contains your source converted to C++, a web server, and the full PHP run-time. Aesop manages these executable for us in a nice list format, allowing us to start, stop and delete them at will. Of course setting their properties using GUI controls or a more advanced interface to a so-called HDF file is included as well.
Graphic stand-alone administration for memcached to monitor and debug purpose This program allows to see in real-time (top-like) or from the start of the server, stats for get, set, delete, increment, decrement, evictions, reclaimed, cas command, as well as server stats (network, items, server version) with googlecharts
You can go further to see each server slabs, occupation, memory wasted and items (key & value).
memtrack is a PHP extension that tracks memory consumption in PHP scripts and produces reports (warnings) when memory usage reaches certain levels set by the user.
php-judy is an exentsion by Nicolas Brousse for the Judy C library.
http://github.com/orieg/php-judyA Judy array is a complex but very fast associative array data structure for storing and looking up values using integer or string keys. Unlike normal arrays, Judy arrays may be sparse; that is, they may have large ranges of unassigned indices.
http://en.wikipedia.org/wiki/Judy_arrayJudy is a C library that implements a dynamic array. Empty Judy arrays are declared with null pointers. A Judy array consumes memory only when populated yet can grow to take advantage of all available memory. Judy's key benefits are: scalability, performance, memory efficiency, and ease of use. Judy arrays are designed to grow without tuning into the peta-element range, scaling near O(log-base-256) -- 1 more RAM access at 256 X population.
http://judy.sourceforge.netXHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level call counts and inclusive and exclusive wall time, CPU time and memory usage. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs.
Originally developed at Facebook, XHProf was open sourced in Mar, 2009.
We needed to locate where most of the memory is allocated in our scripts (as some of them became too memory hungry), so I've created memtrack extension. This extension helps us to see unusually big memory allocations in production code.
The new ezcCacheStack class in the eZ Cache component provides an automatic way of realizing this. You simply stack together an arbitrary number of storages. The stack will store every item into all of the stacked caches. You can configure how many items may reside in a storage. A replacement strategy class takes care about purging a certain number items in case a storage runs full. On restore, the stack will fetch the desired item from the topmost cache it is still stored in.
Replacement strategies shipped with the eZ Cache component provide you with 2 well-known cache algorithms: Least Recently Used (LRU) and Least Frequently Used (LFU).