Glances is a linux system monitor written in Python.
Website Performance
Topics:
Allow Plugins to Short-circuit wp_nav_menu

I just submitted my second WordPress core patch that adds a short-circuit filter at the top of wp_nav_menu which enables plugins to retrieve rendered menu output from a transient or non-persistent cache instead of relying on relatively complex database query that returns one of the most static items of every website.
Why is this important?
To illustrate the complexity of menu retrieval, here is a list of all database queries that are run on every page load:
- Retrieve term object of the
nav_menutaxonomy that corresponds to the specific menu name. - Retrieve menu item IDs (not complete post objects, yet) that are in the particular term.
- Query for menu item post objects with the specific IDs and retrieve three
post_metavalues per each menu item. - Retrieve post and term objects corresponding to each menu item (map every
nav_menu_itempost to the actual post, page or archive page).
and here are the corresponding query samples: Read more »
Link: Moving Beyond End-to-End Path Information to Optimize CDN Performance
Moving Beyond End-to-End Path Information to Optimize CDN Performance
Our main result is that redirecting every client to the server with least latency does not suffice to optimize client latencies. First, even though most clients are served by a geographically nearby CDN node, a sizeable fraction of clients experience latencies several tens of milliseconds higher than other clients in the same region. Second, we find that queueing delays often override the benefits of a client interacting with a nearby server.
Monitor Memcached with Munin
It appear as most stock-plugins are configured in
/etc/munin/plugin-conf.d/munin-node. This isn’t the case for the Memcached plugin. Hence this post.
Fixing /etc/init.d/php5-fpm Init Script for PHP 5.4 (from Dotdeb) on Debian Squeeze
I recently updated my server to PHP 5.4 and discovered that I was no longer able to restart the PHP-FPM service using the regular:
$ /etc/init.d/php5-fpm restart
or
$ service php5-fpm restart
I went to the official Debian GIT repository for the PHP 5.4 beta package and found the following differences between the init scripts (here is the one from Dotdeb):
Replacing my init script with the one from the official beta package solved the problem. I wonder what export ZEND_DONT_UNLOAD_MODULES=1 does wrong.
PHP: header_remove
This function will remove all headers set by PHP, including cookies, session and the X-Powered-By headers.
This is an extremely handy function for serving a stale cache version of a page while generating and storing a fresh response from the server at the same time.
Super Easy Responsive Images with Viewport Cookies
Here is the idea behind the Viewport Cookies:
- first, detect the width of the device viewport using javascript and store its value in a
viewportcookie from within the<head>; - use that cookie in the backend (with Nginx
image_filteror a PHP script) to resize, cache and serve images of appropriate size for that particular viewport.
The great thing about this method is that it doesn’t require any modifications to the image tags and the javascript is kept to the bare minimum.

Part 1: Store the Screen Width in a Cookie Using Javascript
Javascript is the only thing that can detect parameters such as browser window dimensions and device screen size, so we have to use javascript until (and if) browsers start setting this data in HTTP request headers. Read more »
History of Nginx
Igor Sysoev:
In spring 2001 I had written Apache mod_accel that is enhanced replacementof mod_proxy. But it was clear that Apache has low scalability. I had read http://kegel.com/c10k.html, had investigated existent servershttpd, boa, etc. and had decided that I need something like these servers, but with SSI, proxy, and cache support. Also it should has flexible configuration like Apache and supports online upgrade and quick log rotation.
As an aside, I’ve always been a bit curious about the name.
The base for name was NG letters those sounds like en-gee in English (I at least I think so :). X is simply fine letter. But ngx was already used many times. There were some variants – ngnx, nginx and nginex. nginx seemed the better for me and I had look it in Google and found the only quote symbol.
via history of Nginx.
Page Speed Score of 100/100 with WordPress
WordPress can be very fast. Here is the server-side setup for achieving the 97/100 Page Speed score (it is only because of Google Analytics that the score is not 100/100): Read more »
Enable WordPress Plugin, Theme Updates and Pretty Permalinks on Nginx
WordPress doesn’t know that your Nginx web server is capable of doing URL rewrites without mod_rewrite and Apache, so we explain that by adding:
add_filter('got_rewrite', 'nginx_has_rewrites');
function nginx_has_rewrites() {
return true;
}
in your theme’s functions.php.
It is very likely that along Nginx you are also running PHP-FPM for all your PHP needs, and for some reason WordPress thinks its PHP process can’t write to disk. We tell WordPress that it can:
add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
return 'direct';
}
Page 1 of 3


