{"id":2177,"date":"2016-07-06T12:55:07","date_gmt":"2016-07-06T16:55:07","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2177"},"modified":"2017-12-12T15:42:17","modified_gmt":"2017-12-12T20:42:17","slug":"setup-memcache-ubuntu-16","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/","title":{"rendered":"How to Setup Memcache on Ubuntu 16"},"content":{"rendered":"<h1>How to Setup Memcache on Ubuntu 16<\/h1>\n<p>Memcache is an in-memory key-value store that is ideal for speeding up infrastructure. Perhaps a slow operation needs access to rarely-changing data, or files are accessed on slow storage systems. By integrating Memcache, the result of slow queries or reads can be keyed to a unique value, and future accesses can read the data directly from RAM. Memcache is a convenient infrastructural tool for speeding up a variety of slow operations.<\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) running Ubuntu 16.<br \/>\n\u2022 Root Access to your server<\/p>\n<p>When complete, you&#8217;ll have Memcache installed, along with the necessary components to integrate it into your LAMP app or service.<\/p>\n<h2>Tutorial<\/h2>\n<p>Begin by installing the Memcache daemon package, called memcached.<\/p>\n<p><code>apt-get install memcached -y<\/code><\/p>\n<p>Next we&#8217;ll need the Memcache PHP extension. This will provide the necessary functions to integrate Memcache into your applications, or to activate its support in apps for which integrations already exist.<\/p>\n<p><code>apt-get install php-memcached -y<\/code><\/p>\n<p>Memcached must now be configured. We&#8217;ll edit its configuration file to make a few key optimizations.<\/p>\n<p><code>nano \/etc\/memcached.conf<\/code><\/p>\n<p>Change this value to one that makes sense for your circumstances. Particular switches of interest are &#8220;-p&#8221; to change the memcached port, &#8220;-m&#8221; to allocate RAM to the cache, and &#8220;-c&#8221; to set the maximum connections allowed to the cache daemon.<\/p>\n<p>Once you&#8217;ve reconfigured memcached, and when the PHP module is installed, you&#8217;ll need to restart memcached. You&#8217;ll also need to restart Apache so any hosted apps pick up the new module.<\/p>\n<p><code>systemctl restart httpd.service<br \/>\nsystemctl restart memcached.servive<\/code><\/p>\n<p>Let&#8217;s ensure that the memcached module is loaded.<\/p>\n<p><code>php -m | grep memcached<br \/>\nmemcached<\/code><\/p>\n<p>We&#8217;ll now create a phpinfo page. This function dumps lots of valuable information on your PHP environment. This should include details on the memcached module.<\/p>\n<p><code>nano \/var\/www\/html\/index.php<\/code><\/p>\n<p><code class=\"gris\">&lt;?php<br \/>\nphpinfo();<br \/>\n?&gt;<\/code><\/p>\n<p>To run this page, visit http:\/\/your_ip\/index.php. Look for any information on your memcached module.<\/p>\n<h2>Conclusion<\/h2>\n<p>The Memcache service is now installed, enabled, and configured for your specific needs. The PHP module is also installed, and is available in your LAMP stack. Any PHP applications that might benefit from a fast, in-memory caching layer can now integrate with this new installation. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to Setup Memcache on Ubuntu 16 Memcache is an in-memory key-value store that is ideal for speeding up infrastructure. Perhaps a slow operation needs access to rarely-changing data, or files are accessed on slow storage systems. By integrating Memcache, the result of slow queries or reads can be keyed to a unique value, and<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-2177","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Setup Memcache on Ubuntu 16 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Setup Memcache on Ubuntu 16 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-06T16:55:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-12T20:42:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/\",\"name\":\"How to Setup Memcache on Ubuntu 16 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-07-06T16:55:07+00:00\",\"dateModified\":\"2017-12-12T20:42:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Setup Memcache on Ubuntu 16\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Setup Memcache on Ubuntu 16 - Globo.Tech","description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/","og_locale":"en_US","og_type":"article","og_title":"How to Setup Memcache on Ubuntu 16 - Globo.Tech","og_description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!","og_url":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/","og_site_name":"Globo.Tech","article_published_time":"2016-07-06T16:55:07+00:00","article_modified_time":"2017-12-12T20:42:17+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/","url":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/","name":"How to Setup Memcache on Ubuntu 16 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-07-06T16:55:07+00:00","dateModified":"2017-12-12T20:42:17+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will walk you through the setup of Memcache on your Ubuntu 16 Server. Read now and speed up everything from MySQL queries to REST requests!","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/setup-memcache-ubuntu-16\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Setup Memcache on Ubuntu 16"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2177"}],"version-history":[{"count":5,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2177\/revisions"}],"predecessor-version":[{"id":3981,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2177\/revisions\/3981"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}