One of our client website uses Joomla. The site gained quickly in popularity, and bandwidth usage grew rapidly. We added more servers and
bandwidth for the customer, as far as we can, limited by his budget. Eventually, the site hit a bottleneck in how Joomla uses the mysql
database. There were just too many updates, and queries going on, and with updates locking the database, the site will slow down to a crawl.
Surprisingly, changing the table from myisam to innodb didn't help; the idea being innodb wouldn't lock the table. Eventually, we
identified the event that triggers the site to slow down. Interestingly, adding new articles causes as many updates as there are articles
in the database table. If there are 5000 articles, there are 5000 updates. Why would adding 1 article cause 5000 updates. Looking at the
code, I found the cause to be the way articles are sorted in Joomla.
updateOrder in database.php has a for loop which goes through each record to be reordered and adds 1 to the ordering.
This was for Joomla 1.0.x; Hopefully, 1.5.x does it differently.
I couldn't find mention of this using google; so hopefully this entry can help someone else having the problem.
One workaround would be to disable the ordering, and use order by date in the frontpage display, rather than order by sorting.
Lim Wee Cheong
08 Jun 2008