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. Hopefully, this change will motivate New Relic and others to follow […]

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 […]

PHP memory_limit – understanding and increasing this setting

PHP memory_limit is per-script, just as a highway 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 swap space instead of RAM can severely slow down the performance of Linux. So then, one might ask, since I have more than enough RAM available, wouldn’t it better to remove swap space completely? The short answer is, No. There are performance benefits when swap is enabled, even when you have more than enough […]

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). Yum! Update all packages – yum package manager First, login to your new Amazon Linux EC2 instance […]