5. OLTP Test: PostGreSQL vs Oracle
PostgreSQL Best Practices5/4/20195
Goal
Use the same type of machine
Test the same OLTP workload on both databases
Test different CPU allocation
Compare the results
6. OLTP Test: PostGreSQL vs Oracle: Configuration
PostgreSQL Best Practices5/4/20196
Server details
Main host:
• 2 * 8 cores CPU E5-2680 0 @ 2.70GHz
• OEL 7.2
• 192 GB
• Flash Storage volumes on PCIe cards (no NVMe)
VMs:
• 8 vCPU
• 8 GB RAM
Concurrent sessions:
• 100
7. OLTP Test: PostGreSQL vs Oracle : Configuration
PostgreSQL Best Practices5/4/20197
Hammerdbcli PostGreSQL Test Setup
dbset db pg
diset tpcc pg_defaultdbase hammerdb
loadscript
vudestroy
vuset delay 5
vuset repeat 5
vuset showoutput 1
vuset timestamps 1
vuset logtotemp 1
vuset vu 100
vucreate
vurun
8. OLTP Test: PostGreSQL vs Oracle : Configuration
PostgreSQL Best Practices5/4/20198
Hammerdbcli Oracle Test Setup
dbset db ora
diset connection instance jko
loadscript
vudestroy
vuset delay 5
vuset repeat 5
vuset showoutput 1
vuset timestamps 1
vuset logtotemp 1
vuset vu 100
vucreate
vurun
9. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/20199
PostGreSQL
Time to complete the full test 4.23 mn
Average CPU Usage 88 %
Transaction per minutes max 156’222
10. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201910
Oracle
Time to complete the full test Time 4.12 mn
Average CPU Usage 74 %
Transaction per minutes max 172’268
11. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201911
select sum(value) from v$sysstat where name = 'user commits' or name = 'user rollbacks'
select sum(xact_commit + xact_rollback) from pg_stat_database
12. OLTP Test: PostGreSQL vs Oracle : Configuration
PostgreSQL Best Practices5/4/201912
Lets Scale!
Main host:
• 2 * 8 cores CPU E5-2680 0 @ 2.70GHz
• OEL 7.2
• 192 GB
• Flash Storage volumes on PCIe cards (no NVMe)
VMs:
• 16 vCPU
• 8 GB RAM
Concurrent sessions:
• 100
13. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201913
PostGreSQL
Time to complete the full test Time 3.27 mn
Average CPU Usage 65 %
Transaction per minutes max 194’904
14. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201914
Oracle
Time to complete the full test Time 3.16 mn
Average CPU Usage 57 %
Transaction per minutes max 251’292
15. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201915
select sum(value) from v$sysstat where name = 'user commits' or name = 'user rollbacks'
select sum(xact_commit + xact_rollback) from pg_stat_database
16. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201916
8 vCPU
2.6% Faster 16% Less CPU 9.3% More TPM
17. OLTP Test: PostGreSQL vs Oracle : Results
PostgreSQL Best Practices5/4/201917
16 vCPU
3.4% Faster 12.3% Less CPU 22.43% More TPM
18. Jacques Kostic, Principal Consultant
Tel. +41-79-909 7263 Jacques.Kostic@trivadis.com
5/4/201918 TechEvent September 2018