Presentation is loading. Please wait.

Presentation is loading. Please wait.

Got stress? Sometimes the SQL Server needs some too

Similar presentations


Presentation on theme: "Got stress? Sometimes the SQL Server needs some too"— Presentation transcript:

1 Got stress? Sometimes the SQL Server needs some too
Peter Shore SQL Saturday Pittsburgh 2017

2 Agenda Introduction Testing Why we want stress Distributed Replay
OStress SQL Query Stress HammerDB

3 Specialize in remote database administration, operating system, and enterprise application support services 24x7, 100% onshore support across all major database platforms including SQL Server, MySQL, PostgreSQL, Oracle, Oracle Applications, and DB2 Full suite of Microsoft Business Intelligence and Database Activity Monitoring services available Currently support hundreds of customers and thousands of databases daily

4 Who am I? SQL Server DBA – Remote Database Experts (RDX)
Intentionally Accidental DBA Over 20 years IT experience Server Engineer Desktop Engineer Network Infrastructure Desk side support President CBusPASS Co-Organizer SQL Saturday Columbus Member Multiple Virtual Chapters How to find me

5 Stress The non-specific response of the body to any demand for change
Fulfillment of an infinite number of requests via finite set of resources The confusion caused when ones mind overrides the body’s natural desire to choke the living **** out of some ***hole that desperately needs it.

6 Stress SQL Server – Why & Where
Development Testing Application development Stored Procs/Functions/Queries Problem Resolution Duplicate production load Solve problems Benchmark Learning Dev/QA/Test/UAT Pre-Production Lab

7 Stress To Emulate Query Database Instance Noisy Neighbors
Poorly written query/queries Death by 1,000 cuts Database Many users/queries interacting with the database Instance Other databases that are highly active Noisy Neighbors Other SQL instances on the server Other applications on the server Other servers on the virtualization host

8 Stress Testing SQL Server
Write our own test Mission specific High degree of control Time consuming Single Query tools Ostress SQL Query Stress Database tools HammerDB Instance Tools Distributed Replay OStress

9 Distributed Replay Microsoft supplied and supported
Debuted SQL Server 2012 Uses Profiler Trace to capture a workload Must capture from SQL 2005 or later Similar to replaying trace Playback against a different server Can be played through multiple clients simultaneously Any number from 1 through 16

10 Distributed Replay

11 Distributed Replay Use Cases Installation & Configuration
Test SQL Version upgrade Test Windows/SQL service packs/cumulative updates/patches Test hardware upgrades Test virtualization Provide load for performance testing When multiple replay clients are needed Installation & Configuration Installs from SQL Server installation media Use local or domain service accounts Firewall exceptions may be needed

12 Distributed Replay Requirements Usage
All logins/users contained in trace data must be present in the same database on target Must have same permissions Database IDs ideally should match, matching can be performed by database name if present in trace Usage Create new trace using the TSQL – Replay template Capture workload & save trace Preprocess the trace files to prepare for distributed clients Replay against target server using 1 or more clients

13 Distributed Replay Reference Links Overview Installation Usage Forum
Installation serverpart-1/ replay/ Usage serverpart-2/ using-sql-server-2012-distributed-replay/ Forum

14 OSTRESS Part of RML Utilities Command prompt based Multi-threaded
Can be used as part of a script Multi-threaded ODBC based Simulates multiple connections Is able to replay trace files or run scripts

15 OSTRESS In-line query Query from file All the script files in a folder
ostress -E -d"StackOverflow" -Q"select U.Reputation, C.Text from dbo.Users as U inner join dbo.Comments as C on U.Id = C.Id" -n"10" - o"C:\temp“ Query from file Ostress.exe –ic:\AmitStresTest\stress_01.sql –n200 –r2000 –oc:\ AmitStresTest \output (sample from SQLServergeeks.com) All the script files in a folder Ostress.exe –ic:\temp\*.sql – n100 – r1000 –oc:\temp\output (sample from SQLConsulting.com)

16 OSTRESS OStress Replay Control Agent (ORCA)
Conceptually similar to Distributed Replay Requires same hardware architecture and version of RML Utilities Use the OStress control.ini to point to ORCA server

17 OSTRESS Background and link to installer ORCA and OStress
markup-language-rml-utilities-for-sql-server ORCA and OStress replay-using-orca-and-ostress/ Miscellaneous agent-jobs/

18 SQL Query Stress Originally written by Adam Machanic
Maintained by Erik Ejlskov Jensen Single exe GUI based tool to run one query multiple times Able to run multiple times on the same machine

19 SQL Query Stress Reference links GitHub
Too many references to link on Adam Machanic’s site

20 Benchmark TPC Non-profit organization founded to define transaction & database benchmarks TPC-C OLTP Benchmark Simulates complete computing environment Users execute transactions against a database TPC-H Decision Support Benchmark Business oriented ad hoc queries and concurrent data modifications

21 HammerDB Open source Load test/benchmarking tool
Not official TPC scoring GUI based graphical database Limits command line functionality Customizable workloads, if you know TCL Not just for SQL Server Oracle DB2 PostgreSQL MySQL Redis Trafoion

22 HammerDB Usage Change BENCHMARK to MS SQL Server Schema Build
Set name of server Can change name of database, but the target must be empty Adjust number of warehouses & users to build warehouses Double click build Driver Script Set database connection Set number of transactions per user or the length of the test in time Double click load Click green arrow to run test

23 HammerDB Reference http://www.hammerdb.com/index.html
All documentation can be found on the site

24 Questions?


Download ppt "Got stress? Sometimes the SQL Server needs some too"

Similar presentations


Ads by Google