Adding Swap Space to an EC2 Instance

The t1.micro instance comes with only 602MB of memory. Especially under high load, it is quite easy to deplete the available memory – and since no swap space is enabled by default, this can quickly lead to a server becoming unresponsive. Swap space can also allow the kernel to move unused data out of memory,… Continue reading Adding Swap Space to an EC2 Instance

Shrink EBS Root

My EC2 instances are setup to have only the operating system and program files on the root volume, with all other data (logs, mail, etc.) on a second EBS volume. This leads to a very stable root volume, which sees a minimum of changes. Fully configured, my root volume (using Amazon’s Linux) is 1.2GB. The… Continue reading Shrink EBS Root

Installing ApacheBench without Apache on Amazon’s Linux

Having recently switched to a setup with only nginx (and no apache), I found myself wanting to run some tests. As nice as siege is, I rather like ApacheBench (ab). However, I really didn’t want to install all of Apache just to get ab. Quick and Easy Way On Amazon’s Linux, the ab binary can… Continue reading Installing ApacheBench without Apache on Amazon’s Linux

Missing mail command on Amazon’s Linux

I recently noticed that the mail command is not available by default on the latest version of Amazon’s Linux AMI (v2011.09). This functionality is available in the mailx package, which can be installed with the following: yum install mailx

Starting Varnish – Amazon’s Linux

I decided to install the new version of Varnish (3.0.1) using the Varnish repository (instead of amzn repository). The installation progressed without issue (you do need to override the default priorities of the repositories though), however, I ran into an issue trying to start Varnish. Every time I tried to start Varnish I would simply… Continue reading Starting Varnish – Amazon’s Linux

Showing the Firebug icon

While it is easy enough to use F12 to display Firebug in Firefox, I just like the status bar icon. Unfortunately, it has been hidden in the last few releases of Firebug. To display it, open about:config, and set extensions.firebug.showStatusIcon to true.

Building an Nginx RPM on Amazon’s Linux

If no customizations are desired, a far simpler way to get the RPM, than that outlined below, is to use the nginx repository, available from nginx’s download page. After deciding to change my server stack today (based on Amazon’s Linux), I noted that, despite the current version of Amazon’s Linux being hardly a few days… Continue reading Building an Nginx RPM on Amazon’s Linux

Upgrading Amazon’s Linux

Today, after looking over the changes in the new version of Amazon’s Linux AMI, I decided to upgrade (from 2011.02 to 2011.09). After running yum upgrade, I ran into an error (below) with compat-openldap. Error: Package: compat-openldap-2.4.19_2.3.43-15.11.amzn1.i686 (@upgrade-updates/2010.11) Requires: openldap = 2.4.19-15.11.amzn1 Removing: openldap-2.4.19-15.11.amzn1.i686 (@upgrade-updates/2010.11) openldap = 2.4.19-15.11.amzn1 Updated By: openldap-2.4.23-15.13.amzn1.i686 (amzn-main) openldap = 2.4.23-15.13.amzn1… Continue reading Upgrading Amazon’s Linux

Optimize all MySQL Tables

A one-liner to optimize all MySQL tables, in all databases. Be advised that running optimize on InnoDB does a ‘recreate and analyze’. Run as root in the example below. mysqlcheck -o -u root -p –all-databases

Verify that SSL caching is working

To verify that SSL caching is on, check the Session-ID across multiple sessions (i.e. resume/reconnect) – they should be the same: openssl s_client -host HOSTNAME -port 443 -reconnect | grep ‘Session-ID:’ The equivalent, using gnutls-cli should be: gnutls-cli -V -r HOSTNAME |grep ‘Session ID’