Monitoring – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Fri, 29 Jan 2021 03:29:00 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 Best Curved Computer Monitors https://linuxhint.com/best-curved-computer-monitors/ Wed, 27 Jan 2021 13:20:48 +0000 https://linuxhint.com/?p=87727 To achieve a more immersive work experience, the best-curved computer monitors are the way to go. Unlike flat panels, they lend a feeling of dimensionality by giving you a wider field of view with minimum edge distortion. It’s also said that curved monitors reduce eye strain.

The curved monitors aren’t just meant for gamers, though. Yes, they enhance the gaming experience and the overall vibe. However, such curved computer monitors pay off for graphic designing, video and photo editing, and much more.

After testing more than 50 curved computer monitors, we confidently bring you the top five of the bunch. You can check out their reviews to get a better understanding of what you’re getting. But first, let’s look at our buyer’s guide section for some buying tips.

Buyer’s Guide

Curvature

Even the best-curved computer monitors are curved at different angles. In general, monitors for ultra-wide productivity and gaming tend to be more curved. What you need to take care of are the height and tilt adjustment.

As not every desk measures the same in height, so to be able to view your screen without having to hold your neck at an odd angle would be great. Look for VESA mounting, too, if you lack the space required by curved monitors (as they tend to come in large sizes).

Resolution

Curved monitors are better off being in a range of 25+ inches. They are also ultra-wide with 21:9 or 32:9 aspect ratios. The former usually have WQHD (3,440×1,440) resolution, while the latter tend to have native resolutions of either 5,120×1,440 pixels or 3,840×1,080 pixels.

Overall, the more pixel you can muster in the price you pay, the better will it be. The monitors mentioned below are known for their color depth, contrast, and high resolutions.

Ports

Try to get more ports (HDMI, DisplayPort, USB, and other peripherals) to increase connectivity. Do look out for ports that face downward. As in many monitors, these do hide the cable cluttering but prevent you from connecting anything else once the setup has been done.

Controls

General-purpose curved displays have various buttons to control the onscreen display. Gaming and professional monitors, on the other hand, feature 4-way mini joystick controls. These controllers are easier to use and manage than buttons.

1. Sceptre Curved 27 inches

Coming in first on our best-curved computer monitors list, we have a computer monitor known for its user-friendly features. The Sceptre’s immersive design measuring 27 inches (diagonally), is an edgeless monitor. The lack of borders captivate you fully to what’s happening on the screen and look impeccably chic at the same time.

The impressive 1080p resolution and a 75Hz fast refresh rate have got to make this monitor worth checking out. Moreover, the fast response rate ensures close to minimize instances of ghosting and blurring while transitioning pixels. So, when gaming, you won’t lose the enemy from sight, even if it is for a small instant.

The monitor has built-in speakers that produce smooth and robust sound. This means you don’t have to invest extra money or desk space to get audio. But wait, there’s more!

The curved monitor already has your eye exertion to a minimum. Its Blue light shift further lessens strain to your eyes that results from the bright light and colors. You can even tilt this monitor 15 degrees backward, and 5 degrees forward and give your head and neck muscles a break.

This monitor can be wall-mounted or left on stands. The scepter’s cons include its lack of ports and the speakers lacking the full range of features you get from dedicated speakers.

Buy Here: Amazon

2. SAMSUNG LC24F396FHNXZ 23.5 Inches

Samsung knows it all when it comes to electronics. This specific computer monitor is excellent value for money, yet still packed with the Samsung goodness we all know and love.

The screen is 23.5 inches, 1800 R curvature (details mentioned above). The exaggerated curve delivers an immersive experience, even for a small screen like this: the black body, metallic finish, and sleek curves all scream finesse.

As for functionality, it comes with 4(GTG)ms response time and AMD Free Sync, which minimizes input latency and prevents image tearing and stutter, especially during gaming. Picture quality stays unwavering, thanks to its 3000:1 contrast ratio, which popping black and whites. This monitor has your eyes covered too. Its Eye Saver Mode maximizes viewing comfort. This is done by cutting down blue light emissions and flickers.

Handling this monitor screen is relatively easy. Its lightweight and 0.5-inch slim design make setting up your work station quick and easy. You can either add a modern look by setting it on its circular stand or even mount it on a wall to add space on your desk.

Stunning colors, fast response time, and power-saving features make it worth your while. However, these computer monitors do not match the Samsung LED TV quality (at such a low price). It is a premier monitor, but with no additional features like USB or speakers.

Buy Here: Amazon

3. Philips Computer Monitor 322E1C – 32 Inches

Another curved wonder, ready to embrace you in its high-resolution folds. If you are looking for something big yet manageable by your working desk, better get your hands on the Philips E Line- 32 inch.

With a resolution of 1920×1080 and an ultra-wide viewing angle, the Full HD LED monitor, boosting with accurate color reproduction, makes the monitor highly captivating. You also get the Philips VA display. This is a multi-domain vertical alignment technology that promises sharp and high static contrast ratios.

The screen bounded by a 3-sided frameless design with ultra-narrow borders can respond with 4ms, 75 Hz refresh rate, and Adaptive-Sync technology. This exhibits a fluid and glitch-free gaming routine. The monitor comes with a wide range of external connectivity options, which aren’t provided in budget curved monitors.

Enjoy minimal distractions and the ability to expand your workspace through multiple monitor setups. The LowBlue mode features shortwave blue light and promises flicker-free screen performance. Furthermore, Philips lets you bid farewell, which a chance to conceal cables. Elongated slots and hidden storage for cables clean up a messy table.

That said, this monitor does come with some downsides. The viewing angle isn’t great when not positioned directly in front. And the monitor itself is also a bit bulkier than the previously mentioned screens.

Buy Here: Amazon

4. LG 34WN80C-B 34 Inches

LG needs no introduction. And it doesn’t disappoint in the field of curved monitors either. The 34-inch LED display brands a QHD Ultra-Wide 1440p worth of resolution. This supplies you with added space to maximize multitasking, making this model one of the best-curved computer monitors in the market today.

The perfect color fidelity provides a 99% coverage of the sRGB spectrum, and the HDR 10 collectively serve a detailed contrast.

The monitor can easily adjust to various heights through its tilting mechanism. Thanks to its ergonomic design, the adjustable stand lets your muscles relax while you unleash your productivity. This is further aided through its ability to support split-screen management and full control through the application pre-set.

Even the monitor’s stand height is of an adequate length. Moreover, the new USB Type C allows much wider connectivity.

If you plan to use this curved monitor solely for gaming, then remember that the response rate lacks in contrast to other monitors. You will have to say goodbye to demanding games.

Buy Here: Amazon

5. Samsung C49J890DKN, C980 Series, 49 Inches

What to do with ample desk space? Go big! The Samsung C980 series have put all other curved monitors to shame with their gigantic 49-inch computer monitor. The ultra-wide monitor is perfect for handling hefty businesses, with a whopping aspect ratio 0f 32:9.

You can go not only split-screen with the monitor but also enjoy side-by-side or picture-in-picture from up to two computers! Now that’s multitasking! Other monitor features include adjustable stand, swivel, and tilt features to smoothen your workflow. All of this is backed by a 1800R ultra-curved screen, working its best to reduce eye strain. That’s not all, though!

The refresh rate ranges up to 144Hz, which means you will not face any blurs, flickers, or even ghosting. Unleash all the fast-moving content/ games as it is no biggie for this monitor to handle.

To maximize connectivity, you will be provided with 2 USB C ports to attach to a multitude of devices. There is also an integrated KVM switch, which is the main enabling factor in connecting two computers together with ease, using a single set of peripherals.

Though the size is its wow factor, it is also its most excellent con. The set is quite bulky and heavy. Plus, it takes too much space and cannot even be mounted on a wall. Apart from that, it also comes at a hefty price.

Buy Here: Amazon

Final Thoughts

Whether it is for a pro gaming experience or a long work haul, the best-curved computer monitors are a great way to reduce fatigue, the strain on your eyes, help with posture and keep your productivity at a max. They keep the display at a secure distance from your face and manage to immerse you in entirely with their 3D-esque graphics. Go get yours!

]]>
Analyzing Linux Server Performance with “atop” https://linuxhint.com/analyze-linux-server-performance-atop/ Fri, 01 Jan 2021 12:47:11 +0000 https://linuxhint.com/?p=83810 If you perform some resource-hungry operations on your Linux server, it is mandatory for you to analyze its performance continuously. The Advanced System and Process Monitor, or “atop” is a very useful utility for the Linux environment that is used to analyze the server’s performance. It can either be used to generate a detailed Linux server performance report, or you can even view specific performance statistics. We will be going to elaborate on the procedures of doing all this with you in today’s article.

Note: We will be using Linux Mint 20 for analyzing the Linux server performance with “atop”.

Analyzing Linux Server Performance with the “atop” Utility

For analyzing your Linux server’s performance with “atop”, you should ideally perform all the steps listed over here:

Step 1: Update your Linux Mint 20 System

Before installing the “atop” utility on your Linux Mint 20 system, you have to update it by executing the below-affixed command:

$ sudo apt update

When the Linux Mint 20 system updates, it will cause the messages shown in the image below to appear on your terminal:

Step 2: Install the “atop” utility on your Linux Mint 20 System

For installing the “atop” utility on your Linux Mint 20 system, you have to run the following command:

$ sudo apt install atop

The “atop” utility will take some time to install, after which you will be capable of using it immediately.

Step 3: Check the Manual for the “atop” Utility

There is a dedicated manual for the “atop” utility, which you can check out before using this utility. This manual will help you a lot in understanding the proper working and usage of this utility. The manual of “atop” can be accessed by running the following command:

$ man atop

The main pages of the “atop” utility are shown in the image below:

Step 4: Check the Help Pages for the “atop” Utility

For knowing about the different variations and options that can be used with the “atop” utility in Linux Mint 20, you can access its help pages with the following command:

$ atop --help

The help pages of the “atop” utility are shown in the image below:

Step 5: Run the “atop” utility on your Linux Mint 20 System to Analyze its Performance

Once we have clearly understood the usage of the “atop” utility, we can easily run it on Linux Mint 20 to analyze its performance in the following manner:

$ atop

The standard performance output of the Linux Mint 20 system by running the “atop” utility on it is shown in the image below:

Some Specific Uses of the “atop” Utility

Above, we have seen a very comprehensive Linux server performance report generated by the “atop” utility in Linux Mint 20. However, if you only wish to view some specific performance statistics, then you can use the methods shown below:

Check the Active Processes with the “atop” Utility

For checking the information related to the active processes only using the “atop” utility, you can use it in the following manner:

$ atop –a

The performance information regarding the active processes in Linux Mint 20 is shown in the image below:

Check the Disk Info with the “atop” Utility

For checking all the disk-related information only using the “atop” utility, you can use it in the following manner:

$ atop –d

In our case, since no disk related activity was taking place at the moment, we run this command; that is why no specific disk-related information was available, as shown in the image below. However, if you will run the “atop” utility in this manner on your machine while your disk is being engaged, then you will surely be able to see all the relevant information.

Check the Memory Info with the “atop” Utility

For checking all the memory-related info only using the “atop” utility, you can use it in the following manner:

$ atop –m

The memory information regarding our Linux Mint 20 system is shown in the image below:

Check the Network Info with the “atop” Utility

For checking all the network-related info only using the “atop” utility, you can use it in the following manner:

$ atop –n

In our case, since the network kernel module was not active at the moment, we run this command; that is why no specific network-related information was available, as shown in the image below. However, if you will run the “atop” utility in this manner on your machine while your network kernel module is active, then you will surely be able to see all the relevant information.

Check the Scheduling Info with the “atop” Utility

For checking all the scheduling info only using the “atop” utility, you can use it in the following manner:

$ atop –s

The scheduling info regarding our Linux Mint 20 system is shown in the image below:

Check the Individual Threads with the “atop” Utility

You can even view all the information regarding specific threads with the “atop” utility in the following manner:

$ atop –y

The information regarding the individual threads on our Linux Mint 20 system is shown in the image below:

Conclusion

This article explained some of the most useful ways in which you can utilize the “atop” utility for analyzing your Linux mint 20 server’s performance. You can take a glance at all the performance metrics of your Linux server at once. Also, you can even view the individual performance-related statistics using this utility. All you have to do is to install it on your Linux Mint 20 system, check out its help pages to understand its usage, and then start using it right away.

]]>
Linux Monitoring Tools: The Definitive Guide https://linuxhint.com/linux_monitoring_tools_def_guide/ Mon, 13 Apr 2020 12:49:49 +0000 https://linuxhint.com/?p=58155 If you’re an IT specialist dealing with Linux systems, implementing Linux monitoring tools is essential to ensure the health of the software. With a wide range of network monitoring tools for Linux from open-source to closed-source, it might be difficult to make a final choice. And to decide correctly, you need to know precisely what you want from your Linux monitoring tool.In this article, we will discuss some points you need to keep in mind when deciding and make an overview of the best one open source monitoring tools.As you attempt to make your decision, you’ll need to consider the type of hardware and software you’re going to monitor with the tool, the scalability and size of your network, the budget with which you are working and type of support you expect to have.

How To Choose Linux Monitoring Tools:

Open-Source or Closed

The first point you need to keep in mind is whether you want an open-source setup or a closed-source one. The main drawback of closed-source software is that it is paid. But if you’re dealing with a huge network, though, and you don’t have the time to troubleshoot with the help of online forums, then that might be the way to go. With closed-source, anytime you can ask for and get instant customer support. That alone can be well worth the initial fee if you have a question or concern.

With closed-source software, you also get streamlined usability and usually higher levels of protection as well. Open-source software, by contrast, is challenging to hack, but not impossible.

Scalability

When you’re going to choose your network monitoring tool, you should take into account the scalability and size of your network. Because a lot of open-source software is designed particularly for smaller-sized systems.

If you are running an extensive corporate network with many nodes, then you shouldn’t even be considering something like the next tools: SolarWinds NetFlow Traffic Analyzer or Paessler PRTG Network Monitor. These services would be appropriate for those large-scale networks that might need to expand their user numbers with virtually no warning.

Another option to consider might be such a service like Ganglia. This one is highly scalable but has such cons as lack of automatic data analysis. Such tools like SolarWinds NTA or Nagios Network Analyzer are more comprehensive and suitable for their security alert setups and real-time analysis.

Support

What others need to consider when looking for Linux monitoring tools. It is vital that you think about the level of support that you need. When you look into open-source programs, you should be ready that there is no support service, except the users’ community. Hence, you should be aware of their online user community and how it’s active. But if you prefer getting instant support or your business needs require that, then the open-source software with a ready-to-help customer support team would be a better choice for you. Moreover, some tools like EventSentry Light offer a quick alert system and troubleshooting of any issue.

Overview of The Best Open-Source Linux Network Monitoring Tools

Some drawbacks of open-source monitoring are that these tools tend to be more time-consuming to use, and they can also be less user-friendly. You also sometimes run into malicious edits with them, which is almost unheard of with a closed-source program. But the most open-source tools have a lot of features as closed-source services and even more and are free. That is especially true when there’s a robust online user community that you can appeal to for advice if you need it.

Nagios

With Nagios, you’re capable of monitoring nearly any type of component. Those would include websites, middleware, system metrics, network protocols, operating systems, applications, web servers, and more.

Nagios is based on what is called a Core 4 engine for monitoring. You’re getting a high level of performance and the consumption of fewer server resources. Integration is supported with many of the popular third-party software options through plugins. Most likely, someone else will already have written it, saving you the trouble of doing so.

Nagios has a comprehensive report of the entire monitored IT infrastructure. Moreover, it has event handlers that grant automatic restarting of failed applications. The next features make this network monitoring tool one of the most useful: multi-user access, the selective access feature that allows clients to view only infrastructure components that are about them, highly scalable architecture

Additionally, the service has an extremely active community, boasting over 1 million users that are ready to help you if any.

Icinga 2

Icinga 2 runs on the base of the original Icinga but has some modifications. It is popular among IT specialists for its live monitoring tools and scalability.

Icinga 2 suits perfectly for Linux as well as for other operating systems. It can measure the more sizable networks and provide analysis through charts and color-coded graphs. With its interactive visual monitoring dashboards, network monitoring becomes easy. It uses openly-sourced API technology developed by the community. Icinga 2 monitors the systems at high speeds and produces data visualization dashboards in real-time.

OpenNMS

OpenNMS allows you to build a network monitoring tool for virtually any type of IT infrastructure. The software gathers system metrics using HTTP, NRPE, JMX, WMI, SNMP, XML, JDBC, XML, JSON, and others. It is designed on event-driven architecture, and it supports Grafana as well.

OpenNMS comes with integrated reporting capabilities allowing you to have real-time reports within an intuitive dashboard and chart setup. Overall, OpenNMS has a user interface that is widely considered to be excellent.

It’s specially designed for Linux but supports Solaris, Windows, and OSX

It has a lot of helpful features as device temperature monitoring functionality, highly customizable admin dashboard, efficient supply monitoring, IPv4 and IPv6 support. The service allows you to set custom notification via SMS, email, XMPP, and other methods on specific events. What else is worth to mention, that there’s a geographical node map to show nodes and service outages using Google Maps, Open Street Map, or MapQuest

Cacti

Cacti is one of the best-known names in open-source network monitoring software. It can be installed on either Linux or Windows OS. It allows multiple users to log network data and monitor network devices. The platform provides extensive privacy settings management to define different user types with different access levels.

You can define unlimited graph items with it utilizing CDEF or data sources. Auto-padding graph support comes with it. It also supports RRD, or Round-Robin Database files. These have more than one data source. They can also make use of an RRD file that is stored ay any point throughout the local file system.

This tool has also such useful features as user-based management and security and custom data-gathering scripts

Zabbix

Zabbix is another popular network monitoring service compatible with Linux and Unix. This makes it popular for all sorts of individuals in the IT community.

Zabbix bears some resemblance to Cacti. One of the advantages of service is a well-established online community. The tool gives you a visual dashboard that has monitoring functions. You can detect and keep track of changes in network activity and disk space through a series of alerts. You can also track CPU load with the platform for checking activity on your network.

Based on frameworks such as ICMP, SNMP, and TCP, Zabbix can detect network issues and function lags. It also uses open-source alert software that will notify the central control if there is ever a network malfunction.

Checkmk

If you are looking for an easy way to set up a monitoring that suits any environment, you should have a look at Checkmk. The tool monitors servers, networks, cloud assets, databases, containers, IoT and more. Checkmk runs under Linux, as a virtual or physical appliance, or in a Docker container. All of its components are delivered fully integrated, so setting up an instance takes only minutes.

Checkmk Monitoring Overview Screen

Thanks to the rule-based 1:n configuration, as well as a high degree of automation to accelerate workflows, users are able to manage the monitoring for even large environments in just a few minutes. Powerful auto-discovery functions, automated agent updates and other features reduce your time and effort spent on monitoring.

The Checkmk Raw Edition is completely open-source and offers free and unlimited monitoring. The Checkmk Enterprise Edition comes with additional functionalities. Thanks to its 1,900 officially-available plug-ins (all of which are licensed under GPLv2), Checkmk is suitable for many user scenarios. The architecture of Checkmk is highly efficient and supports distributed monitoring. This will enable you to monitor several hundred thousand services from one instance, and to easily manage distributed environments with up to several hundred instances.

The company behind Checkmk is tribe29 and this has managed to create a scalable tool with a user-friendly graphical interface. Not surprisingly, the Checkmk user community is expanding at a great rate. Today more than 2,000 organizations trust in Checkmk. The users are companies of all sizes as well as governmental institutions – often with multiple data centers and very large-scale set-ups.

LibreNMS

LibreNMS is known mainly for its quick response program. It is so efficient because of well-designed open-source API software with collections of real-time monitoring checks and reports.

LibreNMS is potentially quite useful. It provides automated updates on the performance of your network with a smart built-in alert system.

It also provides API communication capability with network systems that are horizontally-scalable. The architecture allows you to monitor many nodes through the central control system. There is another advantage of using LibreNMS as well: it supports both iOS and Android equally effectively. It even supports virtual machines, if you are hunting for a tool with that compatibility.

Prometheus

Prometheus is well-supported with both Linux and Unix systems and serves as an efficient and free network monitoring tool. It also gives you handy graphical visualization features through its integration with the Grafana graphing program.

It has a built-in PromQL feature that also gives you a customizable visualization of its interface. You’ll see that it doesn’t have quite the community support as some others on this list, like Zabbix and Cacti. It is worth noticing that for the last time the number of large companies using Prometheus is growing steadily, almost ensuring that you will see more of it in the years to come.

Observium Community

It’s a perfect Linux network monitoring tool targeted for small server systems. It has a professional online development environment that ensures the tool is frequently updated. It has support for the most frequently used operating systems and uses standard SNMP network monitoring.

Observium has a noteworthy collection of monitoring features for its users. There is also a visual dashboard system and an extensive online support network. But the drawbacks are that its aspirations, though, remain on a small scale as it isn’t the best match for large-scale networks and doesn’t provide updates in real-time and notifications regarding network activity.

Monitorix

Monitorix is a Unix and Linux-based server monitoring tool that is small-scale.

Although it works best with smaller servers, it does provide you many system monitoring functions. It can monitor things like data consumption, network capabilities, or disk drive heat. This ensures that the user can always observe all of the most critical features of the network’s operation. This tool also offers powerful color-coded graphs and charts with which you can build visual trends analysis.

Htop

Htop is an easily-adjusted monitoring tool program that supports both Linux and Unix-based systems.

Some say that it is not the most visually friendly monitoring software. Still, it is useful for providing live updates on things like storage capacity and network activity. You should also appreciate its intuitive color-coding system.

BWM-NG

The last monitoring tool on our list is BWM-NG. This is a flexible, useful program that is intended primarily for small-network monitoring platforms that support Linux. The platform has multi-service compatibility with both Windows OS and Linux. It is mainly designed for bandwidth monitoring. If you’re looking for this particular feature, this might be the tool for you.

The program is similar in some ways to the previous BWM. It is still in beta, but it has a very active online community that can help you with any issue, though.

Now, you have an overview of the more popular Linux monitoring tools that are available today. If you are using Linux, then think about which one of these is going to be suitable for your needs.

]]>
Using ps command on linux https://linuxhint.com/ps_command_linux-2/ Sun, 05 May 2019 12:38:17 +0000 https://linuxhint.com/?p=39692 The command “ps” will show the processes status as snapshot. In contrast with Microsoft Windows which shows processes status in live view. In Linux, if we want a live view of the processes we need to use the command top which we won’t explain in this tutorial limited to ps.

Let’s try to run ps without any additional parameter just by running:

ps

As we can see we have 4 columns:

PID: Process ID, shows the process identification number.

TTY: Identifies the terminal from which the process was executed.

TIME: Shows the processor’s time occupied by the program.

CMD: Shows the command used to launch the process.

The ps default output without parameters as you can see will only list the processes executed by root.

If we want to check the processes ran by every user then run:

ps -a

Now we can see the processes executed by all users.  Usually when we use the command ps we add parameters like -a, -x and -u.

While -a lists processes started by all users, -x also lists processes started at boot like daemons, the parameter -u will add columns with additional information on each process:

ps -axu

We can see now all processes, executed by all users, by the system itself and we also got additional information on each process:

USER: Specifies the user who executed the program.

PID: Process ID, shows the process identification number.

CPU%: The processor % used by the process.

MEME%: The memory % used by the process.

VSZ: The virtual size in kbytes.

RSS: In contrast with the  virtual size, this shows the real memory used by the process.

TTY: Identifies the terminal from which the process was executed.

STATE: Shows information on the process’ state just as it’s priority, by running “man ps” you can see codes meaning.

START: Show when the process has started.

TIME: Shows the processor’s time occupied by the program.

CMD: Shows the command used to launch the process.

To list the processes executed by a specific user you can run:

ps -U username

After we understood how to use ps to show processes, let’s check how to stop them.

In Linux the command kill is the one used to stop processes. We can run “kill PIDNUMBER” to stop a process:

As you can see, I killed a process started by Gimp, but if we run ps -axu again we’ll see Gimp is still running:

What we need to do to assure the program’s closure is to kill all it’s processes, including parent processes, we can do it by adding the parameter -9:

kill -9 PIDNUMBER

As you can see this time the process was killed, since I tried to kill it twice and the second time the system told me the process wasn’t available, we can run ps -axu again to be sure:

 The command killall can be used to kill all processes associated with a program’s name:

As you can see in the image above LibreOffice is running now, let’s see what happens when I run:

killall soffice.bin

 
Let’s check ps -axu again:


As we can see LibreOffice was closed.

I hope you found this article useful to manage Linux processes. Keep following us on LinuxHint for more tips and updates on Linux.

]]>
How to Monitor Disk IO in Linux https://linuxhint.com/monitor_disk_io_linux/ Wed, 20 Mar 2019 03:06:32 +0000 https://linuxhint.com/?p=37776 iostat is used to get the input/output statistics for storage devices and partitions. iostat is a part of the sysstat package. With iostat, you can monitor the read/write speeds of your storage devices (such as hard disk drives, SSDs) and partitions (disk partitions). In this article, I am going to show you how to monitor disk input/output using iostat in Linux. So, let’s get started.

Installing iostat on Ubuntu/Debian:

The iostat command is not available on Ubuntu/Debian by default. But, you can easily install the sysstat package from the official package repository of Ubuntu/Debian using the APT package manager. iostat is a part of the sysstat package as I’ve mentioned before.

First, update the APT package repository cache with the following command:

$ sudo apt update

Now, install the sysstat package with the following command:

$ sudo apt install sysstat

sysstat package should be installed.

Installing iostat on CentOS 7:

iostat is not available on CentOS 7 by default. But, the sysstat package is available in the official package repository of CentOS 7. So, you can easily install it with the YUM package manager.

To install sysstat with the YUM package manager, run the following command:

$ sudo yum install sysstat

Now, press y and then press <Enter> to continue.

Now, press y and then press <Enter> to accept the GPG key of the CentOS 7 package repository.

sysstat should be installed.

Installing iostat on Arch Linux:

iostat is not available on Arch Linux by default. But, the sysstat package is available in the official package repository of Arch Linux. So, you can easily install it with the Pacman package manager.

To install sysstat, run the following command:

$ sudo pacman -Sy sysstat

Now, press y and then press <Enter> to continue.

sysstat should be installed.

Basic Usage of iostat:

You can monitor all the storage devices and disk partitions of your computer with iostat as follows:

$ sudo iostat

As you can see, iostat generated a report of read/write speeds (in kilobytes/second or kB/s) and total reads/writes (in kB) of every storage devices and partitions at that time.

In the above command, iostat prints the statistics at the instance you ran iostat only. This is good for shell scripting and automation.

If you want to see real time statistics, then you can tell iostat to update the report every n seconds (let’s say 2 seconds) interval as follows:

$ sudo iostat -d 2

As you can see, iostat is updating the report every 2 seconds.

Monitoring Specific Storage Devices or Partitions with iostat:

By default, iostat monitors all the storage devices of your computer. But, you can monitor specific storage devices (such as sda, sdb etc) or specific partitions (such as sda1, sda2, sdb4 etc) with iostat as well.

For example, to monitor the storage device sda only, run iostat as follows:

$ sudo iostat sda

Or

$ sudo iostat -d 2 sda

As you can see, only the storage device sda is monitored.

You can also monitor multiple storage devices with iostat.

For example, to monitor the storage devices sda and sdb, run iostat as follows:

$ sudo iostat sda sdb

Or

$ sudo iostat -d 2 sda sdb

If you want to monitor specific partitions, then you can do so as well.

For example, let’s say, you want to monitor the partitions sda1 and sda2, then run iostat as follows:

$ sudo iostat sda1 sda2

Or

$ sudo iostat -d 2 sda1 sda2

As you can see, only the partitions sda1 and sda2 are monitored.

Monitoring LVM Devices with iostat:

You can monitor the LVM devices of your computer with the -N option of iostat.

To monitor the LVM devices of your Linux machine as well, run iostat as follows:

$ sudo iostat -N -d 2

You can also monitor specific LVM logical volume as well.

For example, to monitor the LVM logical volume centos-root (let’s say), run iostat as follows:

$ sudo iostat -N -d 2 centos-root

Changing the Units of iostat:

By default, iostat generates reports in kilobytes (kB) unit. But there are options that you can use to change the unit.

For example, to change the unit to megabytes (MB), use the -m option of iostat.

You can also change the unit to human readable with the -h option of iostat. Human readable format will automatically pick the right unit depending on the available data.

To change the unit to megabytes, run iostat as follows:

$ sudo iostat -m -d 2 sda

To change the unit to human readable format, run iostat as follows:

$ sudo iostat -h -d 2 sda

I copied as file and as you can see, the unit is now in megabytes (MB).

It changed to kilobytes (kB) as soon as the file copy is over.

Extended Display of iostat:

If you want, you can display a lot more information about disk i/o with iostat. To do that, use the -x option of iostat.

For example, to display extended information about disk i/o, run iostat as follows:

$ sudo iostat -x -d 2 sda

You can find what each of these fields (rrqm/s, %wrqm etc) means in the man page of iostat.

Getting Help:

If you need more information on each of the supported options of iostat and what each of the fields of iostat means, I recommend you take a look at the man page of iostat.

You can access the man page of iostat with the following command:

$ man iostat

So, that’s how you use iostat in Linux. Thanks for reading this article.

]]>
How to Use the ps Command to Find Running Processes on Linux https://linuxhint.com/ps_command_linux/ Wed, 06 Feb 2019 10:57:53 +0000 https://linuxhint.com/?p=36241 The full form of ps is process status. It is a command used to find information about currently running processes on Linux. ps is a very important command of Linux.In this article, I will show you how to use the ps command to find running processes on Linux. So, let’s get started.

Different Types of Options:

The ps command accepts different options.

  1. UNIX options – have leading dash.
    $ ps -e
  1. BSD options – don’t have leading dash.
    $ ps aux
  1. GNU options – have double leading dash.
    $ ps --pid 1001

In this example, I will use the UNIX and at times GNU options. But the BSD options are similar. Most of the time, you can mix them together without any problems. Although, you can’t mix some of the options together as it won’t work. So, be careful.

Finding All Running Processes:

With ps command, you can find all the running processes on your machine.

To find all the running processes with ps, use ps as follows,

$ ps -ef

As you can see, the UID (User ID), PID (process ID), PPID (parent process ID), CMD (command used to run the process) and some other information about all the running processes are displayed.

You can list all the running processes with different ps options combination. They will show different information about the running processes. You can actually tell ps to display specific information, which we will get to in the later section.

$ ps -e

As you can see, ps -e shows the PID, TTY (terminal number), TIME (process running time) and CMD of the running processes. That’s a lot less information than earlier.

$ps -ef

It shows a lot of information about the running processes, but some of the columns such as C (processor utilization), SZ (size in physical pages), RSS (resident set size), PSR (processor that process is currently assigned to), STIME (the time when the process started) etc. are not displayed. So, it’s a little bit more compact than ps -eF.

Another variant of ps,

$ ps -ely

This one shows you UID (user ID), PRI (current priority of the process), NI (nice value) as well. So, it’s really handy.

Making ps Navigation Easy:

A typical Linux system has a lot of process running in the background. So, the output of the ps command is very long. It is harder to find useful information there. But, we can use a pager such as less to look for the processes a little bit easier.

You can use the less pager as follows:

$ ps -ef | less

The output of ps will be opened with less.

Now, you can use <Up> and <Down> arrow keys to navigate the list very easily.

You can also search for specific keywords here. This is really helpful for finding the processes that you’re looking for.

To search for a processes, let’s say acpi, type in the keyword as follows in the less pager.

/acpi

Now, press <Enter>.

As you can see, the process with the keyword acpi is highlighted.

You can also press n and p keys to go to the next and previous match (if available) respectively.

As you can see, I pressed n to and the next process with the keyword acpi is highlighted.

To exit out of the pager, press q.

Manually Select Columns to Display in ps:

The ps -e / ps -ef / ps -eF etc command shows some default columns. But, if you want, you can tell ps to show you specific columns, or add additional columns to the default set of columns.

For example, let’s say, you want to see only %MEM (percent memory usage), PID (process ID) and UID (process owner ID) and COMMAND (process command), then run ps as follows:

$ ps -e -o %mem,pid,uid,comm

As you can see, ps displayed only the information that I asked it for. Nothing more, nothing less.

The column keywors used here are %mem (for %MEM), pid (for PID), uid (for UID), comm (for COMMAND). ps supports a lot of keywords. You can find the whole list in the man page of ps.

Just open the man page of ps with the following command and navigate to the STANDARD FORMAT SPECIFIERS section as shown in the screenshot below.

$ man ps

If you want to display additional columns along with the default set of columns, then you can use the -O option to specify the columns that you want to see.

For example,

$ ps -ef -O %cpu

As you can see, I added %CPU and %MEM column along with the default columns of ps -ef command.

Sorting Output of ps Command:

You can also sort the output of ps according to any specific column or columns. You can sort the output of ps in the ascending or descending order depending on your requirement.

To sort the output of ps using any single column, you can use ps as follows:

$ ps -ef --sort=(+|-)column_code

Some example will make it clearer.

Let’s say, you want to sort the processes depending on how long the process is running in ascending order. You can run ps as follows:

$ ps -ef --sort=+time

Or

$ ps -ef --sort=time

NOTE: The default is sorting in ascending order. So you can omit the + sign if you want.

As you can see, the output is sorted in the ascending order by the TIME column.

Again, let’s say, you want to sort the processes depending on how long the process is running in the descending order. Then, the ps command would be:

$ ps -ef --sort=-time

As you can see, the processes that are running for the longest is listed first.

If you want to sort by multiple columns, just add the columns as follows:

$ ps -ef --sort=time,-%mem,%cpu

Where to Go Next?

I’ve covered the basics of the ps command. Now, you should be able to learn more about the ps command from the man page of ps.

You can access the man page of ps as follows,

$ man ps

For example, you can find specific process if you know it’s PID using ps as follows:

$ ps -O %mem,%cpu -p 2060

NOTE: Here, 2060 is the PID of the process.

You can also search for processes owned by specific user or group etc as well.

For example, to find all the running processes of your login user, run ps as follows:

$ ps -O user,%mem,%cpu -U $(whoami)

NOTE: You can replace $(whoami) with any username you want to list processes running as that user.

So, that’s how you use ps command to find running processes on Linux. Thanks for reading this article.

]]>
Understanding Load Average on Linux https://linuxhint.com/load_average_linux/ Mon, 14 Jan 2019 10:19:24 +0000 https://linuxhint.com/?p=35393 Load average is a measurement of the amount of work versus free CPU cycles available on a system processor. In this article I’ll define the term, demonstrate how Linux calculates this value, then provide insight into how to interpret system load.

Different Methods of Calculating Load

Before we dive into Linux load averages, we must explore the different ways load is calculated and address the most common measurement of CPU load – a percentage.

Windows calculates load differently from Linux, and since Windows has been historically more popular on the desktop, the Windows definition of load is generally understood by most computer users. Most Windows users have seen the system load in the task manager displayed as a percentage ranging from 0% to 100%.

In Windows this is derived by examining how “busy” the System Idle Process is and using the inverse to represent the system load. For example, if the idle thread is executing 99% of the time, CPU load in Windows would be 1%. This value is easy to understand but provides less overall detail about the true status of the system.

In Linux, the load average is instead is represented by a decimal number starting at 0.00. The value can be roughly defined as the number of processes over the past minute that had to wait their turn for execution. Unlike Windows, Linux load average is not an instant measurement. Load is given in three values – the one minute average, the five minute average, and the fifteen minute average.

Understanding Load Average in Linux

At first, this extra layer of detail seems unnecessary if you simply want to know the current state of CPU load in your system. But since the averages of three time periods are given, rather than an instant measurement, you can get a more complete idea of the change of system load over time in a single glance of three numbers

Displaying the load average is simple. On the command line, you can use a variety of commands. I simply use the “w” command:

root@virgo [~]# w
21:08:43 up 38 days,  4:344 users,  load average: 3.11, 2.75, 2.70

The rest of the command will display who’s logged on and what they’re executing, but for our purposes this information is irrelevant so I’ve clipped it from the above display.

In an ideal system, no process should be held up by another process (or thread), but in a single processor system, this occurs when the load goes above 1.00.

The words “single processor system” are incredibly important here. Unless you’re running an ancient computer, your machine probably has multiple CPU cores. In the machine I’m on, I have 16 cores:

root@virgo [~]# nproc
16

In this case, a load average of 3.11 is not alarming at all. It simply means that a bit more than three processes were ready to execute and CPU cores were present to handle their execution. On this particular system, the load would have to reach 16 to be considered at “100%”.

To translate this to a percent-based system load, you could use this simple, if not obtuse, command:

cat /proc/loadavg | cut -c 1-4 | echo "scale=2; ($(</dev/stdin)/`nproc`)*100" | bc -l

This command sequences isolates the 1-minute average via cut and echos it, divided by the number of CPU cores, through bc, a command-line calculator, to derive the percentage.

This value is by no means scientific but does provide a rough approximation of CPU load in percent.

A Minute to Learn, a Lifetime to Master

In the previous section I put the “100%” example of a load of 16.0 on a 16 CPU core system in quotes because the calculation of load in Linux is a bit more nebulous than Windows. The system administrator must keep in mind that:

  • Load is expressed in waiting processes and threads
  • It is not an instantaneous value, rather an average, and
  • It’s interpretation must include the number of CPU cores, and
  • May over-inflate I/O waits like disk reads

Because of this, getting a handle of CPU load on a Linux system is not entirely an empirical matter. Even if it were, CPU load alone is not an adequate measurement of overall system resource utilization. As such, an experienced Linux administrator will consider CPU load in concert with other values such as I/O wait and the percentage of kernel versus system time.

I/O Wait

I/O wait is most easily seen via the “top” command:

In the screenshot above I have highlighted the I/O wait value. This is a percentage of time that the CPU was waiting on input or output commands to complete. This is usually indicative of high disk activity. While a high wait percentage alone may not significantly degrade CPU-bound tasks, it will reduce I/O performance for other tasks and will make the system feel sluggish.

High I/O wait without any obvious cause might indicate a problem with a disk. Use the “dmesg” command to see if any errors have occurred.

Kernel vs. System Time

The above highlighted values represent the user and kernel (system) time. This is a breakdown of the overall consumption of CPU time by users (i.e. applications, etc.) and the kernel (i.e. interaction with system devices). Higher user time will indicate more CPU usage by programs where higher kernel time will indicate more system-level processing.

A Fairly Average Load

Learning the relationship of load average to actual system performance takes time, but before long you’ll see a distinct correlation. Armed with the intricacies of system performance metrics, you’ll be able to make better decisions about hardware upgrades and program resource utilization.

]]>