Drupal Profiling with XHProf on Ubuntu 11.10 + Memcached and Varnish
-
Install memcached, varnish, and xhprof
sudo apt-get install memcached
sudo apt-get install php5-memcached
sudo apt-get install varnish
sudo pecl install php-xhprof -
Install xhprof front-end
cd /var/www
git clone https://github.com/facebook/xhprof.git -
Configure Apache and Varnish ports
sudo vim /etc/apache2/ports.conf ; // Change 80 to 8080
sudo vim /etc/apache2/sites-available/default // Change 80 to 8080
sudo vim /etc/default/varnish // Change 6081 to 80 -
[Re]start services
sudo service memcached start
sudo service varnishd start
sudo service apache2 restart -
Download and install memcache, varnish (and devel) drupal modules:
drush dl memcache varnish devel -y
-
Configure Drupal for Memcached
sudo vim .../sites/site/settings.php:
$conf['cache_inc'] = '/path/to/memcache/module/cache.inc';
Configure settings at /admin/settings/memcache -
Configure Drupal for Varnish
Get contents of /etc/varnish/secret and settings from /etc/default/varnish
Enter them at /admin/settings/varnish. -
Configure Devel module for XHprof integration:
Enable XHprof integration (checkbox).
Enter path to xhprof and xhprof_html at /admin/settings/devel.
Now see XHProf output link at bottom of pages.
Resources
- Steve Oliver's blog
- Login to post comments
