Firebird Performance Comparer (FBPC)

In my two presentations at the 20th Firebird Developers Day, I introduced firsthand the tool I created to help compare the performance between two Firebird servers (>= 2.5) in an easy and visual way.

This tool actually helped to detect a performance regression in Firebird 5 beta, which was resolved after I reported it to the core developers. The intention is to identify optimizer regressions or low performance issues in Firebird itself, or even the breaking of SQL commands due to new reserved words or syntax restrictions.

I’m making version 1.0 beta available for anyone interested. It’s a version that so far has been tested only by me, so it may and probably does have some bugs.

The FBPC runs on Windows and internally uses Firebird 5 RC1 embedded to store the tests and their results. When you run the application for the first time, it will display instructions on how to use it.

In summary, it helps you create a trace.conf to capture SQL commands executed on a Firebird server 2.5 or higher in a production environment. Then, the tool parses the file and collect the statements, allowing you to run them in a controlled environment of servers, specifying test rounds where the execution time between server1 and server2 is compared and displayed in an intuitive and visual way, enabling you to detect regressions or even commands that could not be executed due to new reserved words or syntax restrictions imposed in new versions of the DBMS.

Fix for Meltdown and Spectre will affect your server performance!

Microsoft, Apple and several Linux distros started to distribute patches to try to fix the recent security flaws found in Intel, AMD and ARM CPUs, in almost every CPU released in the last 20 years. The security flaws are known as Meltdown (affects Intel) and Spectre (affects Intel, AMD and some ARM processors).

The flaw allow softwares to access protected memory areas that should be accessed only by the Operating System kernel, and get sensitive data, like passwords, etc.

There are two problems with the fixes:

  1. They do not fix 100% of the problem, since it is related on how the CPUs were designed. So far, there is no 100% solution for the problem, and probably it will never exists.
  2. They impact badly in performance.

In a recent post to firebird-devel list, an user reported that the performance of the Firebird server dropped ~30% after he upgraded its Linux kernel to a version that “fix” those security flaws.

General reports over the internet shows that the most affected areas of the system are CPU, RAM and Disk, so any software that makes intensive use of some of those areas will probably have its performance significantly degraded.

Just to be clear: this performance loss doesn’t affect only Firebird, but any software!

Apache, PHP and Firebird Performance Tuning

In the last post I commented that I had a test-bed application, based on ApachePHP and Firebird, and once the problem with the images was solved I could finally start doing the actual performance testing/tuning that I originally wanted to do. 

The only major changes from the last post is that I’ve now upgraded the database engine to the “Firebird v2.5 Alpha 1” that supports SMP, and that the application now contains more base data in the tables.

Performance improvement by using firebird client from cvs head

He doubled his performance by just switching the firebird client :

We’ve just built and tested ‘libfbclient.so’ from the head branch and tested
it against the release version 2.0.3. In other words, we only switched out
the client library, and left the database server itself intact at version
2.0.3.