{"id":1170,"date":"2019-11-27T09:24:06","date_gmt":"2019-11-27T08:24:06","guid":{"rendered":"https:\/\/www.combell.nl\/en\/help\/?post_type=ht_kb&#038;p=1170"},"modified":"2021-06-15T13:12:04","modified_gmt":"2021-06-15T11:12:04","slug":"performance-hosting-with-drupal","status":"publish","type":"ht_kb","link":"https:\/\/www.combell.nl\/en\/help\/kb\/performance-hosting-with-drupal\/","title":{"rendered":"Performance hosting with Drupal"},"content":{"rendered":"    \t\t<div class=\"hts-messages hts-messages--alert   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tThis article is optimised for Drupal 7    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p>Drupal is one of the most popular content management systems. It can handle small and large websites equally well, with a little optimization. This article will help you prepare your CMS to handle large traffic without losing on speed.<\/p>\n<p>The <a href=\"https:\/\/www.combell.nl\/en\/help\/kb\/drupal-general-optimization\/\">first part of this article<\/a> will show you standard optimization techniques, suitable for every hosting, even if you are not using the caching options.<\/p>\n<p>Only when you have completed the general optimization, you can proceed to the second part of the article, which shows you how your CMS can benefit from the Performance hosting tools.<\/p>\n<h4 id=\"tableofcontents\">IN THIS ARTICLE:<\/h4>\n<ul>\n<li><a href=\"#h21\">Redis configuration<\/a><\/li>\n<li><a href=\"#h22\">Execute<\/a><\/li>\n<\/ul>\n<p><a name=\"h21\"><\/a><\/p>\n<h2>Redis configuration<\/h2>\n<ol>\n<li><a href=\"\/en\/en\/291\">Activate a Redis instance on the hosting package in question via your control panel.<\/a><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4230\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal1-300x200.png\" alt=\"\" width=\"300\" height=\"200\" \/><\/li>\n<li>Install Redis via drush cli from the SSH jail. Navigate to the root (~\/www\/[drupal]\/) directory and execute the following command:\n<pre><code>drush en -y redis\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4231\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal2-300x93.png\" alt=\"\" width=\"300\" height=\"93\" \/><\/li>\n<li>Install Predis via git from the SSH jail:\n<pre><code>cd ~\/www\/[drupal]\/sites\/all\/libraries\/\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4232\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal3-300x23.png\" alt=\"\" width=\"300\" height=\"23\" \/><\/p>\n<ol>\n<li>Open https:\/\/github.com\/nrk\/predis in a web browser.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4233\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal4.png\" alt=\"\" width=\"108\" height=\"53\" \/><\/li>\n<li>Copy the contents of the field HTTPS clone URL in your clipboard.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4234\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal5-300x38.png\" alt=\"\" width=\"300\" height=\"38\" \/><\/li>\n<li>Now enter the following command:\n<pre><code>git init\n\ngit clone **paste from clipboard**\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4235\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal6-300x47.png\" alt=\"\" width=\"300\" height=\"47\" \/><\/li>\n<li>There will be now a Predis directory in www\/sites\/all\/libraries\/<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4236\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal7-300x20.png\" alt=\"\" width=\"300\" height=\"20\" \/><\/li>\n<\/ol>\n<\/li>\n<li>Adjust settings.php by adding this code to the bottom of the file:\n<pre><code>nano ~\/www\/[drupal]\/sites\/default\/settings.php\n\n$conf['redis_client_interface'] = 'Predis';\n$conf['redis_client_host'] = 'IP ADDRESS OF THE REDIS INSTANCE';\n$conf['redis_client_port'] = 'PORT OF THE REDIS INSTANCE';\n$conf['redis_client_password'] = 'PASSWORD OF THE REDIS INSTANCE';\n$conf['lock_inc'] = 'sites\/all\/modules\/redis\/redis.lock.inc';\n$conf['cache_backends'][] = 'sites\/all\/modules\/redis\/redis.autoload.inc';\n$conf['cache_default_class'] = 'Redis_Cache';\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4237\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal8-300x27.png\" alt=\"\" width=\"300\" height=\"27\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4238\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal9-300x165.png\" alt=\"\" width=\"300\" height=\"165\" \/><\/li>\n<li>Afterwards test the connection to the Redis server from the SSH jail.How you do this:\n<ol>\n<li>The Redis-cli is now available on the shared SSH jails. It is necessary to reset the SSH to use them. Once this is done you can use the Redis-cli.<\/li>\n<li>In this example I use the IP 255.255.255.0; port 10000 and the password PASS<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><code>redis-cli -h THISISYOUREDISIPADDRESS -p THISISYOURREDISPORT<\/code><br \/>\n<code>250.250.250.0:10000&gt; AUTH THISISYOURREDISPASSWORD<\/code><br \/>\n<code>OK<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4239\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal10-300x30.png\" alt=\"\" width=\"300\" height=\"30\" \/><\/p>\n<p><a name=\"h22\"><\/a><\/p>\n<h2>Execute<\/h2>\n<p>Now you can execute the Redis commands.<\/p>\n<p>To see if keys are present on this Redis instance you give the following command:<\/p>\n<pre><code> 255.255.255.0:10000&gt; keys *\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4240\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal11-300x104.png\" alt=\"\" width=\"300\" height=\"104\" \/><\/p>\n<p>To see how much MB are used for example you give the following command:<\/p>\n<pre><code> 255.255.255.0:10000&gt; info\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4241\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal12-300x148.png\" alt=\"\" width=\"300\" height=\"148\" \/><\/p>\n<p>To see if the database grows when you click around the site give you the following command:<\/p>\n<pre><code> 255.255.255.0:10000&gt; dbsize\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4242\" src=\"https:\/\/www.combell.nl\/en\/help\/wp-content\/uploads\/2019\/11\/Performance-hosting-with-Drupal13.png\" alt=\"\" width=\"208\" height=\"30\" \/><\/p>\n<p>You can leave the Redis-cli using CTRL + C<\/p>\n<hr \/>\n<p>You&#8217;ll find a <a href=\"http:\/\/redis.io\/commands\" target=\"_blank\" rel=\"noopener\">list of the commands on the Redis site<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Drupal is one of the most popular content management systems. It can handle small and large websites equally well, with a little optimization. This article will help you prepare your CMS to handle large traffic without losing on speed. The first part of this article will show you standard optimization&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb\/1170"}],"collection":[{"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":3,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb\/1170\/revisions"}],"predecessor-version":[{"id":3606,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb\/1170\/revisions\/3606"}],"wp:attachment":[{"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb-category?post=1170"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.combell.nl\/en\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}