Newer versions of FusionPBX are faster and more efficient

markjcrane

Well-Known Member
Staff member
Jul 22, 2018
766
299
63
51
Here are some ways FusionPBX performance and efficiency have been improved in recent releases.

Database - Indexing
  • Database indexing makes a big difference in performance for the database.
  • Any table with thousands of records or millions of records benefits greatly by being indexed.
  • Recommended database indexes have been part of the green level member documentation for years.
  • Anyone could index their own database, but what I found over the years is that not many people would do this.
  • Over the years, I've indexed many people's systems while doing support sessions with them.
  • Call Detail Records are especially important to index.
  • In PostgreSQL, the primary key or row identifier is automatically indexed
  • As of FusionPBX 5.5, all foreign keys that relate to the primary keys are indexed by default.
Database - Multiple connections
  • Multiple instances of database objects that each would connect to the database.
  • The FusionPBX code was updated to remove these redundant database objects.
  • I didn't think these extra database object instances made a big difference, but after removing the extras, it was surprising what a difference it made.
  • Now use a singleton pattern for the database connection added by Tim.
  • Tim, one of the FusionPBX team members, pushed for this change, and he was right. It made a big difference.
Database - Save method
  • When the save button is used in FusionPBX, only changes are updated in the database
  • No changes, the save method skips the update commands
  • Added to FusionPBX 5.5
Upgrade Schema
  • Used to use a single query to find if each table, column, and data type exists and is correct. This means it ran a lot of SQL Queries
  • In FusionPBX 5.5 this was achieved with 1 database query.
  • This wasn't a hard change; it just took turning attention to it for a few hours to resolve.
  • FusionPBX 5.5 upgrade -> schema and data types together because the speed improvement is dramatically faster
Modules
  • Found in the menu -> Advanced -> Modules.
  • Lists all FreeSWITCH modules and their status.
  • The original version made one request to FreeSWITCH for each and every module.
  • Once a single request was found that could return the status of all modules,
  • This code was rewritten to be much faster and more efficient
  • Released in FusionPBX 5.2
Active Calls
  • This feature used Ajax to update the information on the page it used polling to get information from the server. This put a higher load on the web server and its logs
  • FusionPBX 5.3 introduced Web Sockets for Active Calls. This uses the web server to load the page, and then updates live through a real-time connection.
Active Conferences
  • This feature used Ajax to update the information on the page; it used polling to get information from the server. This put a higher load on the web server and its logs
  • FusionPBX 5.5 introduced Active Conferences, which use the web server to load the page and then update live through a real-time connection.
PHP Sessions
  • Default and Domain settings. This puts some load on the server. FusionPBX code is migrating away from heavy use of PHP sessions to a much lighter use of PHP SESSIONS. We have been moving a PHP settings class object for Default and Domain Settings, and this has greatly reduced our reliance on the PHP SESSION.
  • PHP settings class added 13 Sep 2023. This was first released in FusionPBX 5.2
  • This settings class has been improved, and its usage has been extended further in each new FusionPBX release.
XML CDR
  • Loaded from the file system rather than using the web server.
  • FusionPBX xml_cdr service was introduced in FusionPBX 5.2
  • Polls the file system to load call detail records from files.
  • Don't have to wait for a cron job.
  • Doesn't use the web server and load it down with HTTP requests per phone call
  • FusionPBX Master branch currently supports inotify if this has been installed for PHP
    • This introduces an alternative to file system polling and picks up file system events
    • It will be released in the FusionPBX 5.6 release

This is not an exhaustive list of all speed and efficiency improvements. I shared it to show that ongoing work is focused on optimizing FusionPBX for performance, resource efficiency, and minimal points of failure. Additionally, FusionPBX relies on fewer dependencies, which is done to reduce risks from supply chain attacks from external libraries.
 
Last edited: