Sakai and mysql Stephen Marquard, David Horwitz University of Cape Town July 2008.

Slides:



Advertisements
Similar presentations
Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
Advertisements

Advanced Tuning: Unconventional Solutions to Everyday Problems Robert L Davis.
Enhancing Application Performance Root Causes and Quick Solutions.
Refeng Wu CQ5 WCM System Administrator
MySQL DBA Spring Topics in the MySQL AB DBA Course I Describe the MySQL Architecture, general operational characteristics and resources utilized.
Copyright © 2011 by the Commonwealth of Pennsylvania. All Rights Reserved. Load Test Report.
Wilma Hodges  Began faculty training and moving content in Nov  Original plan was to be fully migrated to Sakai by.
Analysis and Performance Information Systems 337 Prof. Harry Plantinga.
1 How to improve SQL Performance with new Health Check Tool? Carlos Sierra Consulting Technical Advisor © 2012 Oracle Corporation – Proprietary and Confidential.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Presented by Jacob Wilson SharePoint Practice Lead Bross Group 1.
Capacity Planning in SharePoint Capacity Planning Process of evaluating a technology … Deciding … Hardware … Variety of Ways Different Services.
Russ Houberg Senior Technical Architect, MCM KnowledgeLake, Inc.
Replication with MySQL 5.1 Ligaya Turmelle Senior Technical Support Engineer - MySQL
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
IBM Software Group Washington Area Informix User Group Forum 2004 The DB2 DBA Checklist Dwaine R Snow, DB2 & Informix.
Monitoring Scale-Out with the MySQL Enterprise Monitor Andy Bang Lead Software Engineer MySQL-Sun, Enterprise Tools Team Wednesday, April 16, :15.
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
12-Jun-2007 Sakai Metrics at Indiana University1 That Which is Monitored, Improves Dan McKee & Megan May.
Why does my perfectly working App Crash and Burn in Production? Matt Kramer Project Manager, STL Boeing Scalability Test Lab cell.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Strength. Strategy. Stability.. Progress Performance Monitoring and Tuning Dan Foreman Progress Expert BravePoint BravePoint
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions.
Copyright 2006 MySQL AB The World’s Most Popular Open Source Database MySQL Cluster: An introduction Geert Vanderkelen MySQL AB.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Installing, Configuring And Troubleshooting Coldfusion Mark A Kruger CFG Ryan Stille CF Webtools.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
A Brief Documentation.  Provides basic information about connection, server, and client.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
1 MONGODB: CH ADMIN CSSE 533 Week 4, Spring, 2015.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
Tuning Sakai for Large Production Systems: Hints and Tricks Raúl Mengod Universidad Politécnica de Valencia (Spain)
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
CERN IT Department CH-1211 Genève 23 Switzerland t Load Testing Dennis Waldron, CERN IT/DM/DA CASTOR Face-to-Face Meeting, Feb 19 th 2009.
MySQL Gubbins Richard Sinclair HepSysMan – 11/05/2012.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
© 2009/2010 Pythian 1 mysqltuner 1.0 Author: Major Hayden Quick sanity check: » Status/system variables » Memory, Architecture, Tables Not all recommendations.
Dr. David Roldán Martínez Universidad Politécnica de Valencia, Spain & Nuno Fernandes Universidade Fernando Pessoa, Portugal Site Stats, the power of event.
MISSION CRITICAL COMPUTING Siebel Database Considerations.
PERFORMANCE AND ANALYSIS WORKFLOW ISSUES US ATLAS Distributed Facility Workshop November 2012, Santa Cruz.
Copyright © SoftTree Technologies, Inc. DB Log Expert From Oracle Admin Manual: “The best way to determine the appropriate number of online redo.
#SummitNow A Day in the Life of an Alfresco Admin November 2013 Antonio Soler Premier Support Engineer Alfresco Software Ltd.
Get the Most out of SQL Server Standard Edition Or How to be a SQL Miser.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
Configuring SQL Server for a successful SharePoint Server Deployment Haaron Gonzalez Solution Architect & Consultant Microsoft MVP SharePoint Server
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
Sergi Rubio Manrique “Archiving System at ALBA”. Tango Meeting. ALBA. October 16 th, MMVIII 1 Archiving ALBA Sergi Rubio Manrique.
A Better mysqltuner Sheeri K. Cabral The Pythian Group
Understanding and Improving Server Performance
Get the Most out of SQL Server Standard Edition
Database Replication and Monitoring
Mailboxes and MySQL at Zimbra
Hitting the SQL Server “Go Faster” Button
Alejandro Álvarez on behalf of the FTS team
AliEn central services (structure and operation)
The Involuntary DBA Where there is Linux, you most likely will find MySQL or MariaDB. Like it or not, if you're working with Linux, you're a DBA.
Introduction of Week 3 Assignment Discussion
Scaling and Performance
ColdFusion Performance Troubleshooting and Tuning
Jean Joseph DBA\DEVELOPER
Presentation transcript:

Sakai and mysql Stephen Marquard, David Horwitz University of Cape Town July 2008

mysql in production UNISA experience –mysql for >100K users –recently migrated to Oracle (for corporate DBA support) UCT experience –approx 25K users, average 10K users over 24 hours, max 1800 distinct users –mysql 4.1, a –2 db crashes (auto restarts) in 30 months of production Other mysql sites –Foothill / Etudes –Rutgers –Look in JIRA PROD category for more details:

Provisioning server(s) Use a dedicated server! (or dedicated virtualized CPUs) – don’t let db compete for other resources UCT: 16G RAM, 2 x dual core CPUs, SAN storage Benchmark –Other institutions with similar usage profiles (concurrent sessions, toolset, course size) –Projected growth –From db system stats Provision db for “burst” capacity of 5x to 10x typical load Load-test to tune load balancer, app server and db limits so that your system degrades gracefully

Configuration Server (/etc/my.cnf) –Use InnoDB (MyISAM is not ACID: some services/tools will break) –Use as much memory as you have without pushing the app server into swap –Additional connections use additional memory: calculate memory usage for max connections (see mysql docs) –Enable the query cache! –Use an in-memory table for SAKAI_PRESENCE Client (sakai.properties) –mysql connector parameters –db pool parameters

UCT my.cnf [mysqld] # Need these for Sakai default-table-type=innodb character-set-server = utf8 # Logging log-slow-queries = /var/log/mysql/mysql-slow.log long_query_time = 1 # At least App servers * max per app server max_connections = 805 # Enable the query cache query_cache_size = 160M # Some buffer and cache sizes key_buffer = 64M max_allowed_packet = 64M table_cache = 512 # c/f table_cache = 750 tmp_table_size = 64M # InnoDB settings innodb_buffer_pool_size = 7168M innodb_additional_mem_pool_size = 30M # Set.._log_file_size to 25 % of buffer pool size # (can't change this after db has been created) innodb_log_file_size = 500M innodb_log_buffer_size = 8M # Avoid some deadlocks from index gap locking (not safe for replication) innodb_locks_unsafe_for_binlog=1

UCT sakai.properties # Connector properties useUnicode=true&characterEncoding=UTF-8& useServerPrepStmts=false&cachePrepStmts=true& prepStmtCacheSize=4096&prepStmtCacheSqlLimit=4096& slowQueryThresholdMillis=750&logSlowQueries=true&maxQuerySizeToLog= # increase number of connections in the connection pool Also read the release notes and installation documents for your Sakai release Known issue with DBCP deadlocks (SAK-11852, SAK-11877, SAK-11005, pending switch to c3po. Possible workaround by setting maxThreads (server/conf.xml) to < maxActive, though check your loadbalancer behaviour first.SAK-11877SAK

Backups What we do (every 4am, takes 6-8min, 920M, does not lock db or tables): #! /bin/sh ## Daily backup of mysql database to a snapshot. BFOLDER=/data/mysql/backup DBNAME=vula ## Rename old dump file rm -f $BFOLDER/$DBNAME.sql.gz.OLD mv $BFOLDER/$DBNAME.sql.gz $BFOLDER/$DBNAME.sql.gz.OLD ## Backup mysql Vula database /bin/logger Starting mysql backup of database $DBNAME /usr/bin/mysqldump -u root --password=goaway --verbose --max-allowed-packet=64M --debug-info --quick --single-transaction $DBNAME 2> $BFOLDER/mysqldump.log | gzip > $BFOLDER/$DBNAME.sql.gz /bin/logger Finished mysql backup of database $DBNAME Or, replication to slave server, backup from slave Or third-party backup utilities Set things up so that you can restore a snapshot of your production db to a test server

Archiving Archive SAKAI_SESSION and SAKAI_EVENT data Inserts into SAKAI_SESSION become expensive when the table is very large Data mining queries on historical SAKAI_SESSION and SAKAI_EVENT data can be slow. Run them on a different db server if possible. Example script:

Monitoring and analysis Server –Stats (graph metrics and throughput, e.g. in mrtg) –show table status (volumes of data, index sizes) –explain select … (use of indexes, query complexity) –profile build (step-by-step query execution reporting) –slow query logging (minimum precision 1s, not that helpful) –query logging Client –profiling through connection parameters: reference-configuration-properties.html

UCT mysql server metrics graphed with mrtg See them live at

Diagnosing db-related performance issues How do you know it’s a database issue? –Query time –Volume of queries –High connection count –High load average / CPU use / other system metrics –Lock wait timeouts, deadlock rollbacks Check for missing indexes (manually or tools) Switch on query logging (server or client), look at queries for a single request (volume and/or expensive queries)

Examples of performance issues These affect both Oracle and mysql (often worse on Oracle) Look for application performance that degrades O(n^2) or O(n) with site membership or volume of data Section Info – in a large course site with 100 sections, to render default student view –Sakai 2.5.0: 3000 queries O(n) complexity –Sakai 2.5.1: 3 queries O(1) complexity –Usage patterns turn bad problems into acute problems: e.g. competitive tutorial group signup (1500 students, 400+ seater-lab, signup opens at 4pm). Assignments: one operation O(n^2) in early post-2.4 Content: O(n) to O(1) for quota checks

Factors contributing to poor performance ORM/Hibernate (too many queries for what you actually need) XML blobs in db (hard to filter, sort, search, migrate) Inadequate schema design Bad query design (for mysql), e.g. subselects Missing indexes Naïve use of service APIs (e.g. iterating through sets of items) Service APIs not meeting tool requirements API boundaries (avoiding cross-service table joins) Let the database do as much work as possible!

High Availability Talk to Ian Boston from CARET