{"id":2050,"date":"2016-06-23T12:05:48","date_gmt":"2016-06-23T16:05:48","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2050"},"modified":"2017-04-19T15:59:02","modified_gmt":"2017-04-19T19:59:02","slug":"install-mytop-ubuntu-16","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/","title":{"rendered":"How to Install Mytop on Ubuntu 16"},"content":{"rendered":"<p>Database performance is critical to the speed of many applications. While many developers and administrators focus on connection speed, CPU use and other factors, the bottleneck is often an unoptimized database query or update. Further, poor database configuration can significantly constrain performance. Mytop is a great utility for investigating MySQL performance issues. This tutorial guides you through its installation and configuration.<\/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>) with Ubuntu 16.04 installed.<br \/>\n\u2022 A running MySQL\/MariaDB installation. <\/p>\n<p>For the purposes of this guide, it is assumed that MySQL is already installed, configured and running.<\/p>\n<h2>Tutorial<\/h2>\n<p>Let&#8217;s get started. First we need to install the Mytop package along with its dependencies.<\/p>\n<p><code> apt-get update<br \/>\napt-get install mytop -y<\/code><\/p>\n<p>Create a .mytop file in your root directory. This file will configure Mytop with default settings for the root user. The password line should contain your MySQL root password.<\/p>\n<p><code> cd \/root<br \/>\nnano .mytop<\/code><br \/>\n<code class=\"gris\">user=root<br \/>\npass=PASSWORD<br \/>\nhost=localhost<br \/>\ndb=mysql<br \/>\ndelay=1<br \/>\nport=3306<br \/>\nsocket=<br \/>\nbatchmode=0<br \/>\nheader=1<br \/>\ncolor=1<br \/>\nidle=1<br \/>\n<\/code><br \/>\nYou can now run the &#8220;mytop&#8221; command to connect to your MySQL database and examine its performance.<\/p>\n<p><code class=\"gris\">MySQL on localhost (5.5.47-MariaDB) up 0+00:47:45 [06:36:47]<br \/>\nQueries: 1.2k qps: 0 Slow: 0.0 Se\/In\/Up\/De(%): 56\/06\/13\/01<br \/>\nqps now: 2 Slow qps: 0.0 Threads: 1 ( 1\/ 0) 00\/00\/00\/00<br \/>\nKey Efficiency: 76.9% Bps in\/out: 260.6\/400.4 Now in\/out: 48.1\/11.2k<br \/>\nId User Host\/IP DB Time Cmd Query or State<br \/>\n-- ---- ------- -- ---- --- ----------<br \/>\n25 root localhost mysql 0 Query show full processlist <\/code><\/p>\n<p>Mytop gives you many statistics on your database&#8217;s operation. The first is your database&#8217;s uptime, how long it has been since the server starts. You&#8217;ll also see the number of active threads sorted by their idle times, along with a list of running queries.<\/p>\n<p>To learn how Mytop works, try running it on a server with an existing MySQL application. For instance, run it on a WordPress server and watch your metrics while browsing the site. WordPress is actively developed and optimized, so Mytop results will give you a sense for what you might expect to see with applications that behave well.<\/p>\n<p>Now, when another MySQL issue strikes, you have yet another diagnostic tool in your belt to determine what is wrong. If the number of running queries is high, it may be necessary to add additional indexes so they complete more quickly. If too many or few threads are active, a MySQL configuration tweak may be in order. &#8220;Explain&#8221; and other SQL features work on the database level, but sometimes it is necessary to examine the server itself in order to resolve an issue.<\/p>\n<h2>Conclusion<\/h2>\n<p>MySQL is a popular database at the core of many common internet-facing applications. Mytop is useful in diagnosing and resolving any issues with its configuration or operation, and is essential for anyone who depends on MySQL for any daily task. 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>Database performance is critical to the speed of many applications. While many developers and administrators focus on connection speed, CPU use and other factors, the bottleneck is often an unoptimized database query or update. Further, poor database configuration can significantly constrain performance. Mytop is a great utility for investigating MySQL performance issues. This tutorial guides<!-- 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":[72],"tags":[],"class_list":["post-2050","post","type-post","status-publish","format-standard","hentry","category-monitoring","operating_system-ubuntu-16-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Mytop on Ubuntu 16 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !\" \/>\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\/install-mytop-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 Install Mytop on Ubuntu 16 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-23T16:05:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-19T19:59:02+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\/install-mytop-ubuntu-16\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/\",\"name\":\"How to Install Mytop on Ubuntu 16 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"datePublished\":\"2016-06-23T16:05:48+00:00\",\"dateModified\":\"2017-04-19T19:59:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Mytop 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 Install Mytop on Ubuntu 16 - Globo.Tech","description":"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !","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\/install-mytop-ubuntu-16\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Mytop on Ubuntu 16 - Globo.Tech","og_description":"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !","og_url":"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/","og_site_name":"Globo.Tech","article_published_time":"2016-06-23T16:05:48+00:00","article_modified_time":"2017-04-19T19:59:02+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\/install-mytop-ubuntu-16\/","url":"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/","name":"How to Install Mytop on Ubuntu 16 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-06-23T16:05:48+00:00","dateModified":"2017-04-19T19:59:02+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will walk you through the installation of Mytop on your CentOS 7 server. Read now and start investigating MySQL performance issues !","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/install-mytop-ubuntu-16\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install Mytop 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\/2050","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=2050"}],"version-history":[{"count":10,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2050\/revisions"}],"predecessor-version":[{"id":2836,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2050\/revisions\/2836"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}