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 […]
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 […]
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 with an insight into Linux system performance. I/O wait came up in a recent discussion with a new client of […]
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 […]
Linux server needs a RAM upgrade? Check with top, free, vmstat and sar.
Sometimes it can be a bit of a challenge knowing if and when you should upgrade the RAM (random access memory) on your Linux server. Even more so when deciding how much memory you should add, or, if you have adequate memory, how do you make best use of it? This article will walk you […]
Tuning MySQL: my.cnf, avoid this common pitfall!
Caution: Don’t overwrite my.cnf all at once. Backup data and config, make one or two changes per restart, test extensively. 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 […]
Measure Linux web server memory usage correctly
Important update: This article was originally posted back in 2014. However, as I later posted in 2017 in the blog post Does your Linux server need a RAM upgrade? Lets check with free, top, vmstat and sar …there was a Linux kernel change to address this in 2016. (This change should motivate New Relic and others to follow suit […]
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 […]