SlideShare une entreprise Scribd logo
1  sur  76
Télécharger pour lire hors ligne
On The
Building Of A
PostgreSQL
Cluster
Srihari Sriraman | nilenso
Stories
Each story shall cover
• Problem
• Quick fix
• Root cause
• Correct fix
• Lessons learnt
Context
What’s the biz?
• Experimentation platform in the staples-sparx ecosystem
• Used to drive important business decisions
• Needs to do 2 things:
• Serve real time requests in low latency
• Report over a few months of live data
Why PostgreSQL?
• Data integrity is paramount
• Tight performance constraints
• Medium sized data warehouse
How impressive are your numbers?
SLA 99.9% < 10ms
RPS 500
QPS 1.5k
TPS 4.5k
Daily Size Increase 8G
DB Size (OLTP) 600G
Biggest Table Size 104G
Biggest Index Size 112G
# Rows in biggest table 1.2 Billion
Machines 4 x i2.2xlarge
Memory 64G
Cores 8
Storage 1.5TB SSDs
Cloud Provider AWS
We need a
PostgreSQL
cluster
STORY #1
We need reports on live data. We should probably
use a read replica for running them.
Hmm, RDS doesn’t support read replicas for
PostgreSQL yet. But PostgreSQL has synchronous
replication built in, we should be able to use that.
Also, we can’t be down for more than 5 seconds.
So not only do we need read replicas, we also need
automatic failovers. What tools can I use to do this?
Pgpool-II
connection pooling,
replication management, load balancing,
and request queuing
That seems like overkill, and that much
abstraction forces a black box on us.
Bucardo
multi-master, and asynchronous
replication
We need synchronous replication, and
we don’t need multi-master.
Repmgr
replication management
and automatic failover
Does one thing, does it well. Plus, it’s
written by 2nd Quadrant.
Tools, tools
The Repmgr setup
There is passwordless SSH access between all machines, and repmgrd
runs on each of them, enabling automatic failovers.
| id | type | upstream_node_id | cluster | name | priority | active |
|----+---------+------------------+---------+------------------+----------+--------|
| 1 | master | | prod | api-1-prod | 102 | t |
| 2 | standby | 1 | prod | api-2-prod | 101 | f |
| 3 | standby | 1 | prod | reporting-0-prod | -1 | f |
The Repmgr setup
Repmgr maintains its own small database and table with the nodes and
information on the replication state between them.
A few repmgr commands
$ repmgr -f /apps/repmgr.conf standby register
master register
standby register
standby clone
standby promote
standby switchover
standby follow
cluster show
Reporting
machine
Master
Standby Standby Standby
Synchronous replication
We have two standbys that we can failover to, and a reporting machine.
The applications write to the master, and can read from the standbys.
A brief look at the full setup
Oh! Repmgr doesn’t handle the communication
between the application and the DB cluster. How do
we know when a failover happens?
Let’s get them to talk to each other.
A failover is triggered when the master is inaccessible by any other node
in the cluster. A standby is then promoted as the new master.
When a failover happens, the new master makes an API call, telling the
application about the new cluster configuration, and the app fails over to it.
As a second line of defence to pushing the status, the application
also polls the status of the cluster for any changes.
A more sensible approach might be to use a Virtual IP, and use a retry
mechanism within the application to handle failovers.
Oh no! AWS says a machine is unreachable, and it’s
our master DB!
I’m unable to ssh into the machine, even.
Ha. But a failover happened, and we’re talking to
the new master DB. We’re all good.
What have we learnt?
• Repmgr does one thing, and does it well.
• We can use push and pull strategies, or a virtual IP
mechanism to communicate failovers directly to the
application.
• AWS might drop your box.
• Test failovers rigorously.
The disk
is full
STORY #2
Oh no! We are very slow, and failing SLA.
We can lose some data, but the service needs to be
up. Please fix it soon!
The disk usage is at 80%, and the DB is crawling!
The disk usage was only 72% last night, and we were
running the bulk deletion script. How did it go up to
80% overnight?
I need to fix the issue before debugging.
80%
All the DB machines are at about 80% disk utilisation. We need to
truncate a table to reclaim space immediately.
$ service app-db stop
$ repmgr -f /apps/repmgr.conf standby unregister
$ rm /db/dir/recovery.conf
$ service app-db start
Restarting a standby as a standalone instance
80%
Once we have taken a standby out of the cluster, the data within it
would be safe from any changes to master.
Standby node is out
of the cluster
Deleted data is safe
here, in a standalone
instance
20%
Now we can pull reports from the standalone instance while the
application serves requests in time.
We thought we'd fail at 90%, and that wasn't going
to happen for another week at least. So, why did we
fail at 80%?
Oh, it’s ZFS! ZFS best practices say"Keep pool space
under 80% utilization to maintain pool performance”.
Never go over 80% on ZFS.
Okay, but we were deleting from the DB last night;
that should’ve freed some space, right?
D’oh! Of course, PostgreSQL implements MVCC
(multi version concurrency control).
PostgreSQL MVCC implies
• DELETEs and UPDATEs just mark the row invisible to future transactions.
• AUTOVACUUM “removes” the invisible rows over time and adds them to the
free space map per relation.
• Actual disk space is not reclaimed to the OS during routine operations **.
• The default AUTOVACUUM worker configurations are ineffective for big
tables. We have no choice but to make them far more aggressive.
A rough state diagram for Vacuum
A snapshot of the monitoring of vacuum
What have we learnt?
• Standbys are a great live backups.
• 80% is critical for disk usage on ZFS.
• DELETEs don’t reclaim space immediately.
• Tune autovacuum workers aggressively.
• Things to monitor: Disk usage, dead_tups, autovacuum
Unable to
add a
standby
STORY #3
Let’s get a better reporting box.
We have way more data now and more report queries
too. So we need more IOPS, and more cores.
Easy Peasy! I’ll start the clone tonight.
LOG: started streaming WAL from primary at
4038/29000000 on timeline 2
There, it’s transferring the data at 40MB/s. We should
have our shiny new box up and running in the morning.
> FATAL: could not receive data from WAL
stream: ERROR: requested WAL segment
000000020000403800000029 has already been
removed
Oh no. I had to run reports on this machine today!
During pg_basebackup, the master DB continues to receive data, but
this data is not transmitted until after.
WAL (write ahead logs) data is streamed later from the WAL on the master. If
any WAL is discarded before the standby reads it, the recovery fails.
Hmm, it looks like we generated more than 8G last
night while the clone was happening, and
wal_keep_segments wasn’t high enough.
I think the ——rsync-only option in Repmgr should
help here, since I have most of the data on this
machine already.
Performing a checksum on every file of a large database to sync a
few missing gigabytes of WAL is quite inefficient.
Oh well. It’s almost the weekend, and traffic is low. I
could probably start a fresh clone, and keep
wal_keep_segments higher for now.
Okay, that should work for now.
But how do we fix it so it doesn’t happen again?
One way to fix this is to archive WALs and recover from the archive
if the required WALs are unavailable on master.
Another way is to stream the transaction log in parallel while running
the base backup. This is available since PostgreSQL 9.2.
Yet another way is to use filesystem backups, and then let the
standby catch up.
What have we learnt?
• WAL recovery is an integral part of setting a standby. Think about it.
• We can prevent against WAL recovery issues using:
• WAL archives
• Rsync
• Filesystem backups
• Things to monitor: network throughput, DB load and disk i/o on master
Too many
long running
queries
STORY #4
Hey, we’re getting many 500s while running reports
now. What’s going on?
ERROR: canceling statement due to conflict with recovery
Detail: User query might have needed to see row versions
that must be removed
Oh no, too many long queries!
The primary DB runs scattered reads and writes whereas the
reporting DB runs long queries.
small transactions
long queries
When queries are reading certain versions of rows that will change in
incoming WAL data, the WAL replay is paused.
ERROR: canceling statement due
to conflict with recovery
FATAL: the database system
is in recovery mode
PostgreSQL ensures that you’re never lagging back too much by
cancelling queries that exceed the configured delay time.
Fix it quick, and fix it forever.
For now, we can just increase
max_standby_streaming_delay. But, is it okay if the
primary gets bloated a bit based on the queries we run?
hot_standby_feedback will ensure the primary does not vacuum the
rows currently being read on standby, thereby preventing conflict.
No, let’s not do that. We have enough bloat already.
Then we don’t have much choice; we’ll have to
make our queries much faster.
Say, shouldn’t we be using a star schema or
partitions for our reporting database anyway?
Streaming replication, remember? We can’t change the
schema for the reporting database alone.
But, we can change the hardware underneath.
Reporting box can benefit from
heavier, chunkier I/O and parallelism.
> IOPS
> ZFS record-size
> Cores
PostgreSQL replication does not work across schemas, versions or
architectures. However, we can change the underlying hardware/filesystem.
What have we learnt?
• Standby queries might be cancelled due to recovery conflicts.
• Applying back pressure on primary is an option but causes bloat.
• We cannot use different schemas while using synchronous replication.
• We can change the filesystem or hardware without affecting replication.
• Things to monitor: replication lag, slow queries, bloat, vacuum
Other Solutions
• hot_standby_feedback: trade off bloat for longer queries
• Partitioning: implies heavier transactions, but enables parallel I/O
• Logical replication: transform SQL stream for the reporting schema
• Load balance: distribute load across multiple reporting machines
Split
Brain
SMALL #1
Assume there’s a network partition, and the master is unreachable. A
failover kicks in.
The failover happens successfully, and the application talks to the new
and correct primary.
| id | type | upstream_node_id | cluster | name | priority | active |
|----+---------+------------------+---------+------------------+----------+--------|
| 1 | FAILED | | prod | api-0-prod | 102 | f |
| 2 | master | | prod | api-1-prod | 101 | t |
| 3 | standby | 2 | prod | api-2-prod | 100 | t |
| 3 | standby | 2 | prod | reporting-0-prod | -1 | t |
Repmgr marks the node failed, as can be seen in the repl_nodes table.
But then, the master that went down, comes back up,
and we have two masters!
| id | type | upstream_node_id | cluster | name | priority | active |
|----+---------+------------------+---------+------------------+----------+--------|
| 1 | master | | prod | api-0-prod | 102 | t |
| 2 | master | | prod | api-1-prod | 101 | t |
| 3 | standby | 2 | prod | api-2-prod | -1 | t |
| 3 | standby | 2 | prod | reporting-0-prod | -1 | t |
Now repmgr shows both nodes as masters, and we have a split brain.
Shoot The Other
Node In The Head
STONITH
The app
doesn’t know
about a
failover
SMALL #2
A network failure or a bug in the promote_command might cause the
application to not failover correctly.
If the Virtual IP switch does not happen correctly, and there was a
failover in the cluster underneath, we have the same problem.
One way to fix this would be to have multiple lines of defence in detecting a
failover. The poll strategy described earlier is one such solution.
Let’s talk
about
backups
SMALL #3
+ Integral, already live, backup size is DB size
- Deletes/truncates cascade, not rewind-able
+ Replayable, helps resurrecting standbys
- Backup size, network bandwidth, redo time
+ Integral, selective, cross architecture
- Slow, high disk I/O, requires replication pause
+ Fast, cheap, versioned
- Integrity risk, restoration time, disk space bloat
The primary
is slow, not
dead
SMALL #4
The primary is slow because disk I/O
has degraded. But, this doesn’t trigger
a failover.
Possibly, one of the standbys could do
a better job being the master.
What would you do, to detect and fix
the issue?
Thank you!
On The
Building Of A
PostgreSQL
Cluster
Srihari Sriraman | nilenso

Contenu connexe

Tendances

Streaming huge databases using logical decoding
Streaming huge databases using logical decodingStreaming huge databases using logical decoding
Streaming huge databases using logical decodingAlexander Shulgin
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Command Prompt., Inc
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tPGConf APAC
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replicationMasao Fujii
 
pgpool-II demonstration
pgpool-II demonstrationpgpool-II demonstration
pgpool-II demonstrationelliando dias
 
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALEPostgreSQL Experts, Inc.
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
etcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Clusteretcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Clusterwinsletts
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...PostgreSQL-Consulting
 
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...Equnix Business Solutions
 
PostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackPostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackVibhor Kumar
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksCommand Prompt., Inc
 
Geographically Distributed PostgreSQL
Geographically Distributed PostgreSQLGeographically Distributed PostgreSQL
Geographically Distributed PostgreSQLmason_s
 
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...Equnix Business Solutions
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsMydbops
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the CloudMike Fowler
 

Tendances (20)

Streaming huge databases using logical decoding
Streaming huge databases using logical decodingStreaming huge databases using logical decoding
Streaming huge databases using logical decoding
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
pgpool-II demonstration
pgpool-II demonstrationpgpool-II demonstration
pgpool-II demonstration
 
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from Trenches
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
etcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Clusteretcd based PostgreSQL HA Cluster
etcd based PostgreSQL HA Cluster
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
 
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
 
PostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackPostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/Switchback
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
Geographically Distributed PostgreSQL
Geographically Distributed PostgreSQLGeographically Distributed PostgreSQL
Geographically Distributed PostgreSQL
 
JahiaOne - Performance Tuning
JahiaOne - Performance TuningJahiaOne - Performance Tuning
JahiaOne - Performance Tuning
 
Case Studies on PostgreSQL
Case Studies on PostgreSQLCase Studies on PostgreSQL
Case Studies on PostgreSQL
 
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...
PGConf.ASIA 2019 Bali - Setup a High-Availability and Load Balancing PostgreS...
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
 

En vedette

Managing replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsManaging replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsFuenteovejuna
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014EDB
 
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJava Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJAXLondon_Conference
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기PgDay.Seoul
 
24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQLInMobi Technology
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...Mark Wong
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci CompliaceDenish Patel
 
Microservices Past, Present, Future
Microservices Past, Present, FutureMicroservices Past, Present, Future
Microservices Past, Present, FutureDavid Dawson
 
Introduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XIDIntroduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XIDPGConf APAC
 
PostgreSQL: Past present Future
PostgreSQL: Past present FuturePostgreSQL: Past present Future
PostgreSQL: Past present FuturePGConf APAC
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentPGConf APAC
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrPGConf APAC
 
Past, Present, and Future Analysis of the Architectural & Engineering Design ...
Past, Present, and Future Analysis of the Architectural & Engineering Design ...Past, Present, and Future Analysis of the Architectural & Engineering Design ...
Past, Present, and Future Analysis of the Architectural & Engineering Design ...Lisa Dehner
 
PgDay Asia 2016 - Security Best Practices for your Postgres Deployment
PgDay Asia 2016 - Security Best Practices for your Postgres DeploymentPgDay Asia 2016 - Security Best Practices for your Postgres Deployment
PgDay Asia 2016 - Security Best Practices for your Postgres DeploymentAshnikbiz
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesPGConf APAC
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollPGConf APAC
 
PostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPGConf APAC
 

En vedette (20)

Managing replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsManaging replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon Riggs
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014
 
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJava Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기
 
24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci Compliace
 
Secure PostgreSQL deployment
Secure PostgreSQL deploymentSecure PostgreSQL deployment
Secure PostgreSQL deployment
 
Microservices Past, Present, Future
Microservices Past, Present, FutureMicroservices Past, Present, Future
Microservices Past, Present, Future
 
Introduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XIDIntroduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XID
 
PostgreSQL: Past present Future
PostgreSQL: Past present FuturePostgreSQL: Past present Future
PostgreSQL: Past present Future
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres Deployment
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgr
 
Past, Present, and Future Analysis of the Architectural & Engineering Design ...
Past, Present, and Future Analysis of the Architectural & Engineering Design ...Past, Present, and Future Analysis of the Architectural & Engineering Design ...
Past, Present, and Future Analysis of the Architectural & Engineering Design ...
 
PgDay Asia 2016 - Security Best Practices for your Postgres Deployment
PgDay Asia 2016 - Security Best Practices for your Postgres DeploymentPgDay Asia 2016 - Security Best Practices for your Postgres Deployment
PgDay Asia 2016 - Security Best Practices for your Postgres Deployment
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst Practices
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'roll
 
PostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPostgreSQL on Amazon RDS
PostgreSQL on Amazon RDS
 

Similaire à On The Building Of A PostgreSQL Cluster

Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Toronto-Oracle-Users-Group
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
 
Rubyslava + PyVo #48
Rubyslava + PyVo #48Rubyslava + PyVo #48
Rubyslava + PyVo #48Jozef Képesi
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsLaine Campbell
 
Optimizing elastic search on google compute engine
Optimizing elastic search on google compute engineOptimizing elastic search on google compute engine
Optimizing elastic search on google compute engineBhuvaneshwaran R
 
Running ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionRunning ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionSearce Inc
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingScyllaDB
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...Fred de Villamil
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the Worldjhugg
 
Low latency in java 8 v5
Low latency in java 8 v5Low latency in java 8 v5
Low latency in java 8 v5Peter Lawrey
 
Capacity Management from Flickr
Capacity Management from FlickrCapacity Management from Flickr
Capacity Management from Flickrxlight
 
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataDatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataHakka Labs
 
Leveraging Databricks for Spark Pipelines
Leveraging Databricks for Spark PipelinesLeveraging Databricks for Spark Pipelines
Leveraging Databricks for Spark PipelinesRose Toomey
 
Leveraging Databricks for Spark pipelines
Leveraging Databricks for Spark pipelinesLeveraging Databricks for Spark pipelines
Leveraging Databricks for Spark pipelinesRose Toomey
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraAmazon Web Services
 
Blades for HPTC
Blades for HPTCBlades for HPTC
Blades for HPTCGuy Coates
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 

Similaire à On The Building Of A PostgreSQL Cluster (20)

Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Rubyslava + PyVo #48
Rubyslava + PyVo #48Rubyslava + PyVo #48
Rubyslava + PyVo #48
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and Patterns
 
Optimizing elastic search on google compute engine
Optimizing elastic search on google compute engineOptimizing elastic search on google compute engine
Optimizing elastic search on google compute engine
 
Running ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in ProductionRunning ElasticSearch on Google Compute Engine in Production
Running ElasticSearch on Google Compute Engine in Production
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate Limiting
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
SUE 2018 - Migrating a 130TB Cluster from Elasticsearch 2 to 5 in 20 Hours Wi...
 
Ashawr perf kscope
Ashawr perf kscopeAshawr perf kscope
Ashawr perf kscope
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Low latency in java 8 v5
Low latency in java 8 v5Low latency in java 8 v5
Low latency in java 8 v5
 
Capacity Management from Flickr
Capacity Management from FlickrCapacity Management from Flickr
Capacity Management from Flickr
 
11g R2
11g R211g R2
11g R2
 
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast DataDatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
DatEngConf SF16 - Apache Kudu: Fast Analytics on Fast Data
 
Leveraging Databricks for Spark Pipelines
Leveraging Databricks for Spark PipelinesLeveraging Databricks for Spark Pipelines
Leveraging Databricks for Spark Pipelines
 
Leveraging Databricks for Spark pipelines
Leveraging Databricks for Spark pipelinesLeveraging Databricks for Spark pipelines
Leveraging Databricks for Spark pipelines
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon Aurora
 
Blades for HPTC
Blades for HPTCBlades for HPTC
Blades for HPTC
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 

Plus de Srihari Sriraman

REPL Driven Mobile Development with Clojure(script)
REPL Driven Mobile Development with Clojure(script)REPL Driven Mobile Development with Clojure(script)
REPL Driven Mobile Development with Clojure(script)Srihari Sriraman
 
Practical Generative Testing Patterns
Practical Generative Testing PatternsPractical Generative Testing Patterns
Practical Generative Testing PatternsSrihari Sriraman
 
Making machines that make music
Making machines that make musicMaking machines that make music
Making machines that make musicSrihari Sriraman
 
Overlapping Experiments Infrastructure
Overlapping Experiments InfrastructureOverlapping Experiments Infrastructure
Overlapping Experiments InfrastructureSrihari Sriraman
 
Building an Experimentation Platform in Clojure
Building an Experimentation Platform in ClojureBuilding an Experimentation Platform in Clojure
Building an Experimentation Platform in ClojureSrihari Sriraman
 
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014Srihari Sriraman
 

Plus de Srihari Sriraman (9)

REPL Driven Mobile Development with Clojure(script)
REPL Driven Mobile Development with Clojure(script)REPL Driven Mobile Development with Clojure(script)
REPL Driven Mobile Development with Clojure(script)
 
Practical Generative Testing Patterns
Practical Generative Testing PatternsPractical Generative Testing Patterns
Practical Generative Testing Patterns
 
Making machines that make music
Making machines that make musicMaking machines that make music
Making machines that make music
 
Overlapping Experiments Infrastructure
Overlapping Experiments InfrastructureOverlapping Experiments Infrastructure
Overlapping Experiments Infrastructure
 
Building an Experimentation Platform in Clojure
Building an Experimentation Platform in ClojureBuilding an Experimentation Platform in Clojure
Building an Experimentation Platform in Clojure
 
Carnatic Music Synthesis
Carnatic Music SynthesisCarnatic Music Synthesis
Carnatic Music Synthesis
 
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014
Making an impact in Rural India with Ruby - Lightning talk at GCRC 2014
 
Rails on Mobile
Rails on MobileRails on Mobile
Rails on Mobile
 
Carnatic Music App
Carnatic Music AppCarnatic Music App
Carnatic Music App
 

Dernier

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Dernier (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

On The Building Of A PostgreSQL Cluster

  • 1. On The Building Of A PostgreSQL Cluster Srihari Sriraman | nilenso
  • 3. Each story shall cover • Problem • Quick fix • Root cause • Correct fix • Lessons learnt
  • 5. What’s the biz? • Experimentation platform in the staples-sparx ecosystem • Used to drive important business decisions • Needs to do 2 things: • Serve real time requests in low latency • Report over a few months of live data
  • 6. Why PostgreSQL? • Data integrity is paramount • Tight performance constraints • Medium sized data warehouse
  • 7. How impressive are your numbers? SLA 99.9% < 10ms RPS 500 QPS 1.5k TPS 4.5k Daily Size Increase 8G DB Size (OLTP) 600G Biggest Table Size 104G Biggest Index Size 112G # Rows in biggest table 1.2 Billion Machines 4 x i2.2xlarge Memory 64G Cores 8 Storage 1.5TB SSDs Cloud Provider AWS
  • 9. We need reports on live data. We should probably use a read replica for running them. Hmm, RDS doesn’t support read replicas for PostgreSQL yet. But PostgreSQL has synchronous replication built in, we should be able to use that.
  • 10. Also, we can’t be down for more than 5 seconds. So not only do we need read replicas, we also need automatic failovers. What tools can I use to do this?
  • 11. Pgpool-II connection pooling, replication management, load balancing, and request queuing That seems like overkill, and that much abstraction forces a black box on us. Bucardo multi-master, and asynchronous replication We need synchronous replication, and we don’t need multi-master. Repmgr replication management and automatic failover Does one thing, does it well. Plus, it’s written by 2nd Quadrant. Tools, tools
  • 12. The Repmgr setup There is passwordless SSH access between all machines, and repmgrd runs on each of them, enabling automatic failovers.
  • 13. | id | type | upstream_node_id | cluster | name | priority | active | |----+---------+------------------+---------+------------------+----------+--------| | 1 | master | | prod | api-1-prod | 102 | t | | 2 | standby | 1 | prod | api-2-prod | 101 | f | | 3 | standby | 1 | prod | reporting-0-prod | -1 | f | The Repmgr setup Repmgr maintains its own small database and table with the nodes and information on the replication state between them.
  • 14. A few repmgr commands $ repmgr -f /apps/repmgr.conf standby register master register standby register standby clone standby promote standby switchover standby follow cluster show
  • 15. Reporting machine Master Standby Standby Standby Synchronous replication We have two standbys that we can failover to, and a reporting machine. The applications write to the master, and can read from the standbys. A brief look at the full setup
  • 16. Oh! Repmgr doesn’t handle the communication between the application and the DB cluster. How do we know when a failover happens? Let’s get them to talk to each other.
  • 17. A failover is triggered when the master is inaccessible by any other node in the cluster. A standby is then promoted as the new master.
  • 18. When a failover happens, the new master makes an API call, telling the application about the new cluster configuration, and the app fails over to it.
  • 19. As a second line of defence to pushing the status, the application also polls the status of the cluster for any changes.
  • 20. A more sensible approach might be to use a Virtual IP, and use a retry mechanism within the application to handle failovers.
  • 21. Oh no! AWS says a machine is unreachable, and it’s our master DB! I’m unable to ssh into the machine, even. Ha. But a failover happened, and we’re talking to the new master DB. We’re all good.
  • 22. What have we learnt? • Repmgr does one thing, and does it well. • We can use push and pull strategies, or a virtual IP mechanism to communicate failovers directly to the application. • AWS might drop your box. • Test failovers rigorously.
  • 24. Oh no! We are very slow, and failing SLA. We can lose some data, but the service needs to be up. Please fix it soon! The disk usage is at 80%, and the DB is crawling! The disk usage was only 72% last night, and we were running the bulk deletion script. How did it go up to 80% overnight? I need to fix the issue before debugging.
  • 25. 80% All the DB machines are at about 80% disk utilisation. We need to truncate a table to reclaim space immediately.
  • 26. $ service app-db stop $ repmgr -f /apps/repmgr.conf standby unregister $ rm /db/dir/recovery.conf $ service app-db start Restarting a standby as a standalone instance
  • 27. 80% Once we have taken a standby out of the cluster, the data within it would be safe from any changes to master. Standby node is out of the cluster
  • 28. Deleted data is safe here, in a standalone instance 20% Now we can pull reports from the standalone instance while the application serves requests in time.
  • 29. We thought we'd fail at 90%, and that wasn't going to happen for another week at least. So, why did we fail at 80%? Oh, it’s ZFS! ZFS best practices say"Keep pool space under 80% utilization to maintain pool performance”. Never go over 80% on ZFS.
  • 30. Okay, but we were deleting from the DB last night; that should’ve freed some space, right? D’oh! Of course, PostgreSQL implements MVCC (multi version concurrency control).
  • 31. PostgreSQL MVCC implies • DELETEs and UPDATEs just mark the row invisible to future transactions. • AUTOVACUUM “removes” the invisible rows over time and adds them to the free space map per relation. • Actual disk space is not reclaimed to the OS during routine operations **. • The default AUTOVACUUM worker configurations are ineffective for big tables. We have no choice but to make them far more aggressive.
  • 32. A rough state diagram for Vacuum
  • 33. A snapshot of the monitoring of vacuum
  • 34. What have we learnt? • Standbys are a great live backups. • 80% is critical for disk usage on ZFS. • DELETEs don’t reclaim space immediately. • Tune autovacuum workers aggressively. • Things to monitor: Disk usage, dead_tups, autovacuum
  • 36. Let’s get a better reporting box. We have way more data now and more report queries too. So we need more IOPS, and more cores. Easy Peasy! I’ll start the clone tonight. LOG: started streaming WAL from primary at 4038/29000000 on timeline 2 There, it’s transferring the data at 40MB/s. We should have our shiny new box up and running in the morning.
  • 37. > FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000020000403800000029 has already been removed Oh no. I had to run reports on this machine today!
  • 38. During pg_basebackup, the master DB continues to receive data, but this data is not transmitted until after.
  • 39. WAL (write ahead logs) data is streamed later from the WAL on the master. If any WAL is discarded before the standby reads it, the recovery fails.
  • 40. Hmm, it looks like we generated more than 8G last night while the clone was happening, and wal_keep_segments wasn’t high enough. I think the ——rsync-only option in Repmgr should help here, since I have most of the data on this machine already.
  • 41. Performing a checksum on every file of a large database to sync a few missing gigabytes of WAL is quite inefficient.
  • 42. Oh well. It’s almost the weekend, and traffic is low. I could probably start a fresh clone, and keep wal_keep_segments higher for now. Okay, that should work for now. But how do we fix it so it doesn’t happen again?
  • 43. One way to fix this is to archive WALs and recover from the archive if the required WALs are unavailable on master.
  • 44. Another way is to stream the transaction log in parallel while running the base backup. This is available since PostgreSQL 9.2.
  • 45. Yet another way is to use filesystem backups, and then let the standby catch up.
  • 46. What have we learnt? • WAL recovery is an integral part of setting a standby. Think about it. • We can prevent against WAL recovery issues using: • WAL archives • Rsync • Filesystem backups • Things to monitor: network throughput, DB load and disk i/o on master
  • 48. Hey, we’re getting many 500s while running reports now. What’s going on? ERROR: canceling statement due to conflict with recovery Detail: User query might have needed to see row versions that must be removed Oh no, too many long queries!
  • 49. The primary DB runs scattered reads and writes whereas the reporting DB runs long queries. small transactions long queries
  • 50. When queries are reading certain versions of rows that will change in incoming WAL data, the WAL replay is paused.
  • 51. ERROR: canceling statement due to conflict with recovery FATAL: the database system is in recovery mode PostgreSQL ensures that you’re never lagging back too much by cancelling queries that exceed the configured delay time.
  • 52. Fix it quick, and fix it forever. For now, we can just increase max_standby_streaming_delay. But, is it okay if the primary gets bloated a bit based on the queries we run?
  • 53. hot_standby_feedback will ensure the primary does not vacuum the rows currently being read on standby, thereby preventing conflict.
  • 54. No, let’s not do that. We have enough bloat already. Then we don’t have much choice; we’ll have to make our queries much faster.
  • 55. Say, shouldn’t we be using a star schema or partitions for our reporting database anyway? Streaming replication, remember? We can’t change the schema for the reporting database alone. But, we can change the hardware underneath.
  • 56. Reporting box can benefit from heavier, chunkier I/O and parallelism. > IOPS > ZFS record-size > Cores PostgreSQL replication does not work across schemas, versions or architectures. However, we can change the underlying hardware/filesystem.
  • 57. What have we learnt? • Standby queries might be cancelled due to recovery conflicts. • Applying back pressure on primary is an option but causes bloat. • We cannot use different schemas while using synchronous replication. • We can change the filesystem or hardware without affecting replication. • Things to monitor: replication lag, slow queries, bloat, vacuum
  • 58. Other Solutions • hot_standby_feedback: trade off bloat for longer queries • Partitioning: implies heavier transactions, but enables parallel I/O • Logical replication: transform SQL stream for the reporting schema • Load balance: distribute load across multiple reporting machines
  • 60. Assume there’s a network partition, and the master is unreachable. A failover kicks in.
  • 61. The failover happens successfully, and the application talks to the new and correct primary.
  • 62. | id | type | upstream_node_id | cluster | name | priority | active | |----+---------+------------------+---------+------------------+----------+--------| | 1 | FAILED | | prod | api-0-prod | 102 | f | | 2 | master | | prod | api-1-prod | 101 | t | | 3 | standby | 2 | prod | api-2-prod | 100 | t | | 3 | standby | 2 | prod | reporting-0-prod | -1 | t | Repmgr marks the node failed, as can be seen in the repl_nodes table.
  • 63. But then, the master that went down, comes back up, and we have two masters!
  • 64. | id | type | upstream_node_id | cluster | name | priority | active | |----+---------+------------------+---------+------------------+----------+--------| | 1 | master | | prod | api-0-prod | 102 | t | | 2 | master | | prod | api-1-prod | 101 | t | | 3 | standby | 2 | prod | api-2-prod | -1 | t | | 3 | standby | 2 | prod | reporting-0-prod | -1 | t | Now repmgr shows both nodes as masters, and we have a split brain.
  • 65. Shoot The Other Node In The Head STONITH
  • 66. The app doesn’t know about a failover SMALL #2
  • 67. A network failure or a bug in the promote_command might cause the application to not failover correctly.
  • 68. If the Virtual IP switch does not happen correctly, and there was a failover in the cluster underneath, we have the same problem.
  • 69. One way to fix this would be to have multiple lines of defence in detecting a failover. The poll strategy described earlier is one such solution.
  • 71. + Integral, already live, backup size is DB size - Deletes/truncates cascade, not rewind-able + Replayable, helps resurrecting standbys - Backup size, network bandwidth, redo time
  • 72. + Integral, selective, cross architecture - Slow, high disk I/O, requires replication pause + Fast, cheap, versioned - Integrity risk, restoration time, disk space bloat
  • 73. The primary is slow, not dead SMALL #4
  • 74. The primary is slow because disk I/O has degraded. But, this doesn’t trigger a failover. Possibly, one of the standbys could do a better job being the master. What would you do, to detect and fix the issue?
  • 76. On The Building Of A PostgreSQL Cluster Srihari Sriraman | nilenso