March 01, 2023
With the surge in the number of Database-as-a-Service providers in the market today, many DBaaS providers claim to offer competitive database performance for your applications. The only true way of evaluating the performance of the database is by running performance benchmarks for the databases running on the cloud. In this article, we run performance benchmarks to evaluate, analyze, and compare the performance of PostgreSQL database engines running on the AWS cloud for Tessell. We have used the PGIO benchmarking tool for the benchmarking process.
Before starting the benchmarking process, you need to get your environment ready.
To prepare the environment for the benchmarking process, perform the following high-level tasks:
Provision a Tessell RDS PostgreSQL instance to benchmark the performance testing. We are using the Tessell shape “tesl_8h_a” on the AWS cloud. This shape comes with 8 vCPUs and 64 GB RAM. While provisioning the instance, note down the username and password to connect to your database instance.
Launch or create an Amazon EC2 instance to install the PGIO benchmarking tool, and set up the load. It is recommended that you create the instance in the same Virtual Private Cloud (VPC) as your Tessell RDS instance to keep the latency minimum.
Set up the security groups for the client and server machines in a way that the client machine can connect to the server machine over the database port TCP:5432. For more information, see Default security groups for your VPC.
The following diagram shows the recommended environment for running the benchmarking process. The VPC located in the AWS cloud contains the Tessell RDS PostgreSQL instance and the PGIO client installed in the Amazon EC2 instance.
Firstly, provision the client Linux machine to install the PGIO benchmarking tool. For our test, we provisioned the Amazon Linux instance with the following configuration details:
Image: Amazon Linux 2 Kernel 5.10 AMI 2.0.20221210.1 x86_64 HVM gp2
VPC: Same as the DB Service
Secondly, download the PGIO benchmarking tool on the provisioned instance and configure PostgreSQL. To do so, perform the following steps:
1. Configure the yum repository by running the following command:
sudo amazon-linux-extras install epel -y
# Create file pgdg.repo
name=PostgreSQL 14 for RHEL/CentOS 7 - x86_64
2. Install the PostgreSQL binaries:
sudo yum makecache
sudo yum install postgresql14 postgresql14-server -y
3. Download the PGIO source code by using git.
Install the git tool and clone the PGIO project to your instance.
sudo yum install git -y
git clone https://github.com/therealkevinc/pgio.git
Extract the PGIO source code files.
tar xvf pgio-2019.09.21-v_1.0.tar.gz
cp -r pgio/sql .
4. Configure the PostgreSQL connection parameters by setting the following environment variables.
export PGPASSWORD=<DB Service password for 'master' user>
export PGHOST=<DB Service End Point>
export PGUSER=<DB Service master username>
export PGDATABASE=<name of the database given at the of service creation>
For example, enter the following values:
5. Test the psql connection by running the following command:
[ec2-user@ip-10-0-4x-1xx ~]$ psql
psql (9.2.24, server 14.2)
WARNING: psql version 9.2, server version 14.0.
Some psql features might not work.
Type "help" for help.
Before you run the benchmark, configure the PGIO configuration file and start the Setup (load schemas), and
Open the /home/ec2-user/pgio/pgio.conf file and replace the default parameter values with the following values:
For more information about the PGIO configuration parameter, see the README.
Start setting up PGIO and load schemas by running the following command:
This loads approximately 320 GB of slob database.
Run the performance test with the following command:
When the performance test completes, the IOPS achieved from the database transaction is displayed on the last line. When we ran our test on Tessell RDS and AWS RDS, we got the following results:
On Tessell RDS
DBNAME: slob. 32 schemas, 2 threads(each). Run time: 7200 seconds. RIOPS >165521< CACHE_HITS/s >403962<
On Amazon RDS
DBNAME: slob. 32 schemas, 2 threads(each). Run time: 7200 seconds. RIOPS >35840< CACHE_HITS/s >77488<
It is, therefore, safe to conclude that Tessell RDS produced 460% higher IOPS as compared to AWS RDS for the identical SLOB workload at the same cost. The image below depicts the visual comparison of the performance benchmark results that Tessell RDS and AWS RDS produce: