A while ago at work we were discussing the pros and cons of the classic Linux profiler gprof… What are profiles useful for? The output of a profile run against a very simple program looks like the example below. It tells us that of the 5.82 seconds of profiled runtime It also tells us that […]
Previously we looked at how the POSIX_FADVISE_DONTNEED hint influences the Linux page cache when doing IO via a filesystem. Here we take a look at two more filesystem hints POSIX_FADV_RANDOM and POSIX_FADV_SEQUENTIAL
Sometimes we want to read from the Linux cache rather than the underlying device using fio. There are couple of gotchas that might trip you up. Thankfully fio provides the required work-arounds. TL;DR To get this to work as expected (reads are serviced from buffer cache) – the best way is to use the option […]
Not sure where I came across this, but it is an excellent description of QEMU (and virtualization in general). I am very much a fan of this style of technical communication as exemplified in this final summary paragraph (the full article is longer): In summary, even though QEMU was first written as a way of […]
Overview For a fun afternoon project, how about a retro prometheus exporter using Apache/nginx, cgi-bin and bash!? About prometheus format A Prometheus exporter simply has to return a page with metric names and metric values in a particular format like below. When you configure prometheus via prometheus.yml you’re telling prometheus to visit a particular IP:Port […]
How to use some of Linux’s standard tools and how different types of memory usage shows up. Examples of using malloc and writing to memory with three use-cases for a simple process In each case we run the example with a 64MB allocation so that we can see the usage from standard linux tools. We […]
Running iperf with parallel threads TL;DR – When running iperf with parallel threads/workers the -P option must be specified after the -c <target-IP> option. This is mentioned in the manpage but some options (-t for instance) work in any order, while others (specifically the -P for parallel threads) definitely does not, which is a bit […]
Often it’s nice to be able to drive Windows applications and databases from Linux, especially if you are more comfortable in a Unix environment. This post will show you how to drive a Microsoft SQL Server database running on a Windows server from a remote Linux machine. In this example I am using Ubuntu 22.04, […]
TL;DR Using cloud-init with AHV is conceptually identical to using KVM/QEMU- we need to use a few different tools with AHV You will need a Linux image that is configured to use cloud-init. A good source is cloud-images.ubuntu.com We will create a cloud-init textual file and create a mountable version using the cloud-localds tool on […]
First things First Why do we tend to use 1MB IO sizes for throughput benchmarking? To achieve the maximum throughput on a storage device, we will usually use a large IO size to maximize the amount of data is transferred per IO request. The idea is to make the ratio of data-transfers to IO requests […]
TL;DR – Some modern Linux distributions use a newer method of identification which, when combined with DHCP can result in duplicate IP addresses when cloning VMs, even when the VMs have unique MAC addresses. To resolve, do the following ( remove file, run the systemd-machine-id-setup command, reboot): # rm /etc/machine-id # systemd-machine-id-setup # reboot When […]
For this experiment I am using Postgres v11 on Linux 3.10 kernel. The goal was to see what gains can be made from using hugepages. I use the “built in” benchmark pgbench to run a simple set of queries. Since I am interested in only the gains from hugepages I chose to use the “-S” […]
We have started seeing misaligned partitions on Linux guests runnning certain HDFS distributions. How these partitions became mis-aligned is a bit of a mystery, because the only way I know how to do this on Linux is to create a partition using old DOS format like this (using -c=dos and -u=cylinders)