11. The Good
● Fast deployment
– new servers in minutes, with a script
● Easy scale-out
– add replicas in minutes
● Minimize ops staff
– no HW wranglers
33. PrIOPS fallacy
● not a guarantee, a limit
– but mostly pretty consistent
● each IOP is no more than 8K
● random access → each page is an IOP
– no real prefetch
● PrIOPS ~ rows/second
34. Stuff to Set Up
● Backup: WAL-E to S3
● Replication: not optional
– in another Availbility Zone
● Monitoring for instance failure
● Secure your instance
– SSL
– pg_hba.conf
35. Configuration Tips
● random_page_cost = 1.5
● wal_buffers = 32 to 64MB
● stats_temp_directory =
/mnt/tmpfs/stats
● synchronous_commit = off
– if you can afford it
44. RDS --
● Limited extensions
● 9.3 only
– and not promptly updated
● No shell access
● Still might have to configure
Postgres
45. Rancher equipment
● Integration with some AWS sevices
– caching
– S3 snapshotting
– plus regular access to other services
● 2 dozen extensions available
46. RDS Options
● Instance types:
– same m3.* and r3.* options
– no c3 or i3 instances currently
● again, get enough RAM
● All storage is EBS
– take PrIOPS storage options
47. RDS redundancy
● Do Multi-AZ instances or replication
– Multi-AZ: automated failover
– Replication: better performance
● Set up auto DB snapshots
– automatically deleted snapshots?
48. RDS configuration
● Same as Roll-Your-Own
– except: be cautious, defaults are OK
● Except fewer security options
61. pgbench++
● ships with Postgres
● microbenchmark
– very simple “bank trade” workload
● fast to set up and run
62. pgbench--
● doesn't do complex queries
● pure random data / access
● unrealistic balance of work
– too reliant on single-row write speed
● not very tunable
63. pgbench sizing
1. memory read-write (RW):
– 50% of RAM, write transactions
2. memory read-only (RO):
– 50% of RAM, read-only queries
3. disk read-write (RW):
– 200% of RAM, write transactions
72. features
Versions Extensions Superuser Replication
EC2 Any All Yes Yes
RDS 9.3 only Some No Yes
Heroku 9.3, 9.4, betas Some No Yes
Auto-
Failover
Snapshots Extras Support
EC2 No DIY DIY No
RDS Yes* Yes No No
Heroku Yes Yes Yes Yes
89. “running with scissors”
● test for pure ephemeral instances
● no transaction log
● local SSD
● just for RO load-balancing
90. more shooting
● Josh Berkus: josh@pgexperts.com
– www.pgexperts.com
● More Shootouts
– www.databasesoup.com
– https://github.com/manageacloud/cloud-
benchmark-postgres/
– pgConf.US NYC, pgCon Ottawa
Copyright 2015 PostgreSQL Experts Inc. Released under the Creative Commons
Share-Alike 3.0 License. All images and trademarks are the property of their
respective owners.