Instructions to activate Redis Cache on HawkHost

Tutorials 0 lượt xem
This post is part 6 of 6 in the Using Hosting at Hawk Host series

According to the announcement from HawkHost ‘s blog , this hosting provider has integrated the Redis Cache feature.

Memcached and Redis have included a new section called cPanel Application Manager. 

Today, I will show you how to enable Redis Cache on HawkHost.

What is Redis Cache?

Redis Cache is a cache system that stores data in RAM. Therefore, it helps to speed up the website a lot compared to accessing data from the hard drive. 

Redis and Memcached have many of the same features. They all belong to the NoSQL database family, which stores data on RAM. Memcached was born in 2003.

Redis came out later in 2009. So it’s not surprising that Redis is more powerful than Memcached. In most cases ​Redis beats Memcached . You can learn more about the difference between Memcached and Redis

Enable Redis on HawkHost

Step 1: Turn on the Redis server.

Open HawkHost’s cPanel. Go to Hawk Host Links section, click on Server Application Manager

Enable Redis Cache HawkHost 3

Next, click on the Enable link to turn on the Redis server. 

Enable Redis Cache HawkHost 4

Server startup takes at least 5 minutes. 

Enable Redis Cache HawkHost 5

As soon as Redis finishes booting, you will see the status as Online

Enable Redis Cache HawkHost 6

Step 2: Enable the Redis . module

In order for php to be able to connect to the Redis server, you need to enable the Redis module.

Also in the cPanel of ​HawKhost, you go to the Software section. Click the link Select PHP Version. 

Enable Redis Cache HawkHost 1

Next, click on the Redis option. Click the Save button to save the configuration: 

Enable Redis Cache HawkHost 2

Step 3: Install the WordPress plugin

For Hosting at HawkHost, you should use LiteSpeed ​​Cache to take advantage of LiteSpeed ​​Server’s LSCache module. 

In this situation to leverage Redis Cache:

You need to install and activate the Redis Cache plugin . ​

As soon as the plugin has been activated, open the wp-config.php file and add the following line: ​


define('WP_CACHE', true);
define('WP_REDIS_SCHEME', 'unix');
define('WP_REDIS_PATH', '/home/lookwpco/.applicationmanager/redis.sock');

Replace Redis Path with your value (get it from Server Application Manager). 

Now go to Settings -> Redis , click on Enable Object Cache button :

Enable Redis Cache HawkHost 7

If the status is connected, you have successfully installed Redis. 

Enable Redis Cache HawkHost 8

Using the W3 Total Cache plugin

Many people recommend not using W3 Total Cache for shared hosts because this plugin is a bit heavy and complicated. But if you are using W3 Total Cache and want to take advantage of HawkHost’s Redis Cache feature, here are the instructions: 

​Go to General Settings , select Page Cache. In the Page Cache Method section , select Redis. Click the Save Settings & Purge Checks button. 

how to enable redis cache on hawkhost 8

Do the same for the Object Cache, and Database Cache sections . 

Since HawkHost uses unix sockets to connect to the Redis server, you need to reconfigure the connection.

Go to Page Cache , scroll down to the Advanced section . In the section Redis hostname:port / IP:port . You enter the value as below (remember to replace your Redis Unix socket path with your value): ​

how to enable redis cache on hawkhost 9

Click the Test button to make sure W3 Total Cache connects to the Redis Server. You will see the message “Test passed”. Click the Save Settings & Purge Checks button. 

unix:/home/lookwpco/.applicationmanager/redis.sock

how to enable redis cache on hawkhost 10

Go to Object Cache and Database cache edit connection information like Page Cache. Remember to click the Save Settings & Purge Checks button after making changes. 

Load Test with Redis Cache

To evaluate the effectiveness Redis Cache brings, I use loader.io to perform load tests. I will run a maintain client type test that loads from 0 to 250 clients within a minute. 

Here is the test result before enabling Redis Cache: ​

Average response time 555 ms

speed test redis cache 2

Result with Redis Cache: 

Average response time is 502ms

test redis cache speed when there is cache

So Redis Cache has improved its website speed a bit. 

That is all. 

You have learned how to enable the Redis feature on HawkHost.

If you want to use the host at HawkHost, don’t forget the discount code HERE . ​

View articles in the series

Previous part: PHP 7.1 upgrade guide for WordPress hosting

Bài viết liên quan