PostgreSQL

Benchmark Tessell for PostgreSQL performance using PGIO (SLOB)

July 21, 2023
Benchmark Tessell for PostgreSQL performance using PGIO (SLOB)
4 min read
TL;DR
  • Tessell HPC PostgreSQL uses locally attached NVMe storage on AWS, benchmarked against Amazon RDS PostgreSQL using the PGIO SLOB tool on identical 8 vCPU, 64 GB shapes.
  • SLOB benchmark results show Tessell at 165,521 RIOPS versus Amazon RDS at 35,840 RIOPS for the same 320 GB workload run over 7,200 seconds.
  • Tessell delivered 460% higher IOPS than Amazon RDS PostgreSQL at the same cost, with cache hit rates of 403,962 per second versus 77,488 on RDS.
  • The benchmark used 32 schemas, 4 threads per schema, 15% update workload, and a 10 GB work unit scale to simulate realistic mixed read and write I/O patterns.
  • Choose Tessell HPC PostgreSQL over Amazon RDS when I/O intensive workloads require maximum RIOPS throughput without paying additional IOPS provisioning fees.

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


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:
 
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:



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.
    cd /home/ec2-user
    sudo yum install git -y
    git clone https://github.com/therealkevinc/pgio.git

  • Extract the PGIO source code files.
    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.



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:
 
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:


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


  • Start setting up PGIO and load schemas by running the following command: 
     
    cd /home/ec2-user/pgio
    sh ./setup.sh

This loads approximately 320 GB of slob database.


  • Run the performance test with the following command:
    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
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<

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
FAQs
PGIO is an open-source PostgreSQL benchmarking tool that measures database input/output operations per second (IOPS) under workloads with configurable schemas, threads, runtime, and update percentages.
Tessell for PostgreSQL produced 460% higher IOPS than AWS RDS in PGIO benchmarks at the same cost, delivering 165,521 RIOPS versus 35,840 RIOPS on identical SLOB workloads.
Benchmarking PostgreSQL with PGIO involves provisioning a database instance, launching an EC2 client, installing PGIO from GitHub, configuring connection parameters, loading SLOB schemas, and running the performance test.
The Tessell PostgreSQL benchmark used the tesl_8h_a shape on AWS with 8 vCPUs and 64 GB RAM, paired with a PGIO client on m5.2xlarge EC2 in the same VPC.
The Tessell PGIO benchmark used 32 schemas, 4 threads, 7200-second runtime, 15% update percentage, 200 work units, 10G scale, loading approximately 320 GB into the SLOB database.
Related Blogs