{"id":3585,"date":"2019-02-11T13:55:18","date_gmt":"2019-02-11T13:55:18","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=3585"},"modified":"2019-07-22T04:11:48","modified_gmt":"2019-07-22T04:11:48","slug":"install-redis-and-combine-with-varnish-and-nginx-for-m2-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/02\/11\/install-redis-and-combine-with-varnish-and-nginx-for-m2-on-ubuntu-16-04\/","title":{"rendered":"Install Redis and Combine With Varnish and Nginx for M2 On Ubuntu 16.04"},"content":{"rendered":"<p>Ref: https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-redis-on-ubuntu-16-04<br \/>\nhttps:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-redis-on-ubuntu-18-04<\/p>\n<p>Install Redis Server<\/p>\n<pre class=\"lang:default decode:true \">sudo add-apt-repository ppa:chris-lea\/redis-server\r\nsudo apt-get update\r\nsudo apt-get install redis-server<\/pre>\n<p>Then modify \/etc\/redis\/redis.conf file. In the file, find the\u00a0supervised\u00a0directive. Currently, this is set to\u00a0no. Since we are running an operating system that uses the systemd init system, we can change this to\u00a0systemd:<\/p>\n<pre class=\"lang:default decode:true \">. . .\r\n\r\n# If you run Redis from upstart or systemd, Redis can interact with your\r\n# supervision tree. Options:\r\n#   supervised no      - no supervision interaction\r\n#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode\r\n#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET\r\n#   supervised auto    - detect upstart or systemd method based on\r\n#                        UPSTART_JOB or NOTIFY_SOCKET environment variables\r\n# Note: these supervision methods only signal \"process is ready.\"\r\n#       They do not enable continuous liveness pings back to your supervisor.\r\nsupervised systemd\r\n\r\n. . .<\/pre>\n<p>Next, find the\u00a0dir\u00a0directory. This option specifies the directory that Redis will use to dump persistent data. We need to pick a location that Redis will have write permission and that isn&#8217;t viewable by normal users.<\/p>\n<p>We will use the\u00a0\/var\/lib\/redis\u00a0directory for this, which we will create in a moment:<\/p>\n<pre class=\"lang:default decode:true \">. . .\r\n\r\n# The working directory.\r\n#\r\n# The DB will be written inside this directory, with the filename specified\r\n# above using the 'dbfilename' configuration directive.\r\n#\r\n# The Append Only File will also be created inside this directory.\r\n#\r\n# Note that you must specify a directory here, not a file name.\r\ndir \/var\/lib\/redis\r\n\r\n. . .<\/pre>\n<p>Save and close the file when you are finished.<\/p>\n<p>Create a Redis systemd Unit File<br \/>\nNext, we can create a systemd unit file so that the init system can manage the Redis process.<\/p>\n<p>Create and open the\u00a0\/etc\/systemd\/system\/redis.service\u00a0file to get started:<\/p>\n<pre class=\"lang:default decode:true\">$ sudo gedit \/etc\/systemd\/system\/redis.service<\/pre>\n<p>Inside, we can begin the\u00a0[Unit]\u00a0section by adding a description and defining a requirement that networking be available before starting this service. In the\u00a0[Service]\u00a0section, we need to specify the service&#8217;s behavior. For security purposes, we should not run our service as\u00a0root. We should use a dedicated user and group, which we will call\u00a0redis\u00a0for simplicity. We will create these momentarily.<\/p>\n<p>To start the service, we just need to call the\u00a0redis-server\u00a0binary, pointed at our configuration. To stop it, we can use the Redis\u00a0shutdown\u00a0command, which can be executed with the\u00a0redis-cli\u00a0binary. Also, since we want Redis to recover from failures when possible, we will set the\u00a0Restart\u00a0directive to &#8220;always&#8221;. Finally, in the\u00a0[Install]\u00a0section, we can define the systemd target that the service should attach to if enabled (configured to start at boot):<br \/>\n&lt;DONT USE THIS SETTING&gt;<\/p>\n<pre class=\"lang:default decode:true\">[Unit]\r\nDescription=Redis In-Memory Data Store\r\nAfter=network.target\r\n\r\n[Service]\r\nUser=redis\r\nGroup=redis\r\nExecStart=\/usr\/local\/bin\/redis-server \/etc\/redis\/redis.conf\r\nExecStop=\/usr\/local\/bin\/redis-cli shutdown\r\nRestart=always\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>&lt;\/DONT USE THIS SETTING&gt;<\/p>\n<p>&lt;USE THIS SETTING&gt;<\/p>\n<pre class=\"lang:default decode:true \">[Unit]\r\nDescription=Redis In-Memory Data Store\r\nAfter=network.target\r\n\r\n[Service]\r\nType=forking\r\nExecStart=\/usr\/bin\/redis-server \/etc\/redis\/redis.conf\r\nExecStop=\/bin\/kill -s TERM $MAINPID\r\nPIDFile=\/var\/run\/redis\/redis-server.pid\r\nExecStartPost=\/bin\/sh -c \"echo $MAINPID &gt; \/var\/run\/redis\/redis.pid\"\r\nTimeoutStopSec=0\r\nRestart=always\r\nUser=redis\r\nGroup=redis\r\nRuntimeDirectory=redis\r\nRuntimeDirectoryMode=2755\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>&lt;\/USE THIS SETTING&gt;<br \/>\nSave and close the file when you are finished. After saving and closing the file, I reloaded the systemd manager configuration:<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl daemon-reload<\/pre>\n<p>Create the Redis User, Group and Directories<br \/>\nNow, we just have to create the user, group, and directory that we referenced in the previous two files.<\/p>\n<p>Begin by creating the\u00a0redis\u00a0user and group. This can be done in a single command by typing:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo adduser --system --group --no-create-home redis\r\nThe system user `redis' already exists. Exiting.<\/pre>\n<p>Now, we can create the\u00a0\/var\/lib\/redis\u00a0directory by typing:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo mkdir \/var\/lib\/redis\r\nmkdir: cannot create directory \u2018\/var\/lib\/redis\u2019: File exists<\/pre>\n<p>We should give the\u00a0redis\u00a0user and group ownership over this directory:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo chown redis:redis \/var\/lib\/redis<\/pre>\n<p>Adjust the permissions so that regular users cannot access this location:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo chmod 770 \/var\/lib\/redis<\/pre>\n<p>Start and Test Redis<br \/>\nNow, we are ready to start the Redis server.<\/p>\n<p>Start the Redis Service<\/p>\n<pre class=\"lang:default decode:true \">sudo systemctl start redis<\/pre>\n<p>Check that the service had no errors by running:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo systemctl status redis\r\n\u25cf redis.service - Redis In-Memory Data Store\r\n   Loaded: loaded (\/etc\/systemd\/system\/redis.service; disabled; vendor preset: enabled)\r\n   Active: active (running) since Sen 2019-02-11 21:58:44 WIB; 4s ago\r\n  Process: 23216 ExecStartPost=\/bin\/sh -c echo $MAINPID &gt; \/var\/run\/redis\/redis.pid (code=exited, status=0\/SUCCESS\r\n  Process: 23211 ExecStart=\/usr\/bin\/redis-server \/etc\/redis\/redis.conf (code=exited, status=0\/SUCCESS)\r\n Main PID: 23212 (redis-server)\r\n   CGroup: \/system.slice\/redis.service\r\n           \u2514\u250023212 \/usr\/bin\/redis-server 127.0.0.1:6379       \r\n\r\nPeb 11 21:58:44 teddy systemd[1]: Starting Redis In-Memory Data Store...\r\nPeb 11 21:58:44 teddy systemd[1]: Started Redis In-Memory Data Store.<\/pre>\n<p>I got the below error previously because the wrong setting in the redis.service file.<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl status redis<\/pre>\n<pre class=\"lang:default decode:true\">redis.service - Redis In-Memory Data Store\r\n   Loaded: loaded (\/etc\/systemd\/system\/redis.service; disabled; vendor preset: enabled)\r\n   Active: failed (Result: start-limit-hit) since Sen 2019-02-11 21:48:28 WIB; 8s ago\r\n  Process: 21490 ExecStop=\/usr\/local\/bin\/redis-cli shutdown (code=exited, status=203\/EXEC)\r\n  Process: 21488 ExecStart=\/usr\/local\/bin\/redis-server \/etc\/redis\/redis.conf (code=exited, status=203\/EXEC)\r\n Main PID: 21488 (code=exited, status=203\/EXEC)\r\n\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Unit entered failed state.\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Failed with result 'exit-code'.\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Service hold-off time over, scheduling restart.\r\nPeb 11 21:48:28 teddy systemd[1]: Stopped Redis In-Memory Data Store.\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Start request repeated too quickly.\r\nPeb 11 21:48:28 teddy systemd[1]: Failed to start Redis In-Memory Data Store.\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Unit entered failed state.\r\nPeb 11 21:48:28 teddy systemd[1]: redis.service: Failed with result 'start-limit-hit'.<\/pre>\n<p>Check it on the terminal<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo netstat -lnp | grep redis\r\ntcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      23212\/redis-server \r\ntcp6       0      0 ::1:6379                :::*                    LISTEN      23212\/redis-server<\/pre>\n<p>Or make sure port 6379 only be using by redis<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo netstat -lnp | grep ':6379'\r\ntcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      23212\/redis-server \r\ntcp6       0      0 ::1:6379                :::*                    LISTEN      23212\/redis-server<\/pre>\n<p>Test the Redis Instance Functionality<br \/>\nTo test that your service is functioning correctly, connect to the Redis server with the command-line client:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ redis-cli\r\n127.0.0.1:6379&gt; ping\r\nPONG\r\n127.0.0.1:6379&gt;<\/pre>\n<p>Check that you can set keys by typing:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ redis-cli\r\n127.0.0.1:6379&gt; set test \"It's working\"\r\nOK\r\n127.0.0.1:6379&gt; get test\r\n\"It's working\"\r\n127.0.0.1:6379&gt; exit<\/pre>\n<p>Enable Redis to Start at Boot<br \/>\nIf all of your tests worked, and you would like to start Redis automatically when your server boots, you can enable the systemd service.<\/p>\n<p>To do so, type:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo systemctl enable redis\r\nCreated symlink from \/etc\/systemd\/system\/multi-user.target.wants\/redis.service to \/etc\/systemd\/system\/redis.service.<\/pre>\n<p>Go to your magento root directory and open\u00a0app\/etc\/env.php and add the below codes just before the last line.<\/p>\n<pre class=\"lang:default decode:true \">'cache' =&gt; \r\n  array (\r\n    'frontend' =&gt; \r\n    array (\r\n      'default' =&gt; \r\n      array (\r\n        'backend' =&gt; 'Cm_Cache_Backend_Redis',\r\n        'backend_options' =&gt; \r\n        array (\r\n          'server' =&gt; '127.0.0.1', \r\n          'port' =&gt; '6379',\r\n          'persistent' =&gt; '',\r\n          'database' =&gt; '0',\r\n          'force_standalone' =&gt; '0',\r\n          'connect_retries' =&gt; '1',\r\n          'read_timeout' =&gt; '10',\r\n          'automatic_cleaning_factor' =&gt; '0',\r\n          'compress_data' =&gt; '1',\r\n          'compress_tags' =&gt; '1',\r\n          'compress_threshold' =&gt; '20480',\r\n          'compression_lib' =&gt; 'gzip',\r\n        ),\r\n      ),\r\n      'page_cache' =&gt; \r\n      array (\r\n        'backend' =&gt; 'Cm_Cache_Backend_Redis',\r\n        'backend_options' =&gt; \r\n        array (\r\n          'server' =&gt; '127.0.0.1',\r\n          'port' =&gt; '6379',\r\n          'persistent' =&gt; '',\r\n          'database' =&gt; '1',\r\n          'force_standalone' =&gt; '0',\r\n          'connect_retries' =&gt; '1',\r\n          'read_timeout' =&gt; '10',\r\n          'automatic_cleaning_factor' =&gt; '0',\r\n          'compress_data' =&gt; '0',\r\n          'compress_tags' =&gt; '1',\r\n          'compress_threshold' =&gt; '20480',\r\n          'compression_lib' =&gt; 'gzip',\r\n        ),\r\n      ),\r\n    ),\r\n  ),<\/pre>\n<p>Restart the Redis server<\/p>\n<pre class=\"lang:default decode:true \">sudo service redis-server restart<\/pre>\n<p>Check whether Redis server is working or not. Open your website and view some pages then \u00a0run the command<\/p>\n<pre class=\"lang:default decode:true \">sudo redis-cli info<\/pre>\n<p>If you see this \u00a0keyspace. Then your Redis is configured properly. If you do not see anything below Keyspace then Redis have not cached anything. In this case check your configuration<\/p>\n<pre class=\"lang:default decode:true \"># Keyspace\r\ndb0:keys=196,expires=24,avg_ttl=13891985<\/pre>\n<p>To flush the Redis cache run the following command<\/p>\n<pre class=\"lang:default decode:true \">sudo redis-cli flushdb<\/pre>\n<p>Now your site is optimized with Varnish and Redis.<\/p>\n<p>Benchmark<br \/>\nWhen I open https:\/\/fontaineind.test\/ for the first time (varnish after fresh restart still caching so the page load still slower and redis also after first restart and flushdb command executed). I got this from redis-cli info:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo redis-cli info\r\n# Server\r\nredis_version:5.0.3\r\nredis_git_sha1:00000000\r\nredis_git_dirty:0\r\nredis_build_id:45d60903d31a0894\r\nredis_mode:standalone\r\nos:Linux 4.15.0-38-generic x86_64\r\narch_bits:64\r\nmultiplexing_api:epoll\r\natomicvar_api:atomic-builtin\r\ngcc_version:5.4.0\r\nprocess_id:23212\r\nrun_id:0398df44fdf5d42687203813f129a4ad0753aca8\r\ntcp_port:6379\r\nuptime_in_seconds:2206\r\nuptime_in_days:0\r\nhz:10\r\nconfigured_hz:10\r\nlru_clock:6395458\r\nexecutable:\/usr\/bin\/redis-server\r\nconfig_file:\/etc\/redis\/redis.conf\r\n\r\n# Clients\r\nconnected_clients:1\r\nclient_recent_max_input_buffer:2\r\nclient_recent_max_output_buffer:20504\r\nblocked_clients:0\r\n\r\n# Memory\r\nused_memory:2132688\r\nused_memory_human:2.03M\r\nused_memory_rss:7667712\r\nused_memory_rss_human:7.31M\r\nused_memory_peak:2988272\r\nused_memory_peak_human:2.85M\r\nused_memory_peak_perc:71.37%\r\nused_memory_overhead:572870\r\nused_memory_startup:512456\r\nused_memory_dataset:1559818\r\nused_memory_dataset_perc:96.27%\r\nallocator_allocated:2655832\r\nallocator_active:3239936\r\nallocator_resident:7098368\r\ntotal_system_memory:16707932160\r\ntotal_system_memory_human:15.56G\r\nused_memory_lua:37888\r\nused_memory_lua_human:37.00K\r\nused_memory_scripts:0\r\nused_memory_scripts_human:0B\r\nnumber_of_cached_scripts:0\r\nmaxmemory:0\r\nmaxmemory_human:0B\r\nmaxmemory_policy:noeviction\r\nallocator_frag_ratio:1.22\r\nallocator_frag_bytes:584104\r\nallocator_rss_ratio:2.19\r\nallocator_rss_bytes:3858432\r\nrss_overhead_ratio:1.08\r\nrss_overhead_bytes:569344\r\nmem_fragmentation_ratio:3.70\r\nmem_fragmentation_bytes:5597904\r\nmem_not_counted_for_evict:0\r\nmem_replication_backlog:0\r\nmem_clients_slaves:0\r\nmem_clients_normal:49694\r\nmem_aof_buffer:0\r\nmem_allocator:jemalloc-5.1.0\r\nactive_defrag_running:0\r\nlazyfree_pending_objects:0\r\n\r\n# Persistence\r\nloading:0\r\nrdb_changes_since_last_save:0\r\nrdb_bgsave_in_progress:0\r\nrdb_last_save_time:1549899310\r\nrdb_last_bgsave_status:ok\r\nrdb_last_bgsave_time_sec:0\r\nrdb_current_bgsave_time_sec:-1\r\nrdb_last_cow_size:1269760\r\naof_enabled:0\r\naof_rewrite_in_progress:0\r\naof_rewrite_scheduled:0\r\naof_last_rewrite_time_sec:-1\r\naof_current_rewrite_time_sec:-1\r\naof_last_bgrewrite_status:ok\r\naof_last_write_status:ok\r\naof_last_cow_size:0\r\n\r\n# Stats\r\ntotal_connections_received:81\r\ntotal_commands_processed:3895\r\ninstantaneous_ops_per_sec:0\r\ntotal_net_input_bytes:3117796\r\ntotal_net_output_bytes:9256043\r\ninstantaneous_input_kbps:0.00\r\ninstantaneous_output_kbps:0.00\r\nrejected_connections:0\r\nsync_full:0\r\nsync_partial_ok:0\r\nsync_partial_err:0\r\nexpired_keys:0\r\nexpired_stale_perc:0.00\r\nexpired_time_cap_reached_count:0\r\nevicted_keys:0\r\nkeyspace_hits:1897\r\nkeyspace_misses:400\r\npubsub_channels:0\r\npubsub_patterns:0\r\nlatest_fork_usec:159\r\nmigrate_cached_sockets:0\r\nslave_expires_tracked_keys:0\r\nactive_defrag_hits:0\r\nactive_defrag_misses:0\r\nactive_defrag_key_hits:0\r\nactive_defrag_key_misses:0\r\n\r\n# Replication\r\nrole:master\r\nconnected_slaves:0\r\nmaster_replid:928ea24939c31a88a14f9f496bb1822da1d17828\r\nmaster_replid2:0000000000000000000000000000000000000000\r\nmaster_repl_offset:0\r\nsecond_repl_offset:-1\r\nrepl_backlog_active:0\r\nrepl_backlog_size:1048576\r\nrepl_backlog_first_byte_offset:0\r\nrepl_backlog_histlen:0\r\n\r\n# CPU\r\nused_cpu_sys:1.361721\r\nused_cpu_user:1.720340\r\nused_cpu_sys_children:0.002643\r\nused_cpu_user_children:0.013073\r\n\r\n# Cluster\r\ncluster_enabled:0\r\n\r\n# Keyspace\r\ndb0:keys=196,expires=24,avg_ttl=13891985<\/pre>\n<p>Then I refresh the same page (varnish cache is kicking off and redis as well). I noticed the page load faster than only from varnish. But not much. Probably from 10-12 seconds to 8-9 seconds. Here is the output from redis-cli info:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo redis-cli info\r\n# Server\r\nredis_version:5.0.3\r\nredis_git_sha1:00000000\r\nredis_git_dirty:0\r\nredis_build_id:45d60903d31a0894\r\nredis_mode:standalone\r\nos:Linux 4.15.0-38-generic x86_64\r\narch_bits:64\r\nmultiplexing_api:epoll\r\natomicvar_api:atomic-builtin\r\ngcc_version:5.4.0\r\nprocess_id:23212\r\nrun_id:0398df44fdf5d42687203813f129a4ad0753aca8\r\ntcp_port:6379\r\nuptime_in_seconds:2249\r\nuptime_in_days:0\r\nhz:10\r\nconfigured_hz:10\r\nlru_clock:6395501\r\nexecutable:\/usr\/bin\/redis-server\r\nconfig_file:\/etc\/redis\/redis.conf\r\n\r\n# Clients\r\nconnected_clients:1\r\nclient_recent_max_input_buffer:2\r\nclient_recent_max_output_buffer:0\r\nblocked_clients:0\r\n\r\n# Memory\r\nused_memory:2132688\r\nused_memory_human:2.03M\r\nused_memory_rss:7323648\r\nused_memory_rss_human:6.98M\r\nused_memory_peak:2988272\r\nused_memory_peak_human:2.85M\r\nused_memory_peak_perc:71.37%\r\nused_memory_overhead:572870\r\nused_memory_startup:512456\r\nused_memory_dataset:1559818\r\nused_memory_dataset_perc:96.27%\r\nallocator_allocated:2508448\r\nallocator_active:3112960\r\nallocator_resident:6602752\r\ntotal_system_memory:16707932160\r\ntotal_system_memory_human:15.56G\r\nused_memory_lua:37888\r\nused_memory_lua_human:37.00K\r\nused_memory_scripts:0\r\nused_memory_scripts_human:0B\r\nnumber_of_cached_scripts:0\r\nmaxmemory:0\r\nmaxmemory_human:0B\r\nmaxmemory_policy:noeviction\r\nallocator_frag_ratio:1.24\r\nallocator_frag_bytes:604512\r\nallocator_rss_ratio:2.12\r\nallocator_rss_bytes:3489792\r\nrss_overhead_ratio:1.11\r\nrss_overhead_bytes:720896\r\nmem_fragmentation_ratio:3.54\r\nmem_fragmentation_bytes:5253840\r\nmem_not_counted_for_evict:0\r\nmem_replication_backlog:0\r\nmem_clients_slaves:0\r\nmem_clients_normal:49694\r\nmem_aof_buffer:0\r\nmem_allocator:jemalloc-5.1.0\r\nactive_defrag_running:0\r\nlazyfree_pending_objects:0\r\n\r\n# Persistence\r\nloading:0\r\nrdb_changes_since_last_save:12\r\nrdb_bgsave_in_progress:0\r\nrdb_last_save_time:1549899310\r\nrdb_last_bgsave_status:ok\r\nrdb_last_bgsave_time_sec:0\r\nrdb_current_bgsave_time_sec:-1\r\nrdb_last_cow_size:1269760\r\naof_enabled:0\r\naof_rewrite_in_progress:0\r\naof_rewrite_scheduled:0\r\naof_last_rewrite_time_sec:-1\r\naof_current_rewrite_time_sec:-1\r\naof_last_bgrewrite_status:ok\r\naof_last_write_status:ok\r\naof_last_cow_size:0\r\n\r\n# Stats\r\ntotal_connections_received:118\r\ntotal_commands_processed:4554\r\ninstantaneous_ops_per_sec:0\r\ntotal_net_input_bytes:3180153\r\ntotal_net_output_bytes:14480169\r\ninstantaneous_input_kbps:0.00\r\ninstantaneous_output_kbps:0.00\r\nrejected_connections:0\r\nsync_full:0\r\nsync_partial_ok:0\r\nsync_partial_err:0\r\nexpired_keys:0\r\nexpired_stale_perc:0.00\r\nexpired_time_cap_reached_count:0\r\nevicted_keys:0\r\nkeyspace_hits:2473\r\nkeyspace_misses:404\r\npubsub_channels:0\r\npubsub_patterns:0\r\nlatest_fork_usec:159\r\nmigrate_cached_sockets:0\r\nslave_expires_tracked_keys:0\r\nactive_defrag_hits:0\r\nactive_defrag_misses:0\r\nactive_defrag_key_hits:0\r\nactive_defrag_key_misses:0\r\n\r\n# Replication\r\nrole:master\r\nconnected_slaves:0\r\nmaster_replid:928ea24939c31a88a14f9f496bb1822da1d17828\r\nmaster_replid2:0000000000000000000000000000000000000000\r\nmaster_repl_offset:0\r\nsecond_repl_offset:-1\r\nrepl_backlog_active:0\r\nrepl_backlog_size:1048576\r\nrepl_backlog_first_byte_offset:0\r\nrepl_backlog_histlen:0\r\n\r\n# CPU\r\nused_cpu_sys:1.420002\r\nused_cpu_user:1.755142\r\nused_cpu_sys_children:0.002643\r\nused_cpu_user_children:0.013073\r\n\r\n# Cluster\r\ncluster_enabled:0\r\n\r\n# Keyspace\r\ndb0:keys=196,expires=24,avg_ttl=14559389<\/pre>\n<p>I need to analyze these later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-redis-on-ubuntu-16-04 https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-secure-redis-on-ubuntu-18-04 Install Redis Server sudo add-apt-repository ppa:chris-lea\/redis-server sudo apt-get update sudo apt-get install redis-server Then modify \/etc\/redis\/redis.conf file. In the file, find the\u00a0supervised\u00a0directive. Currently, this is set to\u00a0no. Since we are running an operating system that uses the systemd init system, we can change this to\u00a0systemd: . . . # If you run &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/02\/11\/install-redis-and-combine-with-varnish-and-nginx-for-m2-on-ubuntu-16-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Redis and Combine With Varnish and Nginx for M2 On Ubuntu 16.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,98,13,17,78],"tags":[],"class_list":["post-3585","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento-tutorial","category-tutorial","category-ubuntu","category-ubuntu-16-04"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=3585"}],"version-history":[{"count":10,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3585\/revisions"}],"predecessor-version":[{"id":8763,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/3585\/revisions\/8763"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=3585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=3585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=3585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}