{"id":16186,"date":"2024-10-30T10:56:09","date_gmt":"2024-10-30T10:56:09","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=16186"},"modified":"2024-10-30T11:45:17","modified_gmt":"2024-10-30T11:45:17","password":"","slug":"how-to-monitor-cpu-and-memory-usage-in-linux","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/","title":{"rendered":"How to Monitor CPU and Memory Usage in Linux"},"content":{"rendered":"\n<p>Monitoring CPU and memory usage is essential for managing Linux systems effectively. Linux provides several commands to get a detailed look at resource consumption, helping administrators optimize performance and troubleshoot issues. Here are some essential commands for monitoring CPU and memory usage.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Using <code>top<\/code> Command<\/strong><\/h4>\n\n\n\n<p>The <code>top<\/code> command is a popular utility that provides a real-time view of CPU and memory usage.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>To start <code>top<\/code><\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>top<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Key Features<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Shows CPU, memory, and swap usage.<\/li>\n\n\n\n<li>Displays a list of processes sorted by CPU usage by default.<\/li>\n\n\n\n<li>Press <code>M<\/code> to sort by memory usage. You may want to press shift+m<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1015\" height=\"374\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png\" alt=\"\" class=\"wp-image-16187\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png 1015w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646-300x111.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646-768x283.png 768w\" sizes=\"auto, (max-width: 1015px) 100vw, 1015px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Using <code>htop<\/code> Command<\/strong><\/h4>\n\n\n\n<p><code>htop<\/code> is an improved version of <code>top<\/code> with a more user-friendly interface.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install <code>htop<\/code><\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install htop # Debian\/Ubuntu\n\nsudo yum install htop # CentOS\/RHEL<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start <strong><code>htop<\/code><\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>htop<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Features<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Color-coded display for easy reading.<\/li>\n\n\n\n<li>Ability to scroll vertically and horizontally.<\/li>\n\n\n\n<li>Interactive interface to kill processes directly from the list.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"517\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-647-1024x517.png\" alt=\"\" class=\"wp-image-16188\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-647-1024x517.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-647-300x151.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-647-768x388.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-647.png 1232w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">3. <strong>Using <code>vmstat<\/code> Command<\/strong><\/h4>\n\n\n\n<p><code>vmstat<\/code> (Virtual Memory Statistics) reports information about processes, memory, paging, block I\/O, and CPU usage.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run vmstat with a delay:<\/strong>\n<ul class=\"wp-block-list\">\n<li>This will refresh every 2 seconds.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>vmstat 2<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Key Columns<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>r<\/code>: Number of processes waiting for CPU.<\/li>\n\n\n\n<li><code>free<\/code>: Amount of free memory.<\/li>\n\n\n\n<li><code>si<\/code> and <code>so<\/code>: Swap memory in and out.<\/li>\n\n\n\n<li><code>us<\/code>, <code>sy<\/code>, <code>id<\/code>: CPU time for user, system, and idle.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"397\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-648-1024x397.png\" alt=\"\" class=\"wp-image-16191\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-648-1024x397.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-648-300x116.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-648-768x298.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-648.png 1067w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">4. <strong>Using <code>free<\/code> Command<\/strong><\/h4>\n\n\n\n<p>The <code>free<\/code> command provides a quick overview of system memory usage, showing total, used, and available memory.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run <code>free<\/code> with human-readable format<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>free -h<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"175\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-649-1024x175.png\" alt=\"\" class=\"wp-image-16194\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-649-1024x175.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-649-300x51.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-649-768x132.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-649.png 1086w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>5. Using <code>sar<\/code> Command<\/strong><\/p>\n\n\n\n<p><code>sysstat<\/code>\u2019s <code>sar<\/code> command provides historical data on CPU, memory, and other resource usage over time. This is especially useful for identifying trends.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install sysstat<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install sysstat # Debian\/Ubuntu<br>sudo yum install sysstat # CentOS\/RHEL<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Enable Data Collection<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The <code>sysstat<\/code> service should be enabled and configured to collect data periodically.<\/li>\n\n\n\n<li><strong>Edit the Configuration File<\/strong>: Open the sysstat configuration file.<\/li>\n\n\n\n<li><strong>Set <code>ENABLED<\/code> to <code>\"true\"<\/code><\/strong>: Change the <code>ENABLED<\/code> line to <code>true<\/code> so that <code>sysstat<\/code> collects and logs system statistics.<\/li>\n\n\n\n<li>Save and close the file.<\/li>\n\n\n\n<li><strong>Restart the <code>sysstat<\/code> Service<\/strong>: After enabling data collection, restart the <code>sysstat<\/code> service to apply changes.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/default\/sysstat<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"985\" height=\"325\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-651.png\" alt=\"\" class=\"wp-image-16202\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-651.png 985w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-651-300x99.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-651-768x253.png 768w\" sizes=\"auto, (max-width: 985px) 100vw, 985px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart sysstat<\/code><\/pre>\n\n\n\n<p>You can then check the status <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status sysstat<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"245\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-652.png\" alt=\"\" class=\"wp-image-16205\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-652.png 1009w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-652-300x73.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-652-768x186.png 768w\" sizes=\"auto, (max-width: 1009px) 100vw, 1009px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>View CPU Usage over the past intervals<\/strong>:\n<ul class=\"wp-block-list\">\n<li>This example shows CPU usage at 1-second intervals, 5 times.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sar -u 1 5<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"174\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-650-1024x174.png\" alt=\"\" class=\"wp-image-16200\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-650-1024x174.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-650-300x51.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-650-768x130.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-650.png 1279w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>View Memory Usage:<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sar -r<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"173\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-653-1024x173.png\" alt=\"\" class=\"wp-image-16207\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-653-1024x173.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-653-300x51.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-653-768x130.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-653.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>6. Using <code>iostat<\/code> Command<\/strong><\/p>\n\n\n\n<p><code>iostat<\/code> is useful for monitoring CPU load and input\/output (I\/O) statistics on disks.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install <code>sysstat<\/code><\/strong> (if not already installed):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install sysstat # Debian\/Ubuntu<br>sudo yum install sysstat # CentOS\/RHEL<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run <code>iostat<\/code><\/strong>:\n<ul class=\"wp-block-list\">\n<li>This command shows CPU statistics at 2-second intervals.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>iostat -c 2<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"450\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-654.png\" alt=\"\" class=\"wp-image-16209\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-654.png 863w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-654-300x156.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-654-768x400.png 768w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/figure>\n\n\n\n<p>7. <strong>Using <code>ps<\/code> Command<\/strong><\/p>\n\n\n\n<p><code>ps<\/code> (Process Status) displays information about active processes and can be customized to show specific details.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>View Processes by Memory Usage<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux --sort=-%mem | head<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"236\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-655-1024x236.png\" alt=\"\" class=\"wp-image-16211\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-655-1024x236.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-655-300x69.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-655-768x177.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-655.png 1133w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>View Processes by CPU Usage<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux --sort=-%cpu | head<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"244\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-656-1024x244.png\" alt=\"\" class=\"wp-image-16212\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-656-1024x244.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-656-300x72.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-656-768x183.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-656.png 1057w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>8. <strong>Using <code>mpstat<\/code> Command<\/strong><\/p>\n\n\n\n<p><code>mpstat<\/code> (Multiprocessor Statistics) shows CPU usage per processor, which is valuable for multi-core systems.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run <code>mpstat<\/code><\/strong>:\n<ul class=\"wp-block-list\">\n<li>This will show statistics for each core on the system, helping to identify if any single core is overloaded.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mpstat -P ALL<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"159\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-658.png\" alt=\"\" class=\"wp-image-16215\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-658.png 911w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-658-300x52.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-658-768x134.png 768w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Summary of Commands<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>General Resource Overview<\/strong>: <code>top<\/code>, <code>htop<\/code><\/li>\n\n\n\n<li><strong>CPU Usage<\/strong>: <code>top<\/code>, <code>mpstat<\/code>, <code>sar -u<\/code><\/li>\n\n\n\n<li><strong>Memory Usage<\/strong>: <code>free<\/code>, <code>vmstat<\/code>, <code>sar -r<\/code><\/li>\n\n\n\n<li><strong>Disk I\/O<\/strong>: <code>iostat<\/code>, <code>vmstat<\/code><\/li>\n<\/ul>\n\n\n\n<p>With these commands, Linux administrators have a toolkit for continuous monitoring and diagnostics to manage system resources effectively.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monitoring CPU and memory usage is essential for managing Linux systems effectively. Linux provides several commands to get a detailed look at resource consumption, helping administrators optimize performance and troubleshoot issues. Here are some essential commands for monitoring CPU and memory usage. 1. Using top Command The top command is a popular utility that provides [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1824,1879,2128],"doc_tag":[],"class_list":["post-16186","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-07","word_count":556,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Monitor CPU and Memory Usage in Linux -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Monitor CPU and Memory Usage in Linux -\" \/>\n<meta property=\"og:description\" content=\"Monitoring CPU and memory usage is essential for managing Linux systems effectively. Linux provides several commands to get a detailed look at resource consumption, helping administrators optimize performance and troubleshoot issues. Here are some essential commands for monitoring CPU and memory usage. 1. Using top Command The top command is a popular utility that provides [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-30T11:45:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/\",\"name\":\"How to Monitor CPU and Memory Usage in Linux -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-646.png\",\"datePublished\":\"2024-10-30T10:56:09+00:00\",\"dateModified\":\"2024-10-30T11:45:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-646.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-646.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-monitor-cpu-and-memory-usage-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Monitor CPU and Memory Usage in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Monitor CPU and Memory Usage in Linux -","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:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Monitor CPU and Memory Usage in Linux -","og_description":"Monitoring CPU and memory usage is essential for managing Linux systems effectively. Linux provides several commands to get a detailed look at resource consumption, helping administrators optimize performance and troubleshoot issues. Here are some essential commands for monitoring CPU and memory usage. 1. Using top Command The top command is a popular utility that provides [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/","article_modified_time":"2024-10-30T11:45:17+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/","name":"How to Monitor CPU and Memory Usage in Linux -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png","datePublished":"2024-10-30T10:56:09+00:00","dateModified":"2024-10-30T11:45:17+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-646.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-monitor-cpu-and-memory-usage-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Monitor CPU and Memory Usage in Linux"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=16186"}],"version-history":[{"count":10,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16186\/revisions"}],"predecessor-version":[{"id":16216,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16186\/revisions\/16216"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=16186"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=16186"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=16186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}