SlideShare a Scribd company logo
Postgresql in Education
AICT, University of Alberta
Postgresql in Education
Academic Information & Communication Technologies
http://www.aict.ualberta.ca
Application Hosting
Currently 6 people taking care of
•  Shared Oracle environment with about 120 databases and
applications
•  Shared SQL Server environment with about 150+ databases and
applications
•  Individual databases and applications ~200 (oracle, sql server,
mysql, postgresql, tomcat, alfresco, AIM, moodle, etc.)
•  SLA’s from on-incident support, business hours to 24x7 support.
•  Dealing with Financial data and private (FOIP protected) data
•  Go to team for application / database errors for people we do not
directly support.
•  Transitioning and consolidating applications and databases from
around 75 departments.
Initiation
Implement
Project
Management
Group
Service Life cycle
Why am I here?
In 2010 University of Alberta was looking for a new Learning Content Management
System. Our existing system was Blackboard Vista running on Oracle.
Objectives:
-  Reduce licensing costs
-  Create a service people want to use
-  Improve service reliability
-  Collaborate with other institutions across the province and beyond 
We selected Moodle (Open Source) on Postgresql (9.0). Migration took around 2
years.
Central Learning Management System
Upcoming and existing projects using Postgresql
OTRS Ticketing System
Primary
Secondary
(used for
searching)
Reporting
DB
Jaspersoft Business Intelligence
Enterprise Document and Records Management System
•  Business critical records like land titles, contracts, billing, student records
•  Expected size in 1 year – 1.5 TB (DB + FS) with 3 departments on board.
•  73 more departments to go
New Shared Postgresql Environment
•  24x7 managed shared environment
•  Automated replication to TEST / UAT
•  Service reporting for clients?
Core considerations
•  We are not particularly big or busy
•  We do care about our data (and jobs!)
•  People are expensive
•  Incidents are expensive and disruptive
•  Reliability is important, up to a point.
•  KISS. Over-engineering usually comes with high
maintenance costs.
Lessons Learned
•  Only change things you absolutely need.
•  vm.dirty_bytes and vm.dirty_background_bytes
•  Autovacuum is usually just fine (but give it more
maintenance memory)
•  Iptables and pg_hba.conf. Only allow specific ip’s
access to your database servers.
•  To pool or not to pool?
•  Omnipitr is your friend
Basic backup procedure
Monitoring
•  CPU
•  RAM
•  Disk
•  Presence of postgresql process
•  Backups (including temporary space)
•  Replication status
•  Long running queries
•  ?
Load Replication ideas / procedure
TEST / UAT environments never see the same level of
traffic as production.
1.  Query pg_stat_activity on a schedule
2.  Get a sampling of all the queries being run (caveats)
3.  Generate statistics on the data (order by times a given
query was run)
4.  Create a pgbench script to be used against your test /
uat.
5.  include write queries as well as read for better testing.
0
20
40
60
80
100
120
140
160
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61
Average tps, 500 users, Read/write workload on SSD, 50 GB
DB.
Average tps
Example performance run
Upgrading
Option 1: pg_upgrade:
•  ~ 24 hours to perform upgrade – not acceptable
Option 2: Dump / restore
•  time pg_dump -p 5434 -Fc moodle > moodle.dump (9m
30 sec)
•  time pg_restore -C -e -j 4 -v -d postgres moodle.dump
(131 m)
Option 3: Upgrade standby and setup replication?
•  Needs testing
Challenges moving into hosting a multi-tenant
environment.
•  Identifying problem queries and clients
•  Isolating problem clients (limiting cpu / ram)
•  Generating client usage reports
•  Better upgrade procedure
•  Minimizing maintenance tasks – setting up schedules
for test / uat.
Challenges moving into hosting a multi-tenant
environment.
•  Identifying problem queries and clients
•  Isolating problem clients (limiting cpu / ram, disk)
•  Generating client usage reports
•  Migrating from other systems? Oracle? SQL Server?
MySQL?
Closing notes
•  Slides, documentation and scripts available at
http://www.ualberta.ca/~dostatni/pgcon2013
•  Please contact me if you have any questions. I am
happy to help – dostatni@ualberta.ca
•  Questions?
Postgresql in Education

More Related Content

What's hot (20)

PDF
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
PPTX
Geek Sync | Performance Tune Like an MVP
IDERA Software
 
PDF
2016 may-countdown-to-postgres-v96-parallel-query
Ashnikbiz
 
PDF
MySQL Backup & Recovery
Mindfire Solutions
 
PPTX
PostgreSQL Hangout Parameter Tuning
Ashnikbiz
 
PPTX
SQL 2014 In-Memory OLTP
Amber Keyse
 
PDF
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
PPTX
Webinar: Overcoming the Storage Challenges Cassandra and Couchbase Create
Storage Switzerland
 
PPTX
Right-Sizing your SQL Server Virtual Machine
heraflux
 
PDF
Remote Database Administration Services | Shreeyansh Technologies
Shreeyansh Technologies | the Database Company
 
DOC
Sasi-AIX 3+ Resume
Peyyala Sasidhar Reddy
 
PPTX
Planning & Best Practice for Microsoft Virtualization
Lai Yoong Seng
 
PDF
Enterprise PostgreSQL - EDB's answer to conventional Databases
Ashnikbiz
 
PDF
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
PDF
PostgreSQL Scaling And Failover
John Paulett
 
PDF
Concurrency
Biju Nair
 
PDF
Postgres Plus Cloud Database on OpenStack
Kamesh Pemmaraju
 
PDF
Ehcache Architecture, Features And Usage Patterns
Eduardo Pelegri-Llopart
 
PDF
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
PDF
PostgreSQL replication
Masao Fujii
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
Geek Sync | Performance Tune Like an MVP
IDERA Software
 
2016 may-countdown-to-postgres-v96-parallel-query
Ashnikbiz
 
MySQL Backup & Recovery
Mindfire Solutions
 
PostgreSQL Hangout Parameter Tuning
Ashnikbiz
 
SQL 2014 In-Memory OLTP
Amber Keyse
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
Webinar: Overcoming the Storage Challenges Cassandra and Couchbase Create
Storage Switzerland
 
Right-Sizing your SQL Server Virtual Machine
heraflux
 
Remote Database Administration Services | Shreeyansh Technologies
Shreeyansh Technologies | the Database Company
 
Sasi-AIX 3+ Resume
Peyyala Sasidhar Reddy
 
Planning & Best Practice for Microsoft Virtualization
Lai Yoong Seng
 
Enterprise PostgreSQL - EDB's answer to conventional Databases
Ashnikbiz
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
PostgreSQL Scaling And Failover
John Paulett
 
Concurrency
Biju Nair
 
Postgres Plus Cloud Database on OpenStack
Kamesh Pemmaraju
 
Ehcache Architecture, Features And Usage Patterns
Eduardo Pelegri-Llopart
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL-Consulting
 
PostgreSQL replication
Masao Fujii
 

Similar to Postgresql in Education (20)

PDF
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
PDF
The Accidental DBA
PostgreSQL Experts, Inc.
 
KEY
Grabbing the PostgreSQL Elephant by the Trunk
Harold Giménez
 
PDF
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Gabriele Bartolini
 
PPTX
Scaling a SaaS backend with PostgreSQL - A case study
Oliver Seemann
 
PDF
Creating PostgreSQL-as-a-Service at Scale
Sean Chittenden
 
PPTX
Postgre sql best_practices
Jacques Kostic
 
PPTX
PostgreSQL- An Introduction
Smita Prasad
 
PPTX
TechEvent PostgreSQL Best Practices
Trivadis
 
PPTX
Postgre sql best_practices
Emiliano Fusaglia
 
PDF
Building a Complex, Real-Time Data Management Application
Jonathan Katz
 
PDF
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
Equnix Business Solutions
 
ODP
Pro PostgreSQL, OSCon 2008
Robert Treat
 
PDF
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Jignesh Shah
 
PDF
Oracle to PostgreSQL, Challenges to Opportunity.pdf
Equnix Business Solutions
 
PDF
0292-introduction-postgresql.pdf
Mustafa Keskin
 
ODP
Introduction to PostgreSQL
Jim Mlodgenski
 
PDF
PostgreSQL Prologue
Md. Golam Hossain
 
PDF
Postgres in Production - Best Practices 2014
EDB
 
KEY
PostgreSQL
Reuven Lerner
 
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
The Accidental DBA
PostgreSQL Experts, Inc.
 
Grabbing the PostgreSQL Elephant by the Trunk
Harold Giménez
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Gabriele Bartolini
 
Scaling a SaaS backend with PostgreSQL - A case study
Oliver Seemann
 
Creating PostgreSQL-as-a-Service at Scale
Sean Chittenden
 
Postgre sql best_practices
Jacques Kostic
 
PostgreSQL- An Introduction
Smita Prasad
 
TechEvent PostgreSQL Best Practices
Trivadis
 
Postgre sql best_practices
Emiliano Fusaglia
 
Building a Complex, Real-Time Data Management Application
Jonathan Katz
 
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
Equnix Business Solutions
 
Pro PostgreSQL, OSCon 2008
Robert Treat
 
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Jignesh Shah
 
Oracle to PostgreSQL, Challenges to Opportunity.pdf
Equnix Business Solutions
 
0292-introduction-postgresql.pdf
Mustafa Keskin
 
Introduction to PostgreSQL
Jim Mlodgenski
 
PostgreSQL Prologue
Md. Golam Hossain
 
Postgres in Production - Best Practices 2014
EDB
 
PostgreSQL
Reuven Lerner
 
Ad

Recently uploaded (20)

PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Dimensions of Societal Planning in Commonism
StefanMz
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
community health nursing question paper 2.pdf
Prince kumar
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Ad

Postgresql in Education

  • 1. Postgresql in Education AICT, University of Alberta
  • 3. Academic Information & Communication Technologies http://www.aict.ualberta.ca
  • 4. Application Hosting Currently 6 people taking care of •  Shared Oracle environment with about 120 databases and applications •  Shared SQL Server environment with about 150+ databases and applications •  Individual databases and applications ~200 (oracle, sql server, mysql, postgresql, tomcat, alfresco, AIM, moodle, etc.) •  SLA’s from on-incident support, business hours to 24x7 support. •  Dealing with Financial data and private (FOIP protected) data •  Go to team for application / database errors for people we do not directly support. •  Transitioning and consolidating applications and databases from around 75 departments.
  • 6. Why am I here? In 2010 University of Alberta was looking for a new Learning Content Management System. Our existing system was Blackboard Vista running on Oracle. Objectives: -  Reduce licensing costs -  Create a service people want to use -  Improve service reliability -  Collaborate with other institutions across the province and beyond We selected Moodle (Open Source) on Postgresql (9.0). Migration took around 2 years.
  • 8. Upcoming and existing projects using Postgresql OTRS Ticketing System Primary Secondary (used for searching) Reporting DB Jaspersoft Business Intelligence Enterprise Document and Records Management System •  Business critical records like land titles, contracts, billing, student records •  Expected size in 1 year – 1.5 TB (DB + FS) with 3 departments on board. •  73 more departments to go New Shared Postgresql Environment •  24x7 managed shared environment •  Automated replication to TEST / UAT •  Service reporting for clients?
  • 9. Core considerations •  We are not particularly big or busy •  We do care about our data (and jobs!) •  People are expensive •  Incidents are expensive and disruptive •  Reliability is important, up to a point. •  KISS. Over-engineering usually comes with high maintenance costs.
  • 10. Lessons Learned •  Only change things you absolutely need. •  vm.dirty_bytes and vm.dirty_background_bytes •  Autovacuum is usually just fine (but give it more maintenance memory) •  Iptables and pg_hba.conf. Only allow specific ip’s access to your database servers. •  To pool or not to pool? •  Omnipitr is your friend
  • 12. Monitoring •  CPU •  RAM •  Disk •  Presence of postgresql process •  Backups (including temporary space) •  Replication status •  Long running queries •  ?
  • 13. Load Replication ideas / procedure TEST / UAT environments never see the same level of traffic as production. 1.  Query pg_stat_activity on a schedule 2.  Get a sampling of all the queries being run (caveats) 3.  Generate statistics on the data (order by times a given query was run) 4.  Create a pgbench script to be used against your test / uat. 5.  include write queries as well as read for better testing.
  • 14. 0 20 40 60 80 100 120 140 160 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 Average tps, 500 users, Read/write workload on SSD, 50 GB DB. Average tps Example performance run
  • 15. Upgrading Option 1: pg_upgrade: •  ~ 24 hours to perform upgrade – not acceptable Option 2: Dump / restore •  time pg_dump -p 5434 -Fc moodle > moodle.dump (9m 30 sec) •  time pg_restore -C -e -j 4 -v -d postgres moodle.dump (131 m) Option 3: Upgrade standby and setup replication? •  Needs testing
  • 16. Challenges moving into hosting a multi-tenant environment. •  Identifying problem queries and clients •  Isolating problem clients (limiting cpu / ram) •  Generating client usage reports •  Better upgrade procedure •  Minimizing maintenance tasks – setting up schedules for test / uat.
  • 17. Challenges moving into hosting a multi-tenant environment. •  Identifying problem queries and clients •  Isolating problem clients (limiting cpu / ram, disk) •  Generating client usage reports •  Migrating from other systems? Oracle? SQL Server? MySQL?
  • 18. Closing notes •  Slides, documentation and scripts available at http://www.ualberta.ca/~dostatni/pgcon2013 •  Please contact me if you have any questions. I am happy to help – [email protected] •  Questions?