Feb 11 2012
Feb 11

Acquia Insight

Posted on: Saturday, February 11th 2012 by Brandon Tate

Site performance is usually something developed on a per issue basis. Meaning, your site was popular but your code couldn’t handle the popularity! Thankfully, Acquia Dev Cloud and Managed hosting options provide a pretty neat little tool that can help you out with site performance and SEO. It’s called Acquia Insight. The information provided is broken down into two areas called SEO Grader and Insight.

SEO Grader

An area that is commonly overlooked when creating a site is how well your site performs in the SEO world. Once you log into the Acquia Network there will be a link on the left hand side called “SEO Grader”. Clicking this will take you to the overview page that gives you brief look at how your site is doing. If you have any critical issues with your site, you’ll see them here with an exclamation mark beside it. Clicking the “Analysis” link under the SEO Grader menu will give you a more in depth look. Here is it broken down into sections called Page Structure, Crawlability, Findability, User Experiences and Best Practices. Each section will list issues with your site and each issue has a problem explanation and solution provided so not only do you understand why its effecting your site, you also understand how to fix it. As well, each issue has the ability to be ignored since not everything listed will be relevant to your site.

Insight

As a developer, the insight section is very helpful since it gives me an overall look at my sites performance in terms of code, server configuration and MySQL statistics. Once logged into the Acquia Network there is a link for “Insight”, clicking this gives you an overview page with your overall score as well as access to the Code, Server and Statistics information pages from here.

The Code section allows you to see every module you have installed on your site and the files it contains. If any files within a module have been modified you can click into that module and see a code level diff view of the file which allows you to identify any possible problems. The Server section gives you an overview of the PHP information and server. The Statistics section provides you with MySQL statistics that allows you to see things like your cache hit ratio, queries in cache, slow queries etc. Each statistic here has information as to what the stat is relating to and a possible solution if the stat is on the wrong side of the fence. For instance, if your slow queries number is high, you can view the MySQL slow queries log on the server and fix the queries that were slowing your site down.

If you click the “Analysis” link under the Insight menu, you can access the Performance, Security and Best Practices sections. As with the SEO Grader, you can access a list of issues with your site and each issue has a problem / solution provided to help you out.

Email Alerts

Acquia Insight allows you to receive emails concerning Performance, Security or SEO issues as they arise. This is helpful since you can’t always be checking in on your site as it lives out its life cycle. Acquia provides a slider tool to configure which emails you receive (Critical, Warning, Notice or All)

Lifecycle

Over time the performance of a site can degrade and issues can arise from use. Normally, if your not keeping watch these degradation issues will occur at the worst times and usually wreak havoc for a live site. With Insight, it provides a graphical view of your Insight score which allows you to foresee issues as they can occur over time.

Best Practices

I really enjoy the fact that Insight allows you to become a better developer since it provides best practices and highlights issues with problems / solutions. So overtime you’ll notice your sites will perform better out of the box because you’ve been learning from this helpful tool and implementing these solutions beforehand.

Conclusion

Overall I enjoy Acquia Insight and all its capabilities. It provides helpful information and allows you to monitor, troubleshoot and tune for optimal performance. If that isn't enough for you and you want more information about your sites performance, Acquia has another service available with New Relic that provides an extensive web monitoring and management tool that can be easily setup through the Acquia Network interface as well.

Jan 03 2012
Jan 03

Tips for Acquia Hosting Development

Posted on: Tuesday, January 3rd 2012 by Brandon Tate

Here at Appnovation, we frequently use the Acquia hosting platform for our clients. The Dev Cloud and Managed Cloud are impressive platforms that fit well for many Drupal sites being built today. I’ve listed some items below that have helped with the overall build quality and ease of use for these platforms.

Utilities - Drush aliases

Anyone who develops with Drupal should know about Drush by now. Acquia has gone ahead and installed Drush and the Drush aliases on your Acquia Hosting account automatically. For example, you can run the command “drush @sitename.stg cc all” from your local computer to clear all the caches within the Drupal site without having to log into the server for it to work! You can find the aliases under Sites > Managed (or Dev) Cloud > Utilities. After downloading the file to your $HOME/.drush/ directory and setting up an SSH key, you're good to go.

Enabling Git

Acquia uses SVN as its primary repository system. However, some of us like to use Git for its enhanced speed over SVN. Not a problem since Acquia supports both. Switching to Git is easy and can be found under Sites > Dev Cloud > Workflow. At the top of the page you’ll find an SVN URL by default with a gear icon located next to it. If you click that icon a drop down will appear and the option to switch to Git will be displayed. Simply click this link and your repository will switch from SVN to Git. For Managed Cloud platforms, you just have to request Git by filing a support ticket through Acquia and they will switch it for you.

Pressflow

Acquia Dev Cloud and Managed Cloud implement Varnish to speed things up. To take advantage of this I recommend you use Pressflow. The installation and setup is the exact same as Drupal and Pressflow is 100% compatible with Drupal core modules. There are some issues with contrib modules, so make sure you check the functionality of these modules before assuming they work. Once Pressflow is installed and setup on the Acquia server, you’ll notice you have a new option under Performance called “external”. This allows Varnish to handle caching instead of Drupal’s stock functionality.

Mobile sites and Varnish

I recently worked on a site that was using Varnish to speed up the performance. The site was also configured to use a different theme when a mobile device was detected. I was using the global variable $custom_theme to switch the theme when a mobile device was found. However, when this solution was implemented with Varnish we noticed that sometimes the mobile site would get served to a desktop browser and vice versa. The problem was that Varnish was caching the page and not hitting the code to determine if the device was mobile or not. To correct this, we needed to switch from using the global $custom_theme variable to using Drupal’s multi-site folder architecture. To do this, you need to add a mobile site folder (m.domainname.com) to the sites directory within Drupal. Then within the settings.php file add the following line.

$conf = array('theme_default' => 'mobile_theme');

This will force the site to use the mobile theme. Next, you’ll have to add the domain to the Acquia Hosting platform which is located under Sites > Managed (or Dev Cloud) > Domains. After that, you’ll have to get in contact with Acquia support so that they can configure Varnish to detect mobile devices and redirect to the correct sites folder.

Memcache setup

Memcache is another technology that speeds up the performance of Drupal. To enable this, you must download the Memcache module from Drupal.org. After this, you can add the following lines into your settings.php file.

if (!empty($conf['acquia_hosting_site_info']) && !empty($conf['memcache_servers'])) {
  $conf['cache_inc'] = './sites/all/modules/contrib/memcache/memcache.inc';
  $conf['memcache_key_prefix'] = 'domainname';
  $conf['memcache_bins'] = array(
    'cache' => 'default',
  );
}

First, I’d like to point out the memcache_key_prefix which must be unique across the different environments such as development to production. This prevents the cache tables from overwriting each other. Next, the memcache_bins key allows you to cache specific cache tables from Drupal. In the example above, I’ve left it to "default" but you could cache specific tables such as views, blocks etc.

Workflow - Lock out the files folder

Acquia has a drag and drop interface that allows the developer to drag the codebase, files and database between development, staging and production environments. This allows you to easily migrate your site between any of the servers. One thing I want to point out is, once your site is on the production server, its a good idea to lock the environment by setting it to Production Mode. This prevents the files directory and database from being overwritten and also allows you to pre-release the site to the client, allowing them to add content while you update the code base. To do this, go to Sites > Managed (or Dev) Cloud > Workflow. There will be a “Prod” section with a gear beside it, clicking that gear will provide a link to switch the site to Production Mode. This can be easily reverted as well by clicking the gear and reverting the site to Pre-Launch mode.

Those are some tips that I’ve discovered over my use of Acquia that have eased the development and deployment of a Drupal site on their hosting platforms. If you have any questions or tips of your own, feel free to comment.

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web