Textpattern

Return to main site

Related

Frequently Asked Questions

Diagnosing performance problems

Normally, Textpattern is one of the fastest CMS platforms around.

However, there are a few circumstances that can cause performance issues. If you’re experiencing slow page loading, here are some things to check:

Runtime vs. Display Time

Textpattern records the time it takes to generate and send each page. You can check the “runtime” figure to distinguish between slowdowns during page generation, and those that occur afterwards (i.e. during page rendering).

In admin > preferences, set Production Status to Testing. Load a Textpattern page, view the HTML source, and scroll to the bottom. You should see a comment block that looks something like this:

<!-- Runtime: 0.1316 <del>->
<!</del>- Queries: 21 <del>->
<!</del>- Memory: 1988Kb -->

The figures will vary according to your server, page templates, and so on. On a properly configured web server with a normal load and typical Textpattern templates and content, expected ranges are as follows:

Please note that these are approximate ranges – a Runtime of 0.6 or 0.7 is on the high side, but not necessarily cause for alarm if your page templates are complex. Also bear in mind that the figures will be different for each page load, and will vary due to external factors like the traffic load on your web server. Try loading the page several times over a period of a few minutes and compare the results. A one-off anomaly probably means a temporarily overloaded server or network.

If you’re experiencing consistently high numbers, here are some things to check.

Runtime

A runtime figure that regularly measures 1 second or more usually indicates one of two things:

Other MySQL performance problems can be harder to diagnose. An overloaded MySQL server can slow down Textpattern – ask your hosting company if this could be the case.

Queries and Memory

A high number of queries, or excessive memory usage, is usually caused by a plugin or custom PHP code. As above, try disabling this code to see if it makes a difference. Plugins that produce a list of articles are the most likely culprits: some popular “archive” plugins are very inefficient, loading the entire database of articles into memory at once. For an efficient method of displaying an archive list of articles, see here.

Page rendering

If your Runtime, Queries and Memory figures are all in or near the normal limits, but you’re still experiencing slow page loading, the problem is almost certainly caused by the content of your page. Some things to check:

Improving performance

There are a number of articles around about improving Textpattern’s performance. Not all of this is good advice – many are outdated, some disable important features for no measurable benefit, and a few suggested techniques can acutally result in worse performance.

If your Runtime/Queries/Memory figures are within normal limits, but you’d like to improve performance, here are the best methods to use:

The important thing with any performance tweak is to change only one thing at a time, and always measure the results. If something has no real effect, change it back and try something else. You’ll almost certainly find that one or two changes will have a large effect, while others will be insignificant.

Posted 6 November 2005, 00:44 by Alex Shiels

---