Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 1 of 13
Cisco Multicloud Portfolio:
Cloud Consume
Optimize Code by Identifying Code-Level
Performance Issues
June 2018
Design and Deployment Guide
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 2 of 13
Contents
Executive summary ................................................................................................................................................. 3 Cisco Multicloud Portfolio: Overview ..................................................................................................................... 3 Cloud Consume overview ..................................................................................................................................... 4 Cloud Consume use cases ................................................................................................................................... 4 Could Consume benefits ....................................................................................................................................... 5
Technology overview .............................................................................................................................................. 5
Solution design ........................................................................................................................................................ 6 Requirements ........................................................................................................................................................ 6 Design principles ................................................................................................................................................... 7
Solution deployment ............................................................................................................................................... 8 Enable performance monitoring for the applications ............................................................................................. 8 Identify critical business transactions .................................................................................................................... 8 Measure of application performance on business ................................................................................................. 9 Make transaction snapshots to learn more about the application ......................................................................... 9 Re-measure application performance after tuning the code ............................................................................... 11
Additional resources ............................................................................................................................................. 11
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 3 of 13
Executive summary
Cloud computing is changing rapidly. To get the best technological and business advantage, you need an evolving
cloud strategy to put the right workload in the right environment. You have many choices, and there are good
business reasons to use different on-premise or cloud environments: agility, efficiency, costs, security, control,
compliance, and performance, to name a few. As a result, a growing mix of applications is available across multiple
environments. These applications need to be managed to deliver the promised benefits of cloud.
With the obvious benefits of public clouds like elasticity, reduced operational overheads, and on-demand
provisioning, businesses are architecting their new applications with public cloud in mind. This works well for
greenfield deployments, and to get the benefits of public cloud for brownfield applications, organizations are
looking for ways to migrate their existing applications to cloud.
This guide documents how the application performance data can be used to optimize your application code. By
understanding the performance issues in the application, you can tune specific components by focusing on what
matters for your users. AppDynamics Application Performance Management (APM) gives you deep visibility into
the application code issues which can be used to optimize your application code.
Cisco Multicloud Portfolio: Overview
In a multicloud world, growing complexity is driving a cloud gap between what your customers require and what
your people, processes, and tools can support. With Cisco® Multicloud Portfolio, we make it simple: simple to
connect, simple to protect, and simple to consume.
The Cisco Multicloud Portfolio is a set of essential products, software, and services supported with simplified
ordering and design deployment guides to help you when it comes to multicloud adoption. Cisco Multicloud
Portfolio consists of four component portfolios (Figure 1):
● Cloud Advisory: Helps you design, plan, accelerate, and reduce risk during your multicloud migration.
● Cloud Connect: Securely extends your private networks into public clouds and ensures the appropriate
application experience.
● Cloud Protect: Protects your multicloud identities, direct-to-cloud connectivity, data, and applications,
including Software as a Service (SaaS) and detects infrastructure and application threats on-premises and
in public clouds.
● Cloud Consume: Helps you deploy, monitor, and optimize applications in multicloud and container
environments.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 4 of 13
Figure 1. Multicloud Portfolio: Cloud Advisory, Cloud Connect, Cloud Protect, and Cloud Consume
Cloud Consume overview
Cloud Consume consists of essential products to help you deploy, monitor, and optimize applications in multicloud
environments:
● AppDynamics
● Cisco CloudCenter™
● Cisco Container Platform
For detailed use cases, see the section on Cloud Consume on the portfolio’s solution page at
https://www.cisco.com/go/multicloud.
Cloud Consume use cases
Cloud Consume allows you to scale applications, gain visibility into application performance, control cloud spend,
and manage the full application lifecycle. Cloud Consume delivers value in the following use cases:
● Optimize resources by scaling applications based on end user performance and business metrics (such as
conversion rate, page loading time) to align with your organization’s needs.
● Apply governance and control of who deploys what and where to ensure security and compliance while
controlling resource usage and cloud costs.
● Optimize service quality by identifying and responding to emerging issues before they impact your business.
● Seamless deployment and monitoring using automated provisioning of fully configured application stacks
with monitoring agents into any environment.
● Optimize code by identifying code-level performance issues.
● Migrate with confidence by first identifying services to migrate and then getting an accurate view of
applications’ technical and business metrics before and after to prove migration success.
● Simplify deployment and management of Kubernetes containers through automation and end to end
lifecycle management of container clusters
● Optimize containers for multicloud environments - on-premises and in public clouds e.g. GCP etc.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 5 of 13
Could Consume benefits
Cloud Consume benefits include:
● Seamless deployment and monitor of applications across multicloud
● Identification of performance trends to right-size IT resources and control cloud spend
● Identification of application dependencies to prioritize migration candidates
● Analysis of user, app, and business performance before and after migration
● 20-30 times faster application deployment time
● 10-20 percent lower overall TCO
● Faster application turnaround cycles (develop-test-stage-run)
● Assurance of multicloud performance
● Collection of business metrics (such as conversion rates, costs) to drive cloud consumption decisions
● Reduced complexity with fully curated, open container management for production-grade Kubernetes
Technology overview
The rapid pace of innovation puts tremendous pressure on your organization to accelerate its ability to deploy
applications. By being able to deploy applications quickly, rather than in days or weeks, the cloud provides
tremendous value. It is not surprising then, that today, over 73 percent of organizations have adopted or are
adopting a hybrid cloud strategy.
Hybrid cloud strategies are continuously evolving to make sure that the right workloads are in the right environment
to result in the best technological and business advantages. You have many choices available to you, and there
are compelling business reasons to utilize different environments, such as agility, efficiency, security, control,
compliance, and performance.
Applications deployed in production behave differently than they do in test and development environments. It is not
possible to test every possible flow or use case in a controlled environment. Therefore, it is essential to learn from
an application’s behavior in a production environment and make changes in the application code accordingly. With
many deployment models being distributed, multicloud, and complex, it becomes critical for an application to
behave in the right manner and respond to environmental constraints such as different latencies, response times,
etc.
Applications accessing one or more database(s) is another area of code optimization. First, you need to
understand how your application receives different response times for different queries. Using AppDynamics, you
can then focus on the queries that are performing below your thresholds.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 6 of 13
AppDynamics Application Performance Management (APM)
AppDynamics APM, a component of the AppDynamics App iQ platform, gives you end-to-end visibility into the
performance of your applications. AppDynamics works with popular programming languages such as Java, .NET,
Node.js, PHP, Python, C/C++, and more, enabling you to:
● Troubleshoot problems such as slow response times and application errors.
● Automatically discover application topology and how components in the application environment work
together to fulfill key business transactions for users.
● Measure end-to-end business transaction performance, along with the health of individual application and
infrastructure nodes.
● Receive alerts based on custom or built-in health rules, including rules against dynamic performance
baselines that alert you to issues in the context of business transactions.
● Analyze your applications at the code-execution level using snapshots.
Solution design
Requirements
Writing the perfect code for an application is any developer’s dream. As much as it is a desire of the developer, it is
also difficult to do. There is limitation to the environment that a developer is exposed to. Test teams can en-hance
only to a certain level and help imitate setups close to the production environment. Nothing really matches the
actual production environment as the experience is very different.
Following are some of the challenges applications face in production:
● Users accessing your application at the same time from different geographies
● The kind of queries your application making to databases
● The response time for some user requests varying based on factors which are in control of the application
i.e. within the application code, database accessibility and so on
● The response time for some user requests being outside the scope of the application code, such as servers
not having enough compute resources, networks not having enough bandwidth, and so on
AppDynamics APM gives you visibility into your application’s architecture, fast and slow flows, external calls/APIs,
and also a deeper understanding of errors, application code, and the application stack, with integrated information
of your infrastructure. You can use the information to improve on the following areas and have the application
perform better in production:
● Application performance and quality
● Optimization of the application code
● Database response time
● Enhance application architecture for scale
● Enhance user experience
The pre-requisites for this design are:
● Basic knowledge of AppDynamics APM
● AppDynamics SaaS or on-premises version up and running
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 7 of 13
Design principles
Enabling applications for performance monitoring is the first step in understanding how your applications perform.
AppDynamics agents (available for all the major application types) give you a view of the runtime operation of your
code. The agent detects calls to a service entry point at the tier and follows the execution path for the call through
the call stack. It sends data about usage metrics, code exceptions, error conditions, and exit calls to back-end
systems to the controller, either SaaS or on-premises (Figure 2).
Figure 2. AppDynamics - agent and controller
Most application environments consist of more than a single application server. They may contain multiple,
distributed, and interconnected servers and processes involved in fulfilling a given user request. In this context,
AppDynamics tracks transactions across distributed and heterogeneous services.
Optimizing the code of your application involves having an APM tool like AppDynamics enabled for performance
monitoring. Learning from how your code is being used, where code is performing slow, or how often that slow
code is called into action gives you a sense of where your focus should be to improve the code.
AppDynamics collects business metrics that enable you to report on how your business (as opposed to your
application) is performing. For example, you could set up a metric to track the total revenue from the purchase of a
certain product or set of products on your website. You can also use metrics to report on how your code is
performing, for example, how many times a specific method is called and how long it takes to execute.
Following points summarize the different tasks involved in optimizing application code:
● Enable performance monitoring for applications
● Identify critical business transactions
● Measure the impact of application performance on business performance
● Make transaction snapshots to learn the root cause of performance issues
● Re-measure application performance after tuning of code
Most organizations focus on getting the functionality to work and see the performance aspects as an afterthought.
However, analysis of performance and scalability and their implications for the architecture of an application should
be handled upfront, instead of being refactored into the code later. This not only involves a lot of rework but also
has the potential to cause missed delivery timelines.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 8 of 13
Solution deployment
Optimizing the performance of your applications to improve the performance of your business requires you to
understand all aspects of that performance, down to the code level. You can make use of information points in
AppDynamics to report on how your code is performing. For example, you can look at how many times a specific
method is called and how long it takes to execute. With AppDynamics end-user monitoring, you can collect
information such as where in the world your requests are coming from and what devices and channels are being
used, as well as the performance of your code once it is on your user's device. You can even investigate mobile
crashes by looking at the stack traces and other contextual data at the moment of the crash, and that data can be
tied to business transaction data from the server side.
Enable performance monitoring for the applications
A typical application environment consists of different components that interact in a variety of ways to fulfill re-
quests from the application's users:
● Web applications served from an application server
● Databases or other data stores
● Remote services such as message queues and caches
AppDynamics app agents automatically discover the most common application frameworks and services. Using
built-in application detection and configuration settings, agents collect application data and metrics to build flow
maps.
Instrumenting an application adds the AppDynamics application agent into the runtime process of the application.
Once installed, the application agent starts sending information about the application, such as:
● Transaction entry and exit points
● Performance metrics, such as response time, call rate, and error rate
● Code-level execution metrics such as class, the method that gets executed, and stack traces
● Data based on information points and explicit configurations
Identify critical business transactions
A business transaction in AppDynamics represents the end-to-end, cross-tier processing path used to fulfill a
request for a service provided by the application. When you install an app agent, the agent detects the incoming
calls and registers the transactions based on the default transaction detection rules. Automatic detection rules
describe entry points for transactions based on supported frameworks. While the default rules can go a long way in
getting you a useful list of business transactions to track, an important part of implementing AppDynamics is
verifying and refining the business transactions used to monitor your application. The business transactions you
are monitoring should reflect those operations that are important to your application and business.
Refining your business transaction list requires a solid understanding of the important business processes in your
environment. Identify the 5 to 20 most important operations in the application. These are the key operations that
must work well for the application to be successful. You can refine the list of transactions you want to monitor by
locking down the critical transactions and enabling automatic cleanup of the stale transactions.
An example of business transaction is a web service request that translates “Add an item to a shopping cart” in an
e-commerce application into a logical operation.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 9 of 13
Measure of application performance on business
Knowing your application performance is important, as it allows you to see how your application reacts to different
kinds of traffic, types of users, slow or error prone paths, and infrastructure-level details such as CPU, memory,
and disk performance. Information points in AppDynamics can be used to define custom metrics based on the
methods you configure. They reflect the data state across all invocations of a method, independently of any
business transactions. They also let you apply computations to the values that, for example, represent the sum or
average for a method’s return value or input parameter.
When you configure an information point, you automatically get the KPI metrics (called code metrics) for the
information point method. The code metrics are:
● Total call count
● Calls per minute
● Errors per minute
● Average response time
You can supplement the KPI metrics with custom business metrics for the information point.
Information points can give you significant insight into how the performance of an application corresponds to
business performance. An example of a practical use of an information point are ignored exceptions. Exceptions,
especially ones that occur frequently, can contribute to CPU spikes in a Java Virtual Machine (JVM). If you
configure an exception to be ignored in AppDynamics, for example, if it is generated in the underlying application
framework and does not have a direct effect on your application performance, it may not be readily evident to you
when the exception is affecting your application. An information point that counts the exception’s occurrence can
help you identify the additional overhead.
Make transaction snapshots to learn more about the application
AppDynamics monitors every execution of a business transaction in the instrumented environment, and the metrics
reflect all such executions. However, for troubleshooting purposes, AppDynamics takes snapshots of specific
instances of a transaction. A transaction snapshot gives you a cross-tier view of the processing flow for a single
invocation of a transaction.
Call drill downs, where available, detail key information including slowest methods, errors, and remote service calls
for the transaction execution on a tier. A drill down may include a partial or complete call graph. Call graphs reflect
the code-level view of the processing of the business transaction on a particular tier.
The following screenshot (Figure 3) identifies the metrics available in the transaction flow map:
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 10 of 13
Figure 3. Metrics available in the transaction flow map
The numbered callouts in Figure 3 represent:
1. Tier response time (ms)
2. Percentage of time spent (%)
3. Asynchronous activity processing time (ms)
4. Execution time (ms)
The Potential Issues area highlights the slow methods and the slow remote service helps you to investigate the
root causes for performance issues.
A call drill down contains details for the execution of that business transaction on a particular tier. It takes you to
the code-level information for the transaction. If transaction performance is slow, multiple methods could be
contributing to the slowness. Figuring out which method or methods are taking a long to execute is the key, and the
call drill-downs give you the visibility to do this.
A common example of an application misconfiguration is in the area of thread pool configuration. Setting the thread
pool too high or too low can have a significant impact on the application’s performance. A thread pool that is set too
low would result in requests going into the wait state, and one that is set too high would result in too many
concurrent threads being active, causing all of the CPU resources to be consumed. AppDynamics can help you
figure out if the thread pool is under- or over-configured.
A database drill drown tells you about the queries taking the most time in the database as top SQL statements and
stored procedures, the busiest schemas on the database server. Comparing the query weights to other metrics
such as SQL wait times may point you to the need to tune SQL.
Database tuning, along with optimized SQL queries, can improve the database performance. It might require tuning
the database connection pool, which can be decided based on the load test of your application.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 11 of 13
Re-measure application performance after tuning the code
AppDynamics’ visibility into the application code level gives developers insight into the areas in their applications
that need improvement by changing the code and fine-tuning the parameters in the application and database tiers.
After learning the details via transaction snapshots, database drill-downs, and call drill-downs, the developer can
modify the code to improve the application performance.
Tuning one parameter in the application may expose another problem. It is important to keep learning from the
performance metrics in the APM solution and to be continuously improving the performance of the application.
Sometimes, you may have to run multiple iterations of load test to figure out what is best for your application,
especially in terms of thread pool and database connection pool configurations.
Finding and fixing issues before they impact your user’s experience is not only a DevOps dream but also the
dream of developers and application owners. By analyzing the application’s various critical points before they show
up as issues, you can provide a better experience to your end users, avoid escalations to company executives, and
possibly avoid late-night and weekend work.
Additional resources
If you have further questions, refer to the following additional resources:
● Cisco CloudCenter Communities:
https://communities.cisco.com/community/technology/cloudsolutions/enterprise-cloud-suite/cloudcenter
● Cisco CloudCenter information:
https://www.cisco.com/go/cloudcenter
● Cisco CloudCenter product documentation:
https://docs.cloudcenter.cisco.com/
● Software downloads:
https://software.cisco.com/portal/pub/download/portal/select.html?&i=!m&mdfid=286308292
● End-user documentation:
https://www.cisco.com/c/en/us/support/cloud-systems-management/cloudcenter/products-user-guide-
list.html
● AppDynamics:
https://www.appdynamics.com/
● AppDynamics product documentation:
https://docs.appdynamics.com/
For a complete list of all of our design and deployment guides for the Cisco Multicloud Portfolio, including Cloud
Consume, visit https://www.cisco.com/go/clouddesignguides.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 12 of 13
About Cisco Design and Deployment Guides
Cisco Design and Deployment Guides consists of systems and/or solutions that have been designed, tested, and
documented to facilitate faster, more reliable, and more predictable customer deployments. For more information,
visit: https://www.cisco.com/go/designzone.
ALL DESIGNS, SPECIFICATIONS, STATEMENTS, INFORMATION, AND RECOMMENDATIONS
(COLLECTIVELY, "DESIGNS") IN THIS MANUAL ARE PRESENTED "AS IS," WITH ALL FAULTS. CISCO AND
ITS SUPPLIERS DISCLAIM ALL WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT ARISING FROM A
COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE
LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING,
WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR
INABILITY TO USE THE DESIGNS, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THE DESIGNS ARE SUBJECT TO CHANGE WITHOUT NOTICE. USERS ARE SOLELY RESPONSIBLE FOR
THEIR APPLICATION OF THE DESIGNS. THE DESIGNS DO NOT CONSTITUTE THE TECHNICAL OR OTHER
PROFESSIONAL ADVICE OF CISCO, ITS SUPPLIERS OR PARTNERS. USERS SHOULD CONSULT THEIR
OWN TECHNICAL ADVISORS BEFORE IMPLEMENTING THE DESIGNS. RESULTS MAY VARY DEPENDING
ON FACTORS NOT TESTED BY CISCO.
CCDE, CCENT, Cisco Eos, Cisco Lumin, Cisco Nexus, Cisco StadiumVision, Cisco TelePresence, Cisco WebEx,
the Cisco logo, DCE, and Welcome to the Human Network are trademarks; Changing the Way We Work, Live,
Play, and Learn and Cisco Store are service marks; and Access Registrar, Aironet, AsyncOS, Bringing the Meeting
To You, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, CCVP, Cisco, the Cisco Certified
Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo,
Cisco Unified Computing System (Cisco UCS), Cisco UCS B-Series Blade Servers, Cisco UCS C-Series Rack
Servers, Cisco UCS S-Series Storage Servers, Cisco UCS Manager, Cisco UCS Management Software, Cisco
Unified Fabric, Cisco Application Centric Infrastructure, Cisco Nexus 9000 Series, Cisco Nexus 7000 Series. Cisco
Prime Data Center Network Manager, Cisco NX-OS Software, Cisco MDS Series, Cisco Unity, Collaboration
Without Limitation, EtherFast, EtherSwitch, Event Center, Fast Step, Follow Me Browsing, FormShare, GigaDrive,
HomeLink, Internet Quotient, IOS, iPhone, iQuick Study, LightStream, Linksys, MediaTone, MeetingPlace,
MeetingPlace Chime Sound, MGX, Networkers, Networking Academy, Network Registrar, PCNow, PIX,
PowerPanels, ProConnect, ScriptShare, SenderBase, SMARTnet, Spectrum Expert, StackWise, The Fastest Way
to Increase Your Internet Quotient, TransPath, WebEx, and the WebEx logo are registered trademarks of Cisco
Systems, Inc. and/or its affiliates in the United States and certain other countries.
All other trademarks mentioned in this document or website are the property of their respective owners. The use of
the word partner does not imply a partnership relationship between Cisco and any other company. (0809R)
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
© 2018 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. Page 13 of 13
Printed in USA C07-740716-00 06/18