40x speed up of ls on large dirs

If you ever tried listing a directory with a lot (10,000+) of files in it, I’m sure you know how annoyingly slow ‘ls’ can be. Turns out there is a simple way to make it better. Have a look at the “When setting an environment variable gives you a 40x speedup” blog post.

Or just do the following:

export LS_COLORS='ex=00:su=00:sg=00:ca=00:'

This will disable colors on the executable files, setuid/setgid bits, and capabilities.

Packets-per-second limits in EC2

Packets-per-second limits in EC2” is an interesting dive into network limits on the Amazon EC2. Even if you aren’t hitting any limits yet, this article provides plenty of useful information, including benchmarking tools and quick reference links for Enhanced Networking.

The conclusion of the article is:

By running these experiments, we determined that each EC2 instance type has a packet-per-second budget. Surprisingly, this budget goes toward the total of incoming and outgoing packets. Even more surprisingly, the same budget gets split between multiple network interfaces, with some additional performance penalty. This last result informs against using multiple network interfaces when tuning the system for higher networking performance.
The maximum budget for m5.metal and m5.24xlarge is 2.2M packets per second. Given that each HTTP transaction takes at least four packets, we can translate this to a maximum of 550k requests per second on the largest m5 instance with Enhanced Networking enabled.

Tips to Speed up Your PHPunit Tests

I came across this collection of “Tips to Speed up Your PHPunit Tests“. Apart from the few usual ones, like disabling XDebug and using groups, I found a couple that linked to handy tools:

  • ParaTest – a PHPUnit extension that runs PHPUnit tests in parallel, significantly minimizing the test run time, and
  • PHPUnit Report – a tool that visualizes test run times, clearly showing which unit tests take the longest to run.

Very cool! Needs trying …

MySQL High Availability at GitHub

Shlomi Noach, GitHub’s Senior Infrastructure Engineer, shares some details on both the current and future high availability setup of MySQL databases at GitHub.

This is probably way too far out for most people using MySQL for their web applications.  But it does highlight the technical complexity of running high load web applications, and how some of the issues can be solved or worked around.

Pretty fascinating stuff there …