Salvatore D'angelo
Salvatore D'angelo

Reputation: 1149

PostgreSQL vs Kubernetes performance problem

I am running some performance tests against PostgreSQL to test the performance when the DB server runs on a VSI and when it runs on a Kubernetes on a worker node. I use PgBench to run these tests.

My DB (that in production is configured in the cluster) has a big workload so I tested on VSI (on IBM Cloud) with 64 vCPU Dual Processor 2.3 GHz 32 cores and 128 Gb RAM, disk 2Tb 5IOPS per Gb.

Then I tested it on Kubernetes (IBM Cloud) with a worker node of 48 vCPU, 192 Gb RAM, disk 2 Tb 5 IOPS per Gb.

The problem is that performance on Kubernetes is 50% worst than VSI and I didn't expect all this difference. So I am trying to understand what could be the bottleneck.

  1. The disks in the tests are similar and throughput is similar, so the disk cannot be the bottleneck

  2. I used a service to access the Pod configured as Network Load Balancer (before it was Application Load Balancer and the performance is even worst). However, I did also a test with a Pod to Pod communication deploying PgBench on another worker node bypassing the Service. But no improvements have been noticed. So I think this should exclude the problem is the Load Balancer.

  3. The I though to reserve more CPU and RAM to PostgreSQL Pod adding something like this.

     resources:
       requests:
         memory: 128Gi
         cpu: 32
       limits:
         memory: 128Gi
         cpu: 32
    

At this point, I don't know what I can do to improve performance. Any suggestion? Is it normal that Kubernetes add all this overhead?

Upvotes: 2

Views: 1026

Answers (0)

Related Questions