Blog Post

Improve bbPress performance with Booster

Booster is part of the GD bbPress Toolbox Pro plugin since version 7.0, and it aims to significantly improve database query performance for many bbPress features, regardless of the forum size.

In bbPress, a lot of data is stored in the postmeta table. The postmeta table is used in many important queries, which brings down the overall performance because postmeta queries are slow due to the inability to index the data in the postmeta table because the meta_value column in that table is type LONGTEXT so it can hold a large amount of data of any type, making it non-indexable. This problem with postmeta queries is worse the bigger the website is.

There are two types of postmeta queries: queries that only use meta_key to find something and queries that join or search meta_value. The first type of queries is fine; they are fast because meta_key is indexed. But the second one is a problem because meta_value can’t be indexed, and bbPress has many queries relying on that column to match forums, order topics, and do other stuff. Booster aims to optimize this type of query.

Booster is one of the 50+ major features in the GD bbPress Toolbox Pro plugin. It can speed up bbPress core performance and the performance of GD bbPress Toolbox Pro features that rely on the postmeta to work.

How does Booster work?

Booster is based on using additional database tables with indexed forums, topics, and reply data. It will take a lot of data related to forums from the postmeta table and write it into the specialized tables where all the data has proper types and is fully indexed on all columns used for query joins. And to take advantage of the index tables, Booster monitors queries in bbPress; when it detects a query it can optimize and modify, that query will be modified to use index tables instead of a postmeta table. Finally, Booster is hooked into many bbPress actions and filters and will modify index data when needed. Index tables can be deleted at any time and recreated because the data is still stored in postmeta. Booster doesn’t affect the way bbPress stores the data. Data is still stored in postmeta and available from there. Booster is making a copy of the data into its own index tables.

Booster Settings

The other way Booster is used is by directly replacing queries used by GD bbPress Toolbox Pro features. Plugin has ‘Classic’ and ‘Boosted’ query generators for comparable queries. If the Booster is inactive, Classic queries will be run (these depend on the postmeta table); if the Booster is active, Booster queries will be run instead.

You can stop using Booster at any time, and you will not lose any data; any time you want to use it, you must make sure you run the process to rebuild the index tables. Currently, Booster settings have few controls, but that will be expanded in the future for more control. The supported queries for GD bbPress Toolbox Pro features are always boosted; if the Booster is active, there are no options to control that. More settings are coming in the future versions, and more postmeta data will be mirrored inside the index tables.

What are the Booster performance gains?

That will depend on several factors, like the website database size, forum size, and features in use. Web server speed is also a factor, but relative gains will be roughly the same. So, the results presented here will be relative speed difference.

Currently, Booster will optimize only bbPress queries that depend on the postmeta table and queries related to various GD bbPress Toolbox Pro features depending on the postmeta table. Approximately 20 different SQL queries are optimized by the Booster. The number of optimized queries will be expanded with the future plugin versions.

The results here are from the main Dev4Press Support forum. As an example, there are two pages measured. Many GD bbPress Toolbox Pro features are active, including Online and Activity tracking, Attachments, Private Topics and Replies, and more. Many of these features require postmeta queries by default, and they have a huge benefit from using Booster.

All the measurements are done using our own DebugPress plugin. DebugPress is a free plugin and is available in the plugins repository.

Logged-in user, single forum

This first example is for this page: This example shows Booster’s optimization for the page, where 28 queries can be optimized.

Booster is OFF
Booster is Inactive.

28 Queries are affected and run through the Classic query generator. It takes 0.4 seconds to run those queries, which takes 92% of the total query time for this page.

Booster is ON
Booster is now ACTIVE.

With Booster active, these 28 queries are run through the Booster query generator. And it takes only 0.0019 seconds to run those queries, or only 5% of the total query time for this page!

This is quite a change, and the query time goes from 0.4 seconds down to 0.0019 seconds, which is 99% faster!

Logged-out user, list of all topics

The second example is for this page: This is the page listing all the topics by last activity time. We are showing this page for logged-out users (or visitors) because it demonstrates two things: replacing the ordering part of the query from postmeta to the index table and replacing filtering out of the private and hidden forums from the query from postmeta to the index table. The focus is on the main bbPress query used to generate this page results.

Booster is OFF
Booster is Inactive.

The 2 main queries used by WordPress and bbPress take 0.14645 seconds and take almost 80% of total page SQL time.

Booster is ON
Booster is now ACTIVE.

With Booster active, these 2 queries take 0.0062 seconds; this time, they take only 18% of total page SQL time.

But, there are actually 2 queries, quite similar, run by the WordPress and bbPress here. WordPress runs the first one before bbPress has started rendering – this is the main page query, and this one only filters out forums. But, again, where the bbPress takes over, it runs a second query, similar to the first, but now with the ordering by the last activity. This is how bbPress works; the main query is executed twice on almost every page.

As you can see, without Booster, the page needs 0.184 seconds to run all the queries. After the Booster activation, that time goes down to 0.035 seconds. That is 80% faster!

What is the downside of using Booster?

Well, there are two downsides. But both are small sacrifices for the huge performance gains they will provide you. The first one is the existence of the duplicated data. A lot of data in postmeta tables will need to be copied into dedicated index tables. For the website with 10 GB of data taken by postmeta and the posts table (and about 2 million topics and replies), the index for the forums, topics, and replies will take about 300 MB. That is about 3% of the extra space needed. For the Dev4Press Support forum, with about 15000 posts in the forum, index tables are only 1.5 MB (or 4% of the total postmeta and posts tables). Not much.

The other downside is that whenever a forum, topic, or reply is created or updated, Booster needs to run a few additional queries to update the index for the affected posts. BbPress typically needs to run about 15 to 20 queries to create a topic (and update many other things), and Booster will add up to 4 (very fast) queries to update the index. The booster will add about 10% in query time when measured in the actual time needed. And again, considering the benefits, there is not much overhead, and it is not a big deal.

Booster Statistics panel

What other performance benefits does GD bbPress Toolbox Pro bring?

Well, GD bbPress Toolbox Pro has over 50 major features, with over 600 options, and it includes several other behind-the-scenes performance updates for the bbPress forums that rely on using caching, replacement of the forum widgets with enhanced versions that have caching enabled, and more. The overall goal is to minimize the number of SQL queries and to optimize the execution where possible with various cache methods, Booster index, and more in the future.

What’s next for the Booster?

Work on the Booster continues, and the next plugin version (GD bbPress Toolbox Pro 7.4) is scheduled for the end of this year, with plans to add more postmeta data into index tables, improve the update process and add several more queries to the Booster processing.

How can you have Booster on your website?

You need to get the latest version of the GD bbPress Toolbox Pro plugin, install it, and enable the Booster feature. Booster will run initial indexing; after that, many queries will be optimized. You can get the GD bbPress Toolbox Pro plugin license or the bbPress Plugins Club License (and get 5 more premium bbPress plugins), and you will be set. For the next 2 weeks, you can take advantage of the discount promotion.

Please wait...

About the author

Milan Petrovic
Milan Petrovic

CEO and Lead developer of Dev4Press Web Development company, working with WordPress since 2008, first as a freelancer, later founding own development company. Author of more than 250 plugins and more than 20 themes.

Subscribe to Dev4Press Newsletter

Get the latest announcements, release digests, promotions and exclusive discounts, and general Dev4Press-related news straight into your mailbox.

This form collects your email (optionally your name) for the purpose of sending you newsletters. Check out our Privacy Policy for more information on how we store and manage your data. We will not send you any spam. Newsletters are sent 2 to 4 times every month.

Latest From The Blog

license management

License Code Validation and Management

Dev4Press License validation system updates will soon be deployed, including license code management via the Dev4Press Account Dashboard. All updates will be deployed on April 14, 2024.
panel options

In Development: SweepPress Pro 5.0 and Lite 3.0

In about two weeks, brand new, significant updates to SweepPress Pro and Lite plugins will be released, bringing several game-changing features to WordPress cleanup and maintenance tools already included.

GD Press Tools Pro 6.3

The new major release for GD Press Tools Pro, version 6.2 is here, and it brings some major changes. First of all, the plugin has two addons less, one addon is added and one more addon has been deprecated (but still included for now).

Leave a Comment

GeneratePress - The perfect lightweight theme for your next project
WP Rocket - Make WordPress Load Fast in a Few Clicks