Neil Turner's Blog

Blogging about technology and randomness since 2002

Stopping trackback timeouts – at both ends

Ever sick and tired of having trackback pings timeout when you ping other people’s entries? Or do you hate having to clear up after people who inadvertently send you multiple pings? Well, read on, for I shall hopefully have some solutions for you.

1. Lengthening the ping timeout

By default, Movable Type decides that a blog has ‘timed out’ if it has sent a ping and not received a response after 15 seconds. Normally this is sufficient, but not always. If you don’t mind the pinging part of posting entries occasionally taking a little longer, then you can lengthen the timeout period to allow slower servers to respond. You’ll need to edit your mt.cfg file, by finding a line that reads “# PingTimeout 20” and removing the ‘#’ from the beginning. This will adjust the timeout to 20 seconds instead of 15, and you can change the 20 to any other value to allow for even longer. In my experience, however, 20 seconds is usually fine.

2. Turning off trackback autodiscovery

This should alleviate the multiple trackbacks problem. As far as I can tell, if you send a ping but MT doesn’t receive a reply in a timely fashion, it will assume it the ping never arrived originally. So, the next time you rebuild the entry, if you have autodiscovery turned on, the ping will be sent again. This would be fine if it weren’t for the fact that the ping usually does arrive and is processed, but the server isn’t able to respond in the 15 seconds that the client wants. It’s better to have autodiscovery off, and then just entering the trackback URL manually, since only one ping will be sent. You can always check to see if it worked by refreshing the page you were trying to ping – if it shows up then it worked.

3. Optimising your rebuilds

If your rebuilds take a long time, then so will responses to trackback pings. There is no one surefire solution to this, but I can suggest the following:

  • Make sure your RSD and stylesheet files are not being rebuilt with the other index files – the RSD file only needs rebuilding when you upgrade MT to a new version, and the stylesheet only needs rebuilding when you change it. This also applies to other indexes – for example my search page is an MT template but it is not automatically rebuilt.
  • Avoid using hundreds of plugins, particularly big ones that require lots of processing time. Doing certain things with MTWordStats can slow your blog down, particularly if you ask it to count how many words you have in your entire blog.
  • Install Sean Wilson’s MT Rebuild Type Mod – a hack for MT which gives you greater control over what indexes are rebuilt. Normally, all indexes that are allowed to be rebuilt will be regenerated every time an entry is posted, but also when a trackback ping is received and when a comment is posted. In some cases, such as your RSS feeds, you may only want the feed to be rebuilt when an entry is posted, and not when the blog is pinged, and this hack lets you configure that. Since I last mentioned it, it has been updated to support MT 2.65 and MT-Blacklist.

You may also find some useful tips in this post by Christoph C. Cemper: Performance Tuning Movable Type.
If anyone has any more ideas, post a comment, or… errr… send a trackback ping.

Comments are closed.