If your hosting package contains more than 2GB RAM, you can set up Redis. Redis is an advanced caching tool which stores frequently used data in the RAM memory. This allows you to gain a significant speed increase.
If someone visits your webshop, the needed data is retrieved directly from the cache. Your website does not need to reload, improving your loading time significantly.
Optimize PHP-settings
For the best results, we advise using the latest, stable PHP version which Magento supports. Do check if the Redis module also has been checked. Both can be done through the PHP-selector within DirectAdmin. Then, follow the steps below to make sure your PHP-settings are optimized.
- Log into DirectAdmin.
- Within the menu, go to 'Extra Functions' and then 'Select PHP version'.
3. On the top right, click 'Switch to PHP options'.
4. Remove, at 'disable_functions', the function 'exec' and press 'Enter'.
5. Activate OPcache with the following settings:
- opcache.consistency_checks: Off
- opcache.enable_cli: On
- opcache.max_accelerated_files: 100000
- opcache.memory_consumption: 512
- opcache.validate_timestamps: Off
Setting up Redis
Setting up Redis within Magento is done through SSH. Make sure that you have SSH-access to your hosting package, or you will not be able to perform the following steps. Refer to our SSH-manual for the steps on that.
Set up a SSH-connection and navigate to the folder in which your Magento installation is located. For example:
$ cd /home/username/domains/example.com/public_html2. Make sure that the Magento Binary is executable. You can do so with the command:
$ chmod 750 bin/magento3. Set up the Default Cache with the following command:
$ bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=/tmp/redis.sock --cache-backend-redis-db=04. Set up the Page Cache with the command below:
$ bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=/tmp/redis.sock --page-cache-redis-db=1 --page-cache-redis-compress-data=15. Finally, set up the Session Cache with this command:
$ bin/magento setup:config:set --session-save=redis --session-save-redis-host=/tmp/redis.sock --session-save-redis-db=26. Check with the command below whether a Redis connection is successful. If you get 'PONG' back, then it is set up.
$ redis-cli -s /tmp/redis.sock ping7. You can also check with the following command. If you have entered this and visit your website, you should get a response back within your terminal.
$ redis-cli -s /tmp/redis.sock $ monitor
Congratulations, Redis has now been set up! The speed of your Magento-website should be increased significantly.