Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Scale Your App

Learning Objectives

After completing this unit, you’ll be able to:

  • Monitor app performance.
  • Choose the correct dyno for an app.
  • Scale dynos horizontally and vertically to meet evolving demands.

Monitor Performance

The Ursa Major Marketing team is happy to see more prospective customers requesting quotes. However, they notify Wei that they’re hearing complaints about the site being sluggish or unresponsive.

Wei knows that the Heroku Dashboard provides her with a clear picture of the volume of traffic and overall app health and performance.

She opens the app’s Metrics tab and looks at the past 7 days, which is the maximum option.

The first metric she checks is the throughput. It indicates the number of requests the server receives in relation to time. She confirms an uptick in traffic and sees a high number of failed requests. They all share the same error code: 408 - Request Timeout. This error indicates that the server may be overloaded.

[Alt text: Throughput metrics chart in the Heroku Dashboard.]

To understand the root cause, she looks at the Response Time metric and sees that it increased dramatically. She knows it’s because Marketing asked her to add features to the quote, making the PDF-rendering process a lot slower.

[Alt text: Response Time metrics chart in the Heroku Dashboard.]

Scale the App

Wei can’t just immediately change the code to fix these performance issues, so as a short-term fix, she scales up her infrastructure.

There are three ways to achieve this.

  • Horizontal Scaling: Increase the number of web dynos to serve more requests.
  • Vertical Scaling: Switch to a more performant dyno type, with more memory and more CPU.
  • Vertical and Horizontal Scaling: Switch to more performant dynos and increase their number.

A dyno is a containerized Linux virtual machine, managed by Heroku. Applications run on dynos. The dynos come in different tiers: Eco, Basic, Standard, and Performance. These tiers determine the resources allocated to your dynos and affect factors such as performance, scalability, and pricing.

The Eco and Basic tiers are designed for small applications. An application running on either tier can only run a single dyno per process type—for example, one web dyno and one worker dyno.

Because the lower tiers can only run one web dyno, Wei’s only option is to scale up her Basic dyno to a Standard-1X dyno, before scaling to three dynos. Her app’s performance improves significantly after scaling.

To get ahead of any future performance issues, she goes back to the Metrics tab and sets alerts on the Throughput and Response Time metrics. This way, she gets notified as soon as problems start occurring again and can react immediately.

While Wei addressed the app’s immediate performance issues, she must rethink her app’s architecture to address the slow response times.

Resources

Comparta sus comentarios de Trailhead en la Ayuda de Salesforce.

Nos encantaría saber más sobre su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios en cualquier momento en el sitio de Ayuda de Salesforce.

Más información Continuar a Compartir comentarios