Author: Sahil Suri

How to check memory usage in Linux

Introduction The ability to check memory usage on Linux systems follows the popular UNIX philosophy “there’s more than one way to do it”. We have multiple commands to check and diagnose memory usage on Linux systems. The free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The vmstat command reports information about processes, memory, paging, block IO, traps, and CPU activity. We can use the top command to obtain a dynamic real-time view of a running system. The top command can display system summary information as well as a list of tasks currently being managed by the Linux kernel. If we are using a system that has a GUI interface then we could also use the gnome-system-monitor to view memory utilization. High memory usage can cause severe performance bottlenecks on systems if not monitored properly and kept within certain threshold limits. These threshold limits may vary depending on the available memory resources and the type of workloads residing on the system. A system low on memory can have several adverse implications like not being able to serve visitors accessing a website on a web server, the shutdown of network and other system services and at times even causing the system to hang followed by a subsequent system crash. In this article, we...

Read More

GRUB bootloader basics

Introduction A bootloader is a small program that loads up code required for operating system startup. This mainly includes the location of the operating system kernel and the options which should be used to load the kernel. GRUB is an acronym for “GRand Unified Bootloader”. It works with the BIOS (Basic Input Output System) firmware and supports multiple boot options, such as various Linux boot modes, and other operating systems like Windows, BSD, and so on. We are slowly seeing a migration from the legacy BIOS system towards firmware that is based on the UEFI (Unified Extensible Firmware Interface). It was originally developed by Intel and used for their Itanium systems. This provided a new way to boot the operating system moving away from the BIOS and MBR. With this, we can also implement a secure boot mechanism by performing cryptographic signing of the bootloader. UEFI requires EFI system partition which is usually Fat32. UEFI is not limited to reading the 446 byte bootstrap code in the MBR. The GRUB2 and Syslinux bootloaders support both BIOS and UEFI whereas the legacy GRUB bootloader and LILO only support BIOS. The GRUB bootloader is deployed with Centos 6, RHEL 6 and SLES 11 operating systems. In this article, we intend to provide a basic introduction to the GRUB bootloader.   GRUB configuration file: The GRUB configuration file is /boot/grub/menu.lst. Given below...

Read More

Configuring service unit files for use with systemd

Introduction In an earlier article, we discussed the systemd system startup manager in detail and also ventured into the reasons why it has replaced sysvinit as the default system startup and service manager for many popular Linux distributions including RedHat, Centos, and Ubuntu. Within Centos 7/RHEL 7 we are provided with targets or target units instead of run levels and in a similar manner service units now represent service scripts in systemd. In this article, we will demonstrate how we can create service unit files which are analogous to the init scripts in sysvinit which we already covered in a previous article.   An overview of systemctl One of the interesting features of systemd is that run level management and service management are under the control of a unified tool named systemctl. Therefore, systemd does not use the service and chkconfig commands or the init or telinit command to change run levels. To enable or start a service, for example, sshd on boot, we would use the following command. systemctl enable sshd To disable the sshd service on boot, we would use the following command. systemctl start sshd To view the status of the sshd service, we would use the following command. systemctl status sshd The systemctl status command is especially more useful and verbose as compared to it’s predecessor, the service status command because it not only provides...

Read More

Our supporters

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.


My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.