To help you get started with your new Drupal website and to avoid several configuration or performance issues, use the following suggestions, recommended settings, and information as a prelaunch checklist for your website.
These suggestions apply to all versions of Drupal unless otherwise specified.
- Depending on your hosting platform, enable and use Memcached. * Using Memcached moves cache objects into memory rather than on disk, which is faster. For more information about using Memcached with Acquia Cloud, see Using Memcached.
- Install and enable the following modules based on your needs:
- Redirect module - Helps to prevent using too many path redirects in the
.htaccess
file. Because path redirects need to be loaded at run time for every page request, having too many redirects can cause problems with Apache performance. - Syslog core module * - Stores logs much faster than the Database logging core module.
- Transliteration module - Converts special characters in filenames to ASCII.
- Redirect module - Helps to prevent using too many path redirects in the
- Disable or uninstall the following modules or classes of modules:
- Boost module. This module can conflict with Varnish caching and is not needed in most cases.
- Database logging core module * The Syslog core module can store logs much faster, because it does not need to write to the database.
- PHP Filter core module *
- Server-side statistics modules. Instead, use client-side statistics services, such as Google Analytics or Omniture.
- Unneeded modules. Removing these modules reduces the website's startup (bootstrap) overhead. Modules such as the Devel module and views_ui (part of the Views module) are not necessary in Production.
- On the Admin >> Performance page, configure or enable the following values:
- Enable page caching for anonymous website visitors. Drupal 8 does this by default. *
D7: Caching section > Cache pages for anonymous users check box
- Ensure that block caching is enabled. Drupal 8 handles this in the Cache API: *
D7: Caching section > Cache blocks check box
- Set the amount of time that cached pages won't be re-created to
none
. *D7 & D8: Caching section > Minimum cache lifetime list
- Set the maximum amount of time that an external cache can use an old version of a page to greater than or equal to 1 hour or more. *
D7: Caching section > Expiration of cached pages list
- Enable CSS aggregation. *
D7 & D8: Bandwidth Optimization section > Aggregate and compress CSS files check box
- Enable JavaScript aggregation. *
D7 & D8: Bandwidth Optimization section > Aggregate JavaScript files check box
- Enable page caching for anonymous website visitors. Drupal 8 does this by default. *
- For the Views and Panels modules, check the views content caches, time-based caches, and panels caches. *
- Enable fast 404 for your website. This reduces the level of bootstrap required to serve static assets that don't exist.
- Do not override the PHP memory limit on a global basis. Overriding it will cause your application to skip spawn, which leads to 500 errors for users. Acquia tunes its servers to use the exact number PHP memory you have configured. Conditionally overriding the memory limit for certain administration pages can sometimes be acceptable.
- Use the Acquia Search service, which removes search load from MySQL and offers feature and usability improvements.
- Ensure that you're using InnoDB as your website's table engine.
Although InnoDB is now the default for Drupal, you should confirm that you're using it instead of the MyISAM table engine, which has performance problems.
To examine your current database tables to determine if any other engines are in use, use the following SQL query (where
[db_name]
is your database's name):SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '[db_name]' AND ENGINE <> 'InnoDB'
Convert the any tables found by the command to InnoDB.
-
Password protect your non-Production environment. HTTP authentication is not a viable solution for the Production environment, because it prevents Varnish from being able to cache static pages.
-
Avoid putting all user files in the same directory, as this can cause serious performance problems. Instead, proactively set your file fields to use paths.
Additional resources
The Acquia Help Center includes several other articles that may be helpful to you as you configure your new Drupal website, including the following:
- Caching overview
- Best practices for a fully SSL-protected site
- Preparing your site for Acquia Cloud
- Preparing for a high-traffic event