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 Cleveland 2017

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

3 Who am I? Platform Database Consultant – BlueChip Consulting Group
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

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

5 Why stress SQL Server? To remove stress from SQL Server Test queries
“Break in” new servers Benchmark

6 Causes of SQL Stress 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

7 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

8 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

9 Distributed Replay

10 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 If multiple reply clients are needed Installation & Configuration Installs from SQL Server installation media Use local or domain service accounts Firewall exceptions may be needed

11 Distributed Replay 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

12 Distributed Replay Reference Links Overview Installation Usage Forum
Installation load-test-your-sql-serverpart-1/ distributed-replay/ Usage load-test-your-sql-serverpart-2/ multiple-clients-using-sql-server-2012-distributed-replay/ Forum

13 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

14 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)

15 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

16 OSTRESS Background and link to installer ORCA and OStress
replay-markup-language-rml-utilities-for-sql-server ORCA and OStress machine-replay-using-orca-and-ostress/

17 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

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

19 HammerDB Open source Load test/benchmarking tool
Not just for SQL Server GUI based graphical database Limits command line functionality Customizable workloads, if you know TCL

20 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

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

22 Questions?


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

Similar presentations


Ads by Google