How to Check and Monitor CPU utilization on Linux

How to Check and Monitor CPU utilization on Linux

As a Linux administrator, it’s important to keep an eye on how your server (or servers) is performing. One way to measure its performance is to track the CPU usage. This will give you insight into the performance of the system as well as show how the hardware resources are being divided up across the various running services.

In this guide, we’ll go over a few methods to check and monitor the CPU utilization on a Linux system. Whether you are in charge of a server or just your personal desktop, the computer’s CPU usage is useful information that’s easy to acquire.

In this tutorial you will learn:

  • How to check CPU usage with top
  • Understanding the output from top and htop
  • Monitor CPU usage with systat package
  • How to configure CPU monitoring alters

Read more

Spark shell with pyspark.

How to install spark on RHEL 8

Apache Spark is a distributed computing system. It consists of a master and one or more slaves, where the master distributes the work among the slaves, thus giving the ability to use our many computers to work on one task. One could guess that this is indeed a powerful tool where tasks need large computations to complete, but can be split into smaller chunks of steps that can be pushed to the slaves to work on. Once our cluster is up and running, we can write programs to run on it in Python, Java, and Scala.

In this tutorial we will work on a single machine running Red Hat Enterprise Linux 8, and will install the Spark master and slave to the same machine, but keep in mind that the steps describing the slave setup can be applied to any number of computers, thus creating a real cluster that can process heavy workloads. We’ll also add the necessary unit files for management, and run a simple example against the cluster shipped with the distributed package to ensure our system is operational.

In this tutorial you will learn:

  • How to install Spark master and slave
  • How to add systemd unit files
  • How to verify successful master-slave connection
  • How to run a simple example job on the cluster

Read more

Apache ActiveMQ Welcome page on RHEL 8

How to install ActiveMQ on RHEL 8

Apache ActiveMQ is a widely used messaging server written in Java. As messaging services commonly do, it creates a bridge between heterogeneous systems for reliable data exchange in the form of messages pushed into queues by producer clients, where they wait to be “read”, or consumed by consumer clients.

Naturally a system that is client to ActiveMQ can be both producer and consumer, and more than one systems can subscribe to a queue or topic, thus enabling flexible communication between these client systems. Many different platforms and protocols can be used to connect to ActiveMQ, increasing it’s usefulness even more.

In this tutorial we will install Apache ActiveMQ on Red Hat Enterprise Linux 8 from tarball, add the systemd unit files for ease of use, and access the admin page of our new service to create a queue.

In this tutorial you will learn:

  • How to install ActiveMQ from tarball
  • How to set up environment from the command line
  • How to add systemd unit files for ActiveMQ
  • How to access the admin page

Read more

Running performance tests against local webserver with Apache Bench.

How to install apache bench on RHEL 8

Apache Bench is a useful little tool for testing the response time of a webservice, and thus the performance of the webserver. We can specify the number of requests to send, the target URL, set up concurrency, just to name a few of this tool’s settings.

While such simulated workloads will not result exactly the same data that real world traffic will do, it is always a good idea to test before going to production. Maybe before deploying a new version of the application, we could run the tests on the new version, and compare the results with the previous test data to see if our application will serve slower, or faster than the last version. With well-planned testing, this tool can show the possible bottlenecks of the application, and may provide points of interest where we should look into our code for possible optimization.

In this tutorial we will install Apache Bench on Red Hat Enterprise Linux 8, as well as an Apache Webserver to run some tests against.

In this tutorial you will learn:

  • How to install Apache Bench
  • How to install httpd webserver, and add some basic content
  • How to run simple tests against the webserver

Read more

Composer's main help.

How to install composer on RHEL 8

Composer is a dependency management tool for php, much like cpan for perl. If you have read the tutorial about installing cpan, the architecture will be somewhat familiar. Composer, as a command line tool is the client that can fetch and update the php libraries we mark as needed, as well as the libraries these depend on, etc.

The source of these libraries is packagist.org, a large public php package repository. We can browse the repository with a browser to find the packages we’d like to use, then include them in our projects with the help of Composer. And by solving the dependencies itself, Composer can make our lives much easier if we depend on external packages. In turn we can also share our libraries, so the community can access them trough Composer as well.

In this tutorial we will install Composer on Red Hat Enterprise Linux 8, and mark a package as needed dependency for our project, to see the tool working.

In this tutorial you will learn:

  • How to install Composer
  • How to define package as dependency
  • How to install dependencies with Composer

Read more

Querying system tables in Cassandra on RHEL 8

How to install cassandra on RHEL 8

Apache Cassandra is an open-source NoSQL database. One of it’s main features is it’s decentralized nature that gives unique fault tolerance. Having our data replicated across datacenters means our production will not suffer from the loss of one of our sites, something all sysadmins dream of (or really happy to have such setup).

In this tutorial we will install Cassandra on Red Hat Enterprise Linux 8 by adding the Cassandra repository, install the software, and set up all else needed to have our service up and running and easy to manage.

In this tutorial you will learn:

  • How to add Cassandra repository
  • How to install needed packages
  • How to repair systemd unit file
  • How to test Cassandra with cqlsh

Read more

Stepping trough a for loop with gdb.

How to install gdb in RHEL 8

Gdb or GNU Project Debugger is a great tool when you need to debug a program. You can set breakpoints, watch for value change of a variable, or even change a value for the program while it is halted at a point of it’s state, then continue, just to pick some of the features of gdb.

In this tutorial we will install gdb on RHEL 8, and test how it is working with a simple C application.

In this tutorial you will learn:

  • How to install gdb
  • How to compile a simple C application with debug symbols
  • How to set breakpoints in the running application with gdb
  • How to print actual values of given variables within the application

Read more

Consuming messages on Kafka topic from the command line.

How to install kafka on RHEL 8

Apache Kafka is a distributed streaming platform. With it’s rich API (Application Programming Interface) set, we can connect mostly anything to Kafka as source of data, and on the other end, we can set up a large number of consumers that will receive the steam of records for processing. Kafka is highly scaleable, and stores the streams of data in a reliable and fault-tolerant way. From the connectivity perspective, Kafka can serve as a bridge between many heterogeneous systems, which in turn can rely on it’s capabilities to transfer and persist the data provided.

In this tutorial we will install Apache Kafka on a Red Hat Enterprise Linux 8, create the systemd unit files for ease of management, and test the functionality with the shipped command line tools.

In this tutorial you will learn:

  • How to install Apache Kafka
  • How to create systemd services for Kafka and Zookeeper
  • How to test Kafka with command line clients

Read more

How to setup Nginx Reverse Proxy

How to setup Nginx Reverse Proxy

In this guide, you will learn how to setup an Nginx reverse proxy with step by step instructions. We will also explain how a reverse proxy server works and what its advantages are. In addition, we also go over various configuration options that Linux administrators commonly employ on their reverse proxy servers.

In this tutorial you will learn:

  • How does a reverse proxy work
  • What are the benefits of a reverse proxy
  • How to setup Nginx reverse proxy
  • How to pass headers
  • How to configure load balancing
  • How to test the Nginx configuration

Read more

Installed Nvidia drivers on CentOS 7 Linux GNOME desktop

How to install the NVIDIA drivers on CentOS 7 Linux

The CentOS 7’s support for Nvidia video graphic cards comes in a form of an open source nouveau driver. In case the nouveau driver is not a sufficient solution, users can install the official Nvidia driver as a proprietary alternative. This step by steps tutorial will guide you through the entire process on Nvidia driver installation.

To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.

Read more

Installed Nvidia drivers on Fedora 28 Linux GNOME desktop

How to install the NVIDIA drivers on Fedora 28 Linux

The NVIDIA Driver is a software necessary for your NVIDIA Graphics GPU to function with better performance. It exchanges information between your Linux operating system, in this case Fedora 28 Linux, and the hardware in question, in this case the NVIDIA Graphics GPU.

In this guide you will learn how to install NVIDIA Drivers on Fedora 28 Linux. First, we will be disabling the default nouveau opensource NVIDIA Drivers and then install the official NVIDIA Driver by using the Linux terminal command.

To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.

Read more

Installed Nvidia drivers on Fedora 28 Linux GNOME desktop

How to install the NVIDIA drivers on Fedora 29 Linux

The NVIDIA Driver is a program needed for your NVIDIA Graphics GPU to function with better performance. It communicates between your Linux operating system, in this case Fedora 29 Linux, and your hardware, the NVIDIA Graphics GPU.

In this article you will learn how to install NVIDIA Drivers on Fedora 29 Linux. We will start by disabling the default nouveau opensource NVIDIA Drivers and then provide step by step instructions on how to successfully install the official NVIDIA Driver on Fedora 29.

To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.

Read more