If you’ve performed a fresh cPanel & WHM installation recently, you may have noticed how much faster the process is. Aside from a lot of under the hood magic (no, not really), an impressive amount of work and planning over multiple years of cPanel & WHM was required. Currently, the time to install cPanel & WHM on a brand new server is averaging between 3 and 15 minutes. That’s a pretty drastic reduction from the 60-90 minutes that it used to take!

We want to take the opportunity to give you members of the cPanel Community a look behind the curtain at a few highlights that improve the installation times of cPanel & WHM.

First stop: Clean up the old

After 20+ years, one can only assume that a project will net some outdated, deprecated, or no longer needed components. In Version 70 we did an extensive, meticulous audit of every slow part of the installer and update system, rewriting anything we could, and taking stock of what other work we could do to improve the system. 

A huge contributor to the improved install time was the removal of the tons of cruft and old parts of the product. The two more remarkable removals over the last few years were the EasyApache 3 in v72 and the end of support for CentOS 5. The removal of EasyApache 3 in v78 allowed us to fix areas of the installer that we’d had to keep to support EA3. The end of CentOS 5 support allowed us to rewrite the base install system, now that we no longer needed to support legacy Perl versions. This work also included the removal of a significant amount of Perl RPMs in v80 that were solely there for supporting these legacy systems that were no longer needed. 

Fine tuning of the MySQL update system netted a vastly improved performance increase by no longer having to support older versions of MySQL and MariaDB.

A lot of reworking

Retooling a software property as big as cPanel is a huge undertaking. To streamline the installation process, several systems inside the product required a bit of reworking. In Version 70, we started rewriting the MySQL update system to reduce the time to install MySQL and MariaDB. For years we have been moving the software away from an older install process that synced files from an install server to an almost entirely RPM-based system. With Version 72, we started work that will continue through Version 82, where we are carefully examining and re-writing each RPM’s install script to improve the install times. Version 76 saw us reduce the amount of memory required to run the installer, and increase the download processes in the file sync system, allowing more files to be downloaded in tandem.

In Version 78, a partial rewrite of the base install system was done to improve performance. We no longer needed to support older versions of Perl, as CentOS5 had reached End of Life and was no longer supported, which decreased the ever-improving installation time.  Piggybacking on the end of CentOS5 support, much of the installer was paralleled (made to run simultaneously), as well as allowing RPM downloads in parallel.

In v80, we also split up the RPMs that are installed to get the base functionality installed more quickly. We improved the service management system to reduce the time to start, stop, and restart services on the server. We even put work into how we enable quotas, as enabling quotas on a new system was a huge slowdown for new installs. We worked on our sprite generation system and even dug into the nightly maintenance code, and the post-update code to improve the performance in those places as well.  

A little help from our friends

We can’t take all of the credit for the vast improvements made over the last few versions of cPanel & WHM. Starting before v70, we added measurements to each part of the update process and reviewed updated logs provided to us by cPanel partners to identify areas of improvement. We want to especially thank those of you who have Send error reports to cPanel for analysis enabled in Tweak Settings. That information was instrumental in helping us reduce the install and update times. Side note: If you are interested in helping with future decision making, enable the cPanel Analytics Plugin!

We worked with the Perl Community specifically to improve Perl’s performance early in our process, resulting in processing Perl instancing much sooner in the install process, reducing the number of items handled manually in the installer, and cannot thank them enough for that help. 

Another giant help came from the folks over at SpamAssassin. They were able to optimize the configure and rule building process with a massive impact. In some cases, we saw 10x or better reduction in update times for SpamAssassin alone.

The Work Continues

We will continue to review nightly maintenance code by using the data gathered from helpful customer-provided update logs, and any system that does not meet our update time goal will be looked at. We’re continuing to look at memory reductions, faster downloads, improving the update-sync system, and removal of anything else we can. 

In cPanel & WHM Version 82 we will be removing support for the long-deprecated LANG localization system. This system will only be used by anyone relying on shorttags in the localization, which will only be people using x3 or x3-derived cPanel themes. Since x3 was removed from the product in Version 60 (which reached End of Life in October 2017), it’s just one more example of code that is no longer needed in the product. 

Thanks to feedback from the cPanel Community and the hard work of our Development teams, we’ve been able to cut the install times of cPanel & WHM considerably.  We want to hear more about your experiences and the installation times you’ve experienced as a user. Please join our Slack and Discord channels, or subscribe to our official cPanel subreddit!