Improving Website Performance with LiteSpeed
access_time
hourglass_empty
person_outline

Improving Website Performance with LiteSpeed

At the beginning of 2019, Hostinger decided to try LiteSpeed Web Servers (LSWS) as the main web server instead of Apache. LiteSpeed is a drop-in replacement for Apache with .htaccess file support.

When compared to Apache, it has quite a few advantages:

But that’s just the tip of the iceberg!

hPanel

LiteSpeed supports popular hosting provider panels such as WHM/cPanel, DirectAdmin, Plesk and more.

However, Hostinger uses a custom hosting panel – hPanel – which has dynamic vhost management based on Redis and Openresty + custom LUA scripts.  This is how it works: vhost data is saved in Redis. Openresty retrieves said data when a web request is received. Then it is passed on to the Apache web server.

Originally, LiteSpeed is configured using config files. However, we wanted to implement fully dynamic management, which doesn’t need to reload services in order to update the configuration, as we did with the Openresty setup. We contacted LiteSpeed support, explained our current setup and the fact that we want to make it dynamically managed.

Turns out, we were lucky as they were already developing LiteSpeed version 5.4. They were happy to help and implement it in the development branch. That was great news to us since we didn’t have to reimplement our current vhost management process.

So we didn’t just replace Apache, but we got rid of Openresty too, reducing the software stack used to process requests which also adds to the performance gain.

Pace of Development

When we initially planned to migrate to LiteSpeed we thought this should take about a month. After we discussed how it should be implemented, LiteSpeed engineers developed a working version with dynamic vhost management in about a week which is really fast for such software. We installed it in our development environment and prepared migration tools to replace Apache.

Redis support was added to LSWS 5.4RC3. To our misfortune, we didn’t realize how many changes were planned and already done in LSWS 5.4RC3. The stable version release date was still unknown to us. RC4 was on the way too with additional changes that had to be tested. Here at Hostinger we often experience bad traffic coming to our clients` websites so it was a good environment to catch all unexpected errors. After the first deployment on our production server, we started receiving crash reports. At this point, bug hunting season started. For almost two months since the first deployment, we started reporting bugs to LiteSpeed engineers daily. Good thing is that when LSWS crashes for any reason, only a visitor that hit that bug is affected as LSWS generates a core file and gracefully restarts in almost no time. LiteSpeed engineers were focused on fixing those bugs and we got a new release in just a few hours after reporting them every day. When we stopped receiving crash reports from the first server we increased the server pool running with LiteSpeed, then new bugs started to appear. After about three months of such testing, verifying, reporting and fixing bugs a week came without any crash reports and we could tell that the stable version finally came.

The Result

After we deployed LiteSpeed, we saw a noticeable performance improvement compared to our old setup. Most of our clients use WordPress as their Content Management System so we tested it with LiteSpeed on our servers. We saw a great improvement on Time To First Byte (TTFB) compared to Apache.

openresty apache vs litespeed

LiteSpeed Cache plugin

LiteSpeed engineers have developed their own LiteSpeed Cache plugin for WordPress. With this plugin installed TTFB improved even more by a great margin.wordpress with litespeed-cache plugin

To know more about how the LiteSpeed Cache plugin works, you can read this article.

Furthermore, the latest LiteSpeed 5.4 release has huge improvements on SSL/TLS, QUIC and integrated security features which are enabled by default on all Hostinger servers.

After seeing such a performance gain we decided to install the LiteSpeed Cache plugin for all users who install WordPress via Hostinger’s Auto Installer. We also encourage all users using WordPress or other popular CMSs to install the LiteSpeed Cache plugin to benefit from its advantages.

LiteSpeed has developed cache plugins for most popular CMS like WordPress, Magento, Joomla, PrestaShop, OpenCart, Drupal and more. Check the entire list here.

At Hostinger we always strive to provide the best experience for our users by allowing them to use the latest technology. We want to make it easy for customers to install, use and maintain their websites.

The Author

Author

Aurimas Lapienė / @aurimaslapiene

Related stories

Author

Urmila Enterprises Reply

October 26, 2020

My website not working properly urmila*****.in

    Author

    Andrius S.

    Replied on October 27, 2020

    Hey there. I can see that your domain is not pointing to any hosting plan. Could you drop us a message from your dashboard Help section -> Contact us? Our agent will take a look at it!

Author

bineet Reply

October 12, 2020

I am facing issue using litespeed on hostinger, when ever I try to flush cache from hpanel of hostinger. Each time it shows me error that, cannot flush cache. Please help me

    Author

    Andrius S.

    Replied on October 13, 2020

    Hey there! I am sorry to hear about this issue, it seems unusual and our CS team would be glad to check the error out. Could you drop us a message with more details at support@hostinger.com or via Live Chat from your dashboard?

Author

Shafiqul Mridha Reply

October 10, 2020

Hey Aurimas, After reading this article I've decided to migrate my hosting plan to the LiteSpeed server and wanted to thank you. Great job.

    Author

    Andrius S.

    Replied on October 11, 2020

    Hey, Shafiqul! I and Aurimas are both happy you liked the article. How is the server? :)

Author

siescribe.me Reply

September 11, 2020

Interesting, but since you were talking about improvements to the site, I would have seen the impact of this on an ecommerce with woocommerce.

    Author

    Andrius S.

    Replied on September 12, 2020

    Hey there! The performance of your website depends on many variables and it can be always improved. If you feel like you are not getting the most of it - our team would gladly take a look into your website and help you out! Please drop us an email at support@hostinger.com - our agents are always here to assist you.

Author

Chandra minj Reply

September 11, 2020

Where is my domin

    Author

    Andrius S.

    Replied on September 12, 2020

    Hello, Chandra! I am happy to see that you have even two domains with us. You can access them anytime on your dashboard at hostinger.in. If you need any help - write us a message at support@hostinger.com, our team is here for you.

Author

VazGaming Reply

September 11, 2020

Amazing, with litespeed makes my website load much faster

Author

Prabhat Pushp Reply

September 11, 2020

I was using Litespeed, and I found out about object caching. So I installed Memcached and Redis extension. But in Litespeed connection failed. Can someone tell me how to fix that?

    Author

    Andrius S.

    Replied on September 12, 2020

    Hey, Prabhat. Our team would like to check your case, could you contact us at support@hostinger.com or alternatively - open a ticket on your dashboard -> Help section? We are here to solve this!

Author

Sahil Reply

May 19, 2020

Do we have to install litespeed after everything installed. I saw it in my worddpress tab that litespeed is showing inactive. do i have to activate it manually? or is it for the litespeed cache plugin?

    Author

    Andrius S.

    Replied on May 20, 2020

    LiteSpeed Cache comes pre-installed for all Hostinger accounts!

Author

Alan Reply

April 05, 2020

Can somebody tell me:- What the amount of storage on the Premium plan? Can you buy extra?

    Author

    Andrius S.

    Replied on April 06, 2020

    Hey Alan, it's 20GB but you can upgrade your plan anytime if you need more!

Author

Ritesh Sharma Reply

October 09, 2019

Recently i developed a site and i found great result with Hostinger hosting and the litespeed. Any small business website can run easily with cheapest hosting plan from Hostinger and it can give high performance with lightspeed. Ritesh

Leave a Reply

Comment

Name*

Email*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a part of Hostinger now!