BuddyBoss performance optimization - 🏆 Managed Server
June 17 2024

Optimizing BuddyBoss performance

When server-side system optimization isn't enough to solve performance problems. The BuddyBoss case of one of our clients and the analysis with Application Performance Monitoring.

BuddyBoss Banner

Today, website performance is critical to ensuring a smooth and engaging user experience. BuddyBoss, a powerful platform for building WordPress-based online communities, is no exception. Optimizing BuddyBoss performance can make the difference between a slow site and a responsive one, improving your search engine rankings and increasing user satisfaction. In this article, we'll explore our ByddyBoss optimization service to boost the speed and efficiency of BuddyBoss, ensuring your site always delivers peak performance.

What is BuddyBoss?

BuddyBoss is a robust and flexible platform designed to create and manage online communities, e-learning courses, and membership sites. Based on WordPress, BuddyBoss offers a wide range of features that facilitate interaction between users, such as forums, groups, custom profiles, and private messaging. Thanks to its seamless integration with popular plugins and themes, BuddyBoss allows you to easily extend your site's capabilities, making it an ideal solution for educators, entrepreneurs and content creators. Whether building a social network for a niche group or developing a comprehensive educational portal, BuddyBoss offers the tools you need to create an engaging and dynamic user experience. Furthermore, the platform provides a secure and customizable environment, encouraging collaboration and knowledge sharing. For more details, visit the official BuddyBoss website , here.

Community-WordPress-Themes-BuddyBoss

Requirements for BuddyBoss

To ensure optimal functioning of BuddyBoss, it is essential to have an adequate server configuration, especially based on the number of subscribers. BuddyBoss is a resource-intensive software, requiring significant CPU and RAM power. For communities with fewer than 1.000 members, BuddyBoss on the official website recommends a server with at least 4 GB of RAM and a multi-core CPU. For sites with 1.000-10.000 subscribers, it is preferable to have at least 8 GB of RAM and a high-performance CPU. For larger communities, over 10.000 members, you need to consider dedicated or cloud server solutions with at least 16 GB of RAM and high-end CPU.

However, it is clear that the hardware requirements indicated by the manufacturer are anecdotally undersized, perhaps because in the initial analysis phase, which is also the pre-sales phase, if technically greater, well-sized and therefore more expensive solutions were indicated, it could present a deterrent to purchase of the plugin and therefore it is commercially more advantageous to mention economic solutions initially, finalize the sale and only then put the buyer face to face with reality in terms of load and hardware resources.

A concrete example of these needs comes from one of our clients (protected by NDA) who manages a community of 10.000 users, integrating various features of BuddyBoss with LearnDash (LearnDash is a powerful plugin for WordPress that allows you to create and sell online courses, offering functionalities advanced features such as quizzes, certificates and user progress). To support this complex configuration and guarantee a fluid user experience, the solution adopted was to use a server with 32 cores and 64 threads, 128 GB of RAM and 2 NVMe SSD disks in RAID 1.

Server-for-BuddyBoss-32-core-64-threads

This advanced configuration is necessary because BuddyBoss, by requiring users to log in to its private area, does not allow the use of standard caching techniques such as WP Rocket or Full Page Cache plugins such as Varnish, which would be completely useless for logged in users. This implies that the server configuration must be optimized to handle high dynamic loads, always ensuring fast response and a smooth user experience even under high stress.

The uselessness of Cache plugins, Server Side Caches and official advice.

When it comes to optimizing the performance of BuddyBoss, it is important to understand that using common caching plugins and server-side caches can be completely ineffective. Plugins like WP Fastest Cache, SuperCache, WP Rocket, and W3 Total Cache are powerful tools for many WordPress sites, as they allow you to reduce page loading times by storing static versions of them. Likewise, server-side caching solutions such as Varnish Cache and NGINX Proxy Cache are frequently used to improve the overall performance of web applications. However, BuddyBoss has a distinctive feature that complicates the use of these techniques: the need for users to be logged into their private area.

When a user is logged in, each page viewed is highly personalized and dynamic, containing information specific to that user, such as notifications, messages, recent activity and much more. This means that Full Page Cache techniques, which store static versions of pages to speed up loading, cannot be used effectively. The caching solutions mentioned above, which work well for static content, become useless in a context where each request to the server must be processed uniquely.

As a result, to ensure optimal performance with BuddyBoss, you need to invest in powerful hardware and application-level optimization.

The official BuddyBoss advice underlines the importance of optimization at the database and application level rather than relying exclusively on caching solutions, however it is very basic and not very technical advice and the discontent of BuddyBoss users in large communities is always very frequent .

At Managed Server Srl, we therefore wanted to make a performance optimization service available for BuddyBoss, which has as its aim, in addition to the usual optimization for WordPress, also an application approach for optimizing the application performance of BuddyBoss and the adjacent ecosystem, such as WooCommerce, LearnDash, BuddyPress and more or less different plugins that can be used in the building a community with BuddyBoss.

A real case of BuddyBoss optimization

For a few months we have had a new client operating in the training sector with a community of over 10 thousand members, the training offer is created with a combination of plugins such as LearnDash, WooCommerce, UCanTinny, WooCommerce, and many many others. The client visited various hosting and system consultancy providers, however, with the exception of server-side cache, none of them ever focused on the concept previously expressed, that is, that BuddyBoss (as well as all sites that require user login) benefit significantly from the Full Page cache technologies.

It must be said that systems companies do not normally have development skills on staff, and that development companies similarly do not have systems skills. This gap very often tends not to have an overall vision, from the perspective of server-side performance and application performance.

We often end up in a buck-passing situation where the developer claims that the site is slow due to the server and the systems department, and the systems engineer ends up accusing the developer and the application which is terribly slow and poorly optimized.

Passing the buck

If we were to take sides between these two readings, we will certainly be in favor of the systems engineer and not only out of professional closeness and solidarity. It is in fact undeniable that a pachyderm like BuddyBoss does not shine in performance and speed as it is in turn developed on WordPress with slow technologies such as PHP and MySQL rather than the more modern Go, Node.js with perhaps some NOSQL DB such as MongoDB or Cassandra.

However, we must also put ourselves in the shoes of the end customer, who is often not a technician, but an entrepreneur who aims to try to obtain the best possible results with the tools (often chosen by others) that he finds.

In short, what we need to do is to get away from the buck-passing logic in which everyone loses, but try to offer the best server, system and application support in order to obtain the best performance achievable, playing all possible cards and also any aces up the sleeve. .

Powerful, well-sized hardware at affordable costs.

As anticipated, BuddyBoss requires a powerful and well-sized hardware substrate to ensure optimal performance. However, the same hardware configuration can have very different costs depending on the service provider and data center you choose. If you're thinking about installing BuddyBoss on a cloud instance, chances are you have no idea about the significant cost difference between a bare metal instance and a cloud instance with equivalent features. Bare metal instances often offer superior performance at lower costs than their cloud counterparts, especially when considering high resource needs like those required by BuddyBoss.

Even in the case of a dedicated server, it is essential to know where to buy to get the best value for money. It is essential to choose ISO27001 and GDPR Compliant data centers to ensure security and regulatory compliance, without having to spend a fortune. Choosing the right data center not only affects costs, but also the reliability and security of the service.

Our experience, gained since 2005, has allowed us to face numerous professional challenges in the Linux hosting and system engineering sector. Thanks to this vast experience, we are able to select the best datacenter and server-side hardware technologies for your needs, ensuring high performance and security at affordable costs. As independent vendors, we can compare offers and choose the most suitable solutions, avoiding unnecessary surcharges and ensuring that your hardware investment is maximized.

Server-side tuning and optimization.

A well-configured server-side software stack is crucial to ensuring the best performance of BuddyBoss. Choosing the right software and their optimal configuration can make the difference between an average performing site and an exceptionally fast and stable one. For example, there is a noticeable difference between installing a stack with NGINX, PHP-FPM, MariaDB and Varnish in a standard way and configuring the same stack with extensive tuning of the filesystem, database and PHP interpreter to maximize performance.

Optimizing the server stack means going beyond simple software installation. You need to fine-tune the filesystem to improve file handling and I/O, configure the database to optimize query and transaction handling, and tune PHP-FPM to better manage processes and memory. This type of optimization requires in-depth knowledge of how the various components work and how they interact with each other.

We have gained extensive experience in server-side tuning, in particular with the InnoDB and AriaDB engines used by DBMSs such as Percona Server or MariaDB. These database engines, when configured correctly, can deliver significantly higher performance, reducing response times and improving transaction handling capacity. Our experience allows us to optimize these components to get the most out of the available hardware resources, improving the overall speed and stability of the system.

Application Profiling with New Relic (or any other APM)

BuddyBoss application optimization requires an in-depth approach to identify and resolve performance bottlenecks. One of the most effective techniques to achieve this is application profiling using Application Performance Management (APM) tools such as New Relic. New Relic, and other similar APMs, offer a detailed overview of application performance, allowing you to monitor behavior in real time and analyze key metrics.

With New Relic, you can track user requests and view how each component of the system responds. This tool provides crucial information about the performance of your server, database and application code, highlighting areas that need improvement. For example, New Relic can help identify slow SQL queries, inefficient PHP functions, or third-party components that negatively impact response times.

For BuddyBoss, where every request from logged in users must be processed dynamically, the use of an APM is essential. New Relic allows you to identify database queries that cause slowdowns, monitor AJAX calls, and understand which parts of the code consume the most CPU and memory resources. This data allows system administrators and developers to make informed decisions to optimize code, improve database configuration, and adjust server resources.

New-Relic-BuddyBoss

A concrete example could be reducing the loading times of user profile pages in BuddyBoss. Through profiling with New Relic, you may find that a particular SQL query takes too long to execute. With this information, you can optimize the query, add appropriate indexes, or redesign the database structure to improve performance.

Furthermore, New Relic allows you to set custom alerts that immediately notify you when application performance degrades, allowing timely interventions to resolve problems before they negatively impact the user experience. This proactivity is crucial to maintaining a high level of user satisfaction in a complex platform like BuddyBoss.

The results achieved after analyzing and optimizing the BuddyBoss installation

We must start by saying that it is not standard practice for us systems engineers with application skills to port a WordPress or PHP application to an APM like New Relic, it is equivalent to a mechanic meticulously dismantling the entire engine and then reassembling it in an attempt to understand the problem and then resolve it. It is an extremely expensive task in terms of time and resources, however it is the only path to take when the classic server-side optimizations on powerful hardware do not seem to bring appreciable results to the customer's installation.

You have to move your hands but it is the only possible path, that of measuring to decide, that is, understanding the bottlenecks and the origin of the problem and then proceeding with the resolution.

Load-Average-Optimization

We can observe from the screenshot above that, in the early hours of the morning, the server load and number of transactions were extremely high, with very slow response times. The averages were around 20 seconds, with peaks exceeding 60 seconds, effectively making the backend slow or even unusable. This slowdown negatively impacted the administrator user experience, causing frustration and inefficiency.

Tracing, as highlighted in the image below, revealed that each admin-ajax call took over 70 seconds to complete. Considering the frequency with which these calls are made by logged in users, the result was a significant load build-up, further degrading system performance. This caused an extremely poor user experience, with unsustainable waiting times.

The main cause of these problems was at least apparently the “CRM Multistep Subscription” plugin, which had clear performance problems. While it wasn't immediately apparent what the specific flaws were, it was clear that the plugin introduced typos and inefficiencies that needed to be addressed. Our in-depth analysis and targeted intervention were essential to identifying and resolving these issues, thereby significantly improving system performance.

Admin-Ajax-slow

A further analysis allowed us to understand how specifically the underlying problem was a non-performing SQL query with an execution time of over 50 seconds and attributable this time to Learndash which queried the Database to retrieve the courses associated with each user.

Slow-query-learndash

Considering that the query was always the same and did not have user-specific parameters or variables as clauses, the fastest and most effective solution was to proceed as well as add some indexes to the MySQL tables (specifically MariaDB 11.4), to modify the offending application code using a Code Side Cache.

We have therefore identified the offending code that you see below:

learndash_get_courses_count_original

and we rewrote it by adding query caching functionality at the PHP code level using WordPress's wp_cache_set() and wp_cache_get().

learndash_get_courses_count

To integrate a query cache into your function learndash_get_courses_count, we can use the WordPress cache API. This allows us to store query results for a certain period of time, improving performance.

wp_cache_set() is a WordPress feature that allows you to cache a value. It is used by passing a unique key, the value to store, an optional group to organize the data, and an optional expiration time. This function caches the provided value with the specified key.

wp_cache_get() is the complementary function that allows you to retrieve a value from the cache. It is used by providing the unique key and, optionally, the group to which the value belongs. You can force fetch from main cache and check whether the value was found or not. This function retrieves the value associated with the specified key from the cache.

Use wp_cache_set() e wp_cache_get() in WordPress responsibly and where possible, helps improve site performance by reducing the load on the database and speeding up response times.

Specifically, the code that we modified compared to the original one which claimed to make a 50 second query each time, aimed to store the result of the query for 1 hour.

  1. Cache key generation: A unique key is generated based on the query arguments and return field.
  2. Recovering from cache: Attempts to retrieve the result from the cache using the generated key. If the result is present in the cache, it is returned immediately.
  3. Caching: If the result is not in the cache, the query is executed and the result is cached for 1 hour

This way, query results are stored and reused, improving overall performance.

The result is that the slow query has effectively disappeared. If we look at the last time the slow query appeared in the New Relic analysis system, we see that the last time it appeared was 5 hours ago, shortly before the final change.

Slow-Query-LearnDash

In this way, as in a chain effect, the admin-ajax.php calls began to perform correctly as well as the load at the application and server level with a flattening of DB requests and latencies.

New-Relic-Transaction-Overview

The results obtained translated into a reduction in the CPU load from a Load Average of 30 to a Load Average of 4, with a saving of over 600%, an increase in the responsiveness of the site for logged in users, less load on the database, and a general improvement that is truly tangible to the naked eye.

CPU-Load-Netdata

Server-side tuning and optimization are crucial processes to fully exploit the potential of BuddyBoss. With a targeted approach and optimal configuration, it is possible to achieve top-level performance, ensuring a smooth and responsive user experience. However, when these measures are not sufficient, it is necessary to get to the heart of the application problem using valuable profiling tools such as New Relic. Our expertise in this field allows us to offer tailor-made solutions, optimizing every aspect of the server stack to meet the specific needs of your platform. This includes fine-tuning server resources, optimizing database queries, and implementing advanced caching.

If your BuddyBoss or LearnDash application is also starting to suffer from performance and speed issues, and you want to improve the user experience without having to redo everything from scratch, contact us. We are ready to brilliantly resolve performance issues, as we have already done in many other cases, guaranteeing a significant improvement in the speed and responsiveness of your site.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

Back to top