PostgreSQL

Benchmark Tessell for PostgreSQL performance using PGIO (SLOB)

Kamal Khanuja
Kamal Khanuja
,
July 21, 2023
Share this blog
arrow icon
Benchmark Tessell for PostgreSQL performance using PGIO (SLOB)

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.

Prepare your environment

To prepare the environment for the benchmarking process, perform the following high-level tasks:

  1. Provision a Tessell for 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.
  2. 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.
  3. 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 for PostgreSQL instance and the PGIO client installed in the Amazon EC2 instance.

Benchmark Setup

Provision the PGIO client machine

Copied to clipboard!

Image: Amazon Linux 2 Kernel 5.10 AMI 2.0.20221210.1 x86_64 HVM gp2
Shape: m5.2xlarge
VPC: Same as the DB Service
 

Download PGIO and configure PostgreSQL

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:

Copied to clipboard!

sudo amazon-linux-extras install epel -y

# Create file pgdg.repo
[pgdg14]
name=PostgreSQL 14 for RHEL/CentOS 7 - x86_64
baseurl=http://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64
enabled=1
gpgcheck=0
EOF
 

2. Install the PostgreSQL binaries:

Copied to clipboard!

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.
Copied to clipboard!

cd /home/ec2-user
sudo yum install git -y
git clone https://github.com/therealkevinc/pgio.git
 
  • Extract the PGIO source code files.
Copied to clipboard!

cd pgio
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.

Copied to clipboard!

export PGPASSWORD=<DB Service password for 'master' user>
export PGHOST=<DB Service End Point>
export PGUSER=<DB Service master username>
export PGPORT=5432
export PGDATABASE=<name of the database given at the of service creation>
 

For example, enter the following values:

Copied to clipboard!

export PGPASSWORD=MyPassw0rd
export PGHOST=myslob.console.tessell.com
export PGUSER=master
export PGPORT=5432
export PGDATABASE=slob
 

5. Test the  psql  connection by running the following command:

Copied to clipboard!

[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.

slob=#
 

Run the benchmark

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:
Copied to clipboard!

UPDATE_PCT=15
RUN_TIME=7200
NUM_SCHEMAS=32
NUM_THREADS=4
WORK_UNIT=200
UPDATE_WORK_UNIT=8
SCALE=10G

DBNAME=slob CONNECT_STRING="slob"

CREATE_BASE_TABLE=TRUE
 

For more information about the PGIO configuration parameter, see the README.

  • Start setting up PGIO and load schemas by running the following command:
Copied to clipboard!

cd /home/ec2-user/pgio
sh ./setup.sh
 

This loads approximately 320 GB of slob database.

  • Run the performance test with the following command:
Copied to clipboard!

cd /home/ec2-user/pgio
sh ./runit.sh
 

Results

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

Copied to clipboard!

DBNAME: slob. 32 schemas, 2 threads(each). Run time: 7200 seconds. RIOPS >165521< CACHE_HITS/s >403962<
 

On Amazon RDS

Copied to clipboard!

DBNAME: slob. 32 schemas, 2 threads(each). Run time: 7200 seconds. RIOPS >35840< CACHE_HITS/s >77488<
 

Conclusion

It is, therefore, safe to conclude that Tessell for PostgreSQL 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 for PostgreSQL and AWS RDS produce:

Benchmark Results
Follow us
Youtube Button