Performance Optimization for Drupal

How to Optimize Your Drupal 7 Website Performance

Devel Module to the Rescue:


Slow Query Monitoring:


  1. Slow query is the type of SQL query that takes more time to execute. These types of queries can be optimized to increase the performance of the site.
  2. To do this, enable the devel module and goto the admin/config/devel and enable the slow query option.
  3. This option will display all the SQL queries made for every page request and the most time consuming queries will be highlighted.
  4. We can then identify them in all the pages of the site and optimize them.


XHPROF Profiling:


  1. Another option available in the devel module settings page is the xhprof profiling.
  2. This profiling will give a detailed report on the whole performance of the site. Xhprof profiling is a high level profiling and is recommended only for advanced users as the wrong usage may affect the site behavior.
  3. This option in not available at the go itself, you have to make some server side installations. For further queries, Please look into this link


Other features include:


  1. Display page execution time in the query log box.
  2. Display memory usage
  3. Display redirection page
  4. Display page array Variable


*** All devel module settings must be used for development purpose only and must be disabled after usage.


Drupal 7 Optimization



Image Optimization:


  1. The type of image format we are using can also affect the performance of the site as they can take time to load, based on the format.
  2. Usage of modern formats like .png or .jpg are highly recommended.
  3. Another point to note is the size of the images. Size of images that don’t need to be of high quality can be reduced to bare minimum for faster loading.
  4. Video format can also be changed to modern formats if your site uses videos


Site Cache:


  1. Caching is the method of saving requests in the server and serving from that saved data instead of hitting the DB for every request, which can reduce the performance of the site.
  2. Basic level of caching can be done in the admin/config/performance page where we can enable caching for the anonymous users who will usually be seeing the same pages of the site and not dynamic pages.
  3. The cache retention time can also be specified here, which can be used to delete the cache periodically without human intervention.
  4. Advanced level of caching can include using different services in the server level to cache the pages.
  5. Services like Varnish and Pound can be installed in the server level and used to improve the site performance.
  6. Caching systems can be a boon in cases of sites that have most of the content that don’t change over time.
  7. Minifying the CSS and JS using some module of your choice will also improve the speed of the site.
  8. Upgrading to the latest version of bootstrap and also using newer technologies for styling like SASS can also improve the performance of the site.

Search Optimization:


  1. Nowadays, all sites have inbuilt search in them. If your site uses search as an important feature, then we can use apache SOLR instead of the inbuilt default Drupal search.
  2. This will reduce the amount of load on the DB as user searches will not hit the DB directly. This will also improve the autocomplete of the searches.
  3. You can install the Apache SOLR module to leverage the SOLR abilities. This also needs some backend work like install tomcat and apache solr in the server and correctly configuring them.
  4. This will index the whole site and help make the search faster.


Other Methods:


We can also implement Lazy loading in the site to make sure the skeleton comes first instead of loading it fully on one go. This method is being used by Facebook that makes the site load faster.

Things You Should Know About Drupal Security to Ironclad Your Website from Attacks


Contributed By:

Anand Kumar

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge