Improving GIS performance with AppDynamics

Twenty years ago I started my professional career working in a niche field of IT called Geographical Information Systems (GIS) – basically mapping systems. This is an area where Big Data was prevalent, long before the term was officially coined, GIS covered a range of concepts from satellite imagery and aerial photography processing to geo-demographic data analysis, address cleansing and geocoding to routing analysis, spatial algorithms and finally to publishing maps & associated data.

Google and Microsoft Bing have recently commoditised a lot of the publishing aspects of background mapping data, but the need for analysing and publishing an organisation’s own geographic data is as important today is it has ever been.

Historically, Application Performance Management (APM) and GIS have never made good bedfellows mainly due to the effort required in deploying APM.  At a recent conference I spoke to a GIS developer who stated they had no interest in APM because “they work in GIS.” Upon further questioning, this GIS developer acknowledged processing and accessing these large datasets is complicated and it’s slow and that’s “just how it is.”. So I challenged this and decided to demonstrate AppDynamics on GeoServer,  an open source mapping server written in Java that allows users to share and edit geospatial data.

Within a few minutes of installation, AppDynamics automatically detected key transactions such as publishing a map layer.

01B-WMS_Service

Taking this a step further, we looked at how AppDynamics can help a system administrator understand which parts of their service is accessed most and which components are the slowest (in this case average response times for publishing mapping datasets).

02-Layer_Performance

In the race to prove innocence, the challenge is to be able to determine whether any slow service calls were due to the end user or consumer of a service rather than the service itself — to understand if users are doing something you did not expect. For example, they could be pulling back too much data from the service (this applies to any system dealing with data).

In the case of mapping systems, AppDynamics can capture the bounding box representing the coordinates used to outline and return an area of interest, if the area of interest retrieved is too large and that leads to a slow transaction, then it’s likely a system administrator is allowing users to pull back too much data in one go:

04-HTTP_Params

If an administrator does see a slow down in the service they can drill into the service to isolate where performance problems occur. Problems in this type of application can manifest themselves in coordinate conversion, vector data reading (roads, rivers & buildings), database queries, grid handlers (reading image files such as satellite and aerial images), writing to an image file: 

03-WMS_at_Method_Level

System administrators and owners can improve their application or data processing times by identifying bottlenecks. The following example shows how an address lookup service was sped up from processing 60 calls per minute taking a second each, to more than 700 calls per minute taking less than 50ms.

Geocode Response Time

Geocode SQL

AppDynamics for Databases identified the cause of the slowness as the spatial query used to query the postcode, without an index it went from querying 1,684,930 rows…

MySQL 1a

To just 5,976: –

MySQL 2a

Tuning this query led to a tenfold performance improvement!

“Software is eating the world” [Marc Andreessen] and ensuring your application or service is performing is key. This message applies across all sectors, not just banking and ecommerce, “typical” APM customers, but everyone who offers a service or process. Our customers & consumers expect Google-like response times for all online services and we need to deliver.

Using AppDynamics, you can halve or better your data processing times, free up resources, achieve a faster time to market or execution and ensure your consumers in the wider world get that up to date map when they need it.

Take five minutes to get complete visibility into the performance of your production applications with AppDynamics Pro today.

Introducing AppDynamics for Databases

The most common cause of application slowdowns today is slow SQL or stored procedures in the database. The reason? Databases store large amounts of data on disk, and disk is super slow relative to data in memory (unless its SSD). As data volumes grow, the need to configure, maintain and optimize a database also grows because you can’t manage everything on one disk or volume. This is why database administrators (DBA’s) exist.

A huge problem is that developers write ad-hoc SQL queries for their applications and have no idea how those queries actually execute and retrieve data from disk in the database. They are blind to the number of records in a table, or which columns in a given table has indexes. This is why developers typically blame the DBA when their SQL queries run slow– they assume slow queries means a slow database, and that the DBA isn’t doing his job properly. This couldn’t be further from the truth.

With AppDynamics for databases we’re now giving DevOps teams visibility of how their application SQL queries actually execute within the database, so when things slow down they can now collaborate with DBA’s instead of blaming them. Thats right, users of AppDynamics will now be able to find the root cause of slow SQL and stored procedures in their application. This is indeed good news because customers can dramatically improve their end user experience, response time and application throughput by tuning their data access layer.

Obviously, SQL executes differently in different databases, thats why we built AppDynamics for databases to provide universal support for all common relational databases like Oracle, SQL Server, DB2, Sybase, MySQL and PostGres. This is a big deal because no monitoring vendor at the moment provides database diagnostics across all type of relational databases, not to mention providing the application and business transaction context.

So let’s show you a few screenshots of what AppDynamics for Databases can give you.

Single Pane of Glass View
How about a single pane of glass view to monitor ALL your databases regardless of platform? done. Application databases these days vary significantly, most use Oracle, some use MySQL and obviously .NET applications are better related to windows-based databases like SQL Server and Sybase. Its therefore important you can get a holistic view of performance across all your databases.

Real-Time Performance Metrics:
Its always good to know exactly what is happening “right now” in a database. Has the database ran out of connections? or is the database experiencing latency from locking on rows? These are just a few answers you can get from the below “Current” workspace which provides a real-time view of database resources and performance.

Screen Shot 2013-03-26 at 4.52.40 AM

Historical Analysis of Database Activity:
Real-time data is good, but its also helpful to have historical data so you can identify trends, spikes and abnormal patterns in performance. For example, a simple application code change can have a dramatic impact on a database and its performance.  We had an agile customer last year who deployed a code release in production and immediately saw a slowdown in application response time. When they drilled into AppDynamics for Java they noticed that one business transaction was now performing 25 SQL queries per execution instead of just 2 queries, this was the difference between 20,000 and 250,000 executions per minute in the database. Obviously when you increase concurrency that much in the database your going to experience contention and wait, being able to visually track database resource, time spent, wait states and number of executions over-time is invaluable.

Screen Shot 2013-03-26 at 4.53.00 AM

Top SQL Statements and Stored Procedures:
Perhaps the most obvious view you’d expect from a database monitoring solution. This is typically what most Application Performance Monitoring (APM) vendors provide by extracting data from the JDBC or ADO.NET protocols. The big difference between those solutions and AppDynamics is that we allow you to drill down into the SQL or stored procedures and understand their execution plans, so you can actually find the root cause of why your queries run slow. This is great data for application support teams and developers who want to collaborate better with their DBA’s, so they can understand the real reason of database latency.

Screen Shot 2013-03-26 at 4.53.09 AM

Explain Plans:
Most databases will automatically parse and refine the execution of SQL queries based on what plan its query optimizer selects. Just because you add an index to a table to try and make a query faster, doesn’t mean the database query optimizer will use it, and when you consider that index’s aren’t for free (they take up disk space) you might want to check exactly how the database is executing your queries. Take a look at the below explain plan and you can see how the SQL is being processed with two simple selects and two different tables. Notice how the SUBQUERY on the iplookup table is using the index ‘ian1’ because that table has over a million rows in it. If this index was accidentally dropped you can be sure this query would run significantly slower given it would be doing a full table scan on over a million records.

Screen Shot 2013-03-26 at 4.53.17 AM

Database Statistics:
How frequently are applications connecting to your database? and what operations are these applications performing? Applications differ by the volume of data they request, process and manage over-time. For example, in a Cable or Telco provider you might have a customer portal application which accesses customer data inside a large Oracle schema. That same Oracle schema may also service queries from reporting applications for marketing, or perhaps batch jobs from billing applications that need to process large volumes of customer data. If you have different applications performing different operations (read, write, update, delete) at the same time on the same database then that can be a recipe for disaster. You can see from the below screenshot that the application connect to this MySQL instance is spending most of its time inserting data, meaning its write intensive versus read intensive. Obviously if the database and application was purely read intensive, you might consider moving that data to a cache in memory closer to the application logic. Remember, database calls are often remote and expensive, ever so more in the cloud where storage is less than stella.

Screen Shot 2013-03-26 at 4.53.25 AM

 Object Properties:
All database schema’s have generic objects that represent users, databases, tables, indexes and so on. These objects are often configured and maintained by DBA’s to ensure that the database is optimally configured for availability and performance. Change is constant within databases because data volumes are always increasing, and application data models are always evolving to support new features. Making a single configuration change can have a dramatic impact on database and application performance. AppDynamics for databases flags and provides a full audit report on all changes made within the database as shown below. This helps DevOps and DBA’s correlate the impact of change with database performance which can be very powerful. If someone dropped an index and performance spikes shortly after then thats worth knowing!

Screen Shot 2013-03-26 at 4.53.35 AM

 I walked through just a few features and capabilities of AppDynamics for Databases, here’s a quick 4 minute overview of the product:

You can get started right now and sign up for our free trial.

Happy database monitoring!

Appman.