Equivalent to performance diagnostic tools; SQL Trace and TKPROF - CockroachDB - query-performance

What are the performance diagnostic tools in CockroachDB?
Any equivalent to TKPROF?

CockroachDB has introduced some really awesome features to get you started with analyzing query performance and tracing them ina. distributed system.
To begin, check out these two pages:
https://www.cockroachlabs.com/docs/stable/sql-tuning-with-explain.html
and
https://www.cockroachlabs.com/docs/stable/show-trace.html
For tracing, you can also set those on a cluster level with a cluster setting. This will allow queries over a certain threshold of time to be dumped into a text file with their traces.

Related

How can I report performance counters for monitoring?

I contribute to an open source application that has a series of internal queues (implemented as arrays). Monitoring of these queues is an important part of diagnosing any performance issues.
In other languages, operating systems, I've been able to expose performance counters which can be seen by monitoring tools for a real time view (or to build up historic information).
What's the best way of exposing these in the node/linux ecosystem?
Currently I am logging them to disk through winston, but that creates lots of logging...
You can use pm2 custom metrics for that

DF.write.mode("append") at scale

Is the SPARK SQL family of API's for writing to a database like this:
DF.write.mode("append").jdbc(url, table, prop)
able to work at scale?
Or is there a time that sqoop should then be used?
In general writing over JDBC will be typically limited by the capabilities of the destination system. In general JDBC connectors are not designed for batch data migrations, and majority of vendors, have their own, platform specific bulk insert tools.
Specific writing mode like append has little or no impact at all.
And as always - if you have questions about performance implications of a specific choice it's best to benchmark it yourself on the platform you use, data that reflects properties of the real input and using resources comparable to the ones, you have at your disposal in production.

Monitoring Code/Method-level Statistics using AppDynamics

I am now working on Performance Testing of a Java Application that runs on GlassFish Server 4.1.
After going through some statistics that I got from AppDynamics tool, I find that there is no possibility for me to drill down to code/method level issues. For example, I can see the time taken by each method or function using dotTrace or JProfiler but AppDynamics tool seems to skip all these features.
I was also looking for a free solution, hence I choose AppDynamics. Now I feel I am not on the right track. Can someone let me know more about this tool if I am missing something or suggest any other quick and easy solution to this.
Is there a possibility that the monitors on GlassFish server 4.1 can do the same for no cost?
Generally, monitoring tools cannot record method-level data continuously, because they have to operate at a much lower level of overhead compared to profiling tools. They focus on "business transactions" that show you high-level performance measurements with associated semantic information, such as the processing of an order in your web shop.
Method level data only comes in when these business transactions are too slow. The monitoring tool will then start sampling the executing thread and show you a call tree or hot spots. However, you will not get this information for the entire VM for a continuous interval like you're used to from a profiler.
You mentioned JProfiler, so if you are already familiar with that tool, you might be interested in perfino as a monitoring solution. It shows you samples on the method level and has cross-over functionality into profiling with the native JVMTI interface. It allows you to do full sampling of the entire JVM for a selected amount of time and look at the results in the JProfiler GUI.
Disclaimer: My company develops JProfiler and perfino.

Can you suggest some good ETW readers?

I'm currently using Microsoft Network Monitor to parse thru debug event traces. It is not a bad tool, but not very good either. Do you know some better solutions?
These are readers for exploring custom ETW traces:
SvcPerf - End-to-End ETW trace viewer for manifest based traces
LINQPad + Tx (LINQ for Logs and traces) driver - Simple reader that allows you to query ETW traces
PerfView - multitool that allows you to do amost everything with ETW, but not particularly user-friendly
PerfView http://www.microsoft.com/download/en/details.aspx?id=28567
If you're after giving graphic visualization of traces for the sake of performance analysis, you may use the following:
1. Windows Reliability and Performance Monitor which is an MMC snap-in and is easy to use for basic analysis (locally, from the server)
2. xperf, which is a stand-alone tool from the Windows Performance Tools.
Xperf itself is a command-line tool for captures and processing traces and Xperfview allows creating graphs and tables from the captured data. Look at this blog post for an overview.
3. Visual Studio 2010 profiler contains a "Concurrency Visualizer" which is actually a nice tool to collect and visualize ETW traces, specifically tailored around analysis of thread contention issues (but can also be used to analyze network traces, I think). See this blog post on using the tool and also you may use the underlying tools directly: VSPerfCmd and VSPerfReport.
I like to use Log Parser [link] to parse through the logs for the events that I am most interested in. I love the SQL-like query structure.

SQL Azure Profiling

I read on the MS site that SQL Azure does not support SQL Profiler. What are people using to profile queries running on this platform?
I haven't got too far playing around with SQL Azure as yet, but from what I understand there isn't anything you can use at the moment.
From MS (probably the article you read):
Because SQL Azure performs the
physical administration, any
statements and options that attempt to
directly manipulate physical resources
will be blocked, such as Resource
Governor, file group references, and
some physical server DDL statements.
It is also not possible to set server
options and SQL trace flags or use the
SQL Server Profiler or the Database
Tuning Advisor utilities.
If there were to be an alernative, I'd imagine it would require the ability to set trace flags which you can't do, hence I don't think there is an option at the moment.
Solution? I can only suggest you have a local development copy of the db so you can run profiler locally on it. I know that won't help with "live" issues/debugging/monitoring but it depends on what you need it for.
Edit:
Quote from MSDN forum:
Q: Is SQL Profiler supported in SQL
Azure?
A: We do not support SQL Profiler in
v1 of SQL Azure.
Now, you could interpret that as a hint that Profiler will be supported in future versions. I think it will be a big requirement to get a lot of people on board, using SQL Azure seriously.
Update as of 9/17/2015:
Microsoft just announced a new feature called Index Advisor:
How does Index Advisor work? Index Advisor continuously monitors your
database workload, performs the analysis and recommends new indexes
that can further improve the DB performance.
Recommendations are always kept up-to-date: As the DB workload and
schema evolves, Index Advisor will monitor the changes and adjust the
recommendations accordingly. Each recommendation comes with the
estimated impact to DB workload performance: You can use this
information to prioritize the most impactful recommendations first. In
addition, Index Advisor provides a very easy and powerful way of
creating the recommended indexes.
Creating new indexes only takes a couple of clicks. Index Advisor
measures the impact of newly created indexes and provides a report on
index impact to users. You can get started with Index Advisor and
improve your database performance with the following simple steps. It
literally takes five minutes to get accustomed with Index Advisor’s
simple and intuitive user interface. Let’s get started!
Original Answer:
SQL Azure now has some native profiling. See http://blogs.msdn.com/b/benko/archive/2012/05/19/cloudtip-14-how-do-i-get-sql-profiler-info-from-sql-azure.aspx for details.
Microsoft's stated position SQL Server Profiler is deprecated. As much as this is a bad idea, that's what they have said.
SQL Profile is already deprecated in SQL Server, and that’s part of
the reason that it doesn’t make sense to bring to SQL DB.
What this means is you are going back 20+ years in database performance monitoring and everyone is going to have to write their own perf monitoring scripts instead of having a standard factory delivered tool that's on every server you will go to. It's tantamount to deprecating "sp_help" and making every DBA write their own. Hope you know all your DMVs inside and out... INNER JOIN, OUTER JOIN, and CROSS APPLY syntax really well.
Update as of 2017/04/14:
Microsoft's Scott Guthrie today announced a lot of new features in SQLAzure(this is called sqlazure managed instance,which is currently in preview),which are expected to be present in SQLAzure in coming months..below are them
1.SQLAgent
2.SQLProfiler
3.SQLCLR
4.Service Broker
5.Logshipping,Transactional Replication
6.Native/Backup restore
7.Additional DMV's and Xevents
8.cross database querying
References:
https://youtu.be/0uT46lpjeQE?t=1415
I have tried today a new tool suggested by Microsoft that is called Azure Data Studio.
In this tool you can download an extension called Profiler and it seems to be working just as expected.
You can use Query store feature, look here for more details: http://azure.microsoft.com/blog/2015/06/08/query-store-a-flight-data-recorder-for-your-database/
The most close to SQL profiler, that I found working in Azure SQL, is SQL Workload Profiler
However note, that it’s beta version of a tool, created but a single person, and it is not too convinient to use.
SQL Azure offers following features to tune performance, profile queries in its own way, identity long running queries and much more
Intelligent Performance
Performance overview
Performance recommendations
Query Performance Insight
Automatic tuning

Resources