What is iowait and how does it affect Linux performance?

I/O wait or iowait, wait, wa, %iowait, or wait% is often displayed by command-line Linux system monitoring tools such as top, sar, atop, and others. On its own, it’s one of many performance stats that provide us insight into Linux system performance. I/O wait came up in a recent discussion with a new client. During our […]

Free vs. Available Memory in Linux

At times we will need to know precisely how our Linux systems use memory. This article will examine how to use the free command-line utility to view memory usage on a Linux system. In doing so, we will clearly define the difference between free vs. available memory on Linux systems.   Free vs. Available memory […]

Are you measuring Linux web server memory usage correctly?

This article was first published in 2014. Afterwhich, there was a welcomed change to the Linux kernel in 2016; as mentioned in the 2017 article: Does your Linux server need a RAM upgrade? Let’s check with free, top, vmstat and sar. As outlined here, memory is now marked as available by the Linux kernel: “Estimation of […]

Linux Performance: Why You Should Almost Always Add Swap Space

We know that using Linux swap space instead of RAM (memory) can severely slow down performance. So, one might ask, since I have more than enough memory available, wouldn’t it better to delete swap space? The short answer is, No. There are performance benefits when swap space is enabled, even when you have more than […]

How to diagnose OOM errors on Linux systems

Out-of-memory (OOM) errors take place when the Linux kernel can’t provide enough memory to run all of its user-space processes, causing at least one process to exit without warning. Without a comprehensive monitoring solution, OOM errors can be tricky to diagnose. In this post, you will learn how to diagnose OOM errors in Linux kernels […]

PHP memory_limit – understanding and increasing this setting

PHP memory_limit is per-script, just as a highway’s speed limit is per-vehicle. For example, although PHP’s memory limit may be set high to 1GB, that does not mean that scripts will pile up to use that 1GB. Let’s take a quick look at understanding PHP’s memory_limit setting.   PHP memory_limit is a per-script setting PHP.net’s […]

Tuning MySQL my.cnf? Avoid this common pitfall!

It took me some time to decide the title for this article. MariaDB has been fast replacing MySQL as a growing number of Linux distributions now default to MariaDB over MySQL. MariaDB is an enhanced, drop-in replacement for MySQL. Therein lies my predominantly self-made conundrum, MySQL or MariaDB? That said, the MySQL tuning advice below […]

MySQL Query Cache for Performance, Avoid This When Tuning

Update: MySQL query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0. – mysql.com One of the most misconfigured MySQL performance features is MySQL query_cache_size. This post references a web server with 32 gigabytes of RAM where the existing config had MySQL’s query cache size set incorrectly to 4 gigabytes. The thought behind it seemed […]

How to strip down Amazon Linux EC2 to maximize available RAM

Firstly, this article mainly applies to low memory Amazon Linux EC2 instance types such as t2.nano and t2.micro. The instructions below are also specific to Amazon Linux AMI, which like CentOS, is based on RHEL (Red Hat Enterprise Linux). Note: This article is from 2016 and applies to Amazon Linux Version 1 only.   Update […]