SlideShare a Scribd company logo
1 of 19
Download to read offline
Postgresql in Education
AICT, University of Alberta
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

Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft Virtualization
Lai Yoong Seng
 

What's hot (20)

Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVP
 
2016 may-countdown-to-postgres-v96-parallel-query
2016 may-countdown-to-postgres-v96-parallel-query2016 may-countdown-to-postgres-v96-parallel-query
2016 may-countdown-to-postgres-v96-parallel-query
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
PostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter TuningPostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter Tuning
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
 
Webinar: Overcoming the Storage Challenges Cassandra and Couchbase Create
Webinar: Overcoming the Storage Challenges Cassandra and Couchbase CreateWebinar: Overcoming the Storage Challenges Cassandra and Couchbase Create
Webinar: Overcoming the Storage Challenges Cassandra and Couchbase Create
 
Right-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual MachineRight-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual Machine
 
Remote Database Administration Services | Shreeyansh Technologies
Remote Database Administration Services | Shreeyansh TechnologiesRemote Database Administration Services | Shreeyansh Technologies
Remote Database Administration Services | Shreeyansh Technologies
 
Sasi-AIX 3+ Resume
Sasi-AIX 3+ ResumeSasi-AIX 3+ Resume
Sasi-AIX 3+ Resume
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft Virtualization
 
Enterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional DatabasesEnterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional Databases
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And Failover
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Postgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStackPostgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStack
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 

Similar to Postgresql in Education

Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502
kaziul Islam Bulbul
 

Similar to Postgresql in Education (20)

Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)Mtc learnings from isv & enterprise (dated - Dec -2014)
Mtc learnings from isv & enterprise (dated - Dec -2014)
 
Mtc learnings from isv & enterprise interaction
Mtc learnings from isv & enterprise  interactionMtc learnings from isv & enterprise  interaction
Mtc learnings from isv & enterprise interaction
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Adding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance TestAdding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance Test
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right
 
10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public Cloud10 Tips for Your Journey to the Public Cloud
10 Tips for Your Journey to the Public Cloud
 
Speeding Up Atlas Deep Learning Platform with Alluxio + Fluid
Speeding Up Atlas Deep Learning Platform with Alluxio + FluidSpeeding Up Atlas Deep Learning Platform with Alluxio + Fluid
Speeding Up Atlas Deep Learning Platform with Alluxio + Fluid
 
Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA Best Practices for Becoming an Exceptional Postgres DBA
Best Practices for Becoming an Exceptional Postgres DBA
 
05. performance-concepts-26-slides
05. performance-concepts-26-slides05. performance-concepts-26-slides
05. performance-concepts-26-slides
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 
Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502
 
DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010
 
rakesh_resume
rakesh_resumerakesh_resume
rakesh_resume
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
Surviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource ManagerSurviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource Manager
 
(ATS6-PLAT07) Managing AEP in an enterprise environment
(ATS6-PLAT07) Managing AEP in an enterprise environment(ATS6-PLAT07) Managing AEP in an enterprise environment
(ATS6-PLAT07) Managing AEP in an enterprise environment
 
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The SequelVMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
 
Oracle RAC - Customer Proven Scalability
Oracle RAC - Customer Proven ScalabilityOracle RAC - Customer Proven Scalability
Oracle RAC - Customer Proven Scalability
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Postgresql in Education

  • 1. Postgresql in Education AICT, University of Alberta
  • 2.
  • 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 – dostatni@ualberta.ca •  Questions?