Informative articles on various technologies ...

Site slow because of img_assist module and how to solve it

A client with a Drupal web site that is growing too fast asked us to assist with performance problems they were experiencing. Pages would take too long to load.

Upon closer examination, we saw that certain pages were taking up to 6 seconds to load. Using the devel module we found the following picture:

Executed 314 queries in 3198.5 milliseconds. Page execution time was 6280.94 ms.

This means that the database was bogged down, and there is some overhead in PHP as well.

Bottleneck: Replacing taxonomy_term_count_nodes in taxonomy_dhtml

Here is a case study where a module caused extremely poor performance on a site with heavy traffic.

Background

A client with an ever growing site contacted us for some emergency diagnosis and tuning. The site took a long time to respond, and it was not showing any pages to visitors

Diagnosis

Upon investigation we found that the node table has 27007 rows, while the term_node table has 126419. Not specially huge, but still sizeable.

Server indigestion: The Drupal contributed modules "open buffet binge" syndrome

Often times, I call contributed modules the "open buffet" of Drupal. As opposed to a la carte. In an open buffet, you pay a fixed price, and eat all you can. In an a la carte restaurant, you order each item and pay for them separately.

Each method has its pros and cons, but today we will discuss how an open buffet can cause binge eating, indigestion and other undesirable consequences.

We compare two sites. One is minimal Drupal install, with a few modules enabled, and another bloated site with too many modules.

Creating nodes using mini-forms anywhere

Recently a client needed to have a mini form for creating specific types of nodes on the fly from anywhere on the site. So, instead of the user clicking "Create content" then "foo" then filling in the form, then clicking submit, a form for that type of content will be shown on most pages in a block in the side bar. So, they can create that type of node quickly.

There are two ways to do this:

Benchmarking Drupal from the shell command line

Sometimes, you are trying to find a bottleneck in Drupal, and after broadly knowing where the problem might be, you reach a point where you want to benchmark something specific and granular.

For this kind of benchmarks, you can write a standalone script and run it from the command line.

For this you need PHP to be available in CLI mode (Command Line Interface) on your platform.

Here is an example to benchmark the impact of converting the node table from MyISAM to InnoDB.

Changing your RSS feed to include image node thumbnails

A site we worked on wanted to have the thumbnails for image nodes to be included in the RSS feed, so subcribers can get a preview of what the image is like before clicking.

So, using the 'rss item' $op to hook_nodeapi, we were able to do this in a relatively simple way, with no need to modify either Drupal's core nor the image module.

This article applies to Drupal 5.x, but may also be adapted to 4.7 and 6.x.

Pages

Is your Drupal or Backdrop CMS site slow?
Is it suffering from server resources shortages?
Is it experiencing outages?
Contact us for Drupal or Backdrop CMS Performance Optimization and Tuning Consulting