Question

Interpret and debug CDN ingest slowness on App Platform

The Issue: We just deployed a pre-existing django app on app platform and are experiencing 3x slower speeds compared to our old provider. It appears CDN ingest latency is quite high 4-6 seconds - could this be the reason why? If not, we’re happy to hear other ideas.

Some Context: We’re looking to transition from Fly.io to DigitalOcean but the SIN server performance seems 3x slower. The server response time is about 7-8s consistently, even for static/blank pages. For context, our DB is managed MySQL located in SIN. The app is located in SIN as well. Our logs do not show any abnormalities and DB queries are also fine. CPU and RAM load are well below threshold.

The only thing that looks abnormal is the CDN ingest latency at 4-6s for both 3xx and 2xx responses. We serve static content via S3 and Cloudfront CDN. CORs origins are properly configured to accept requests from my app domain. Is there a conflict that may be causing this?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 8, 2024

Hey adrianchang3,

It’s great to hear that you’re considering transitioning to the DigitalOcean App Platform, though I’m sorry to hear about the performance issues you’re encountering. Based on the details you’ve provided, there are several things we can explore to diagnose the cause of the CDN ingest slowness you’re experiencing.

The CDN ingest latency of 4-6 seconds you’re observing is indeed significant and could substantially impact your app’s overall performance, especially for static content which should ideally be served swiftly. Here are a few suggestions to troubleshoot and potentially reduce this latency:

  1. Double-check your CDN configuration, focusing on cache behavior settings, TTL (Time To Live) values, and any custom rules that might affect content delivery.

  2. Ensure that your CDN’s origin server is geographically or network-wise close to your DigitalOcean App Platform service in SIN. Latency can increase if the CDN has to fetch content from a distant origin server.

  3. If your application has recently been deployed, the CDN might still be in the process of caching static content. In such cases, pre-warming the cache by manually accessing or scripting access to static resources can help ensure they are cached across all relevant CDN edge locations.

Given that the server response time is also higher than expected, even for static or blank pages, it’s worth examining other components of your application and infrastructure:

  1. Review the configuration of your app on the DigitalOcean App Platform, especially the compute resources allocated to your service (CPU and RAM) and how they compare to your previous setup. While you’ve mentioned that CPU and RAM loads are below threshold, ensuring that the allocated resources are appropriate for your app’s workload is still important.

  2. For static content served via S3 and Cloudfront CDN, review your content delivery optimization strategies. This includes checking file sizes, using compression where possible, and ensuring that browser caching directives are effectively utilized.

  3. On the application side, ensure that your Django settings are optimized for production. This includes enabling Django’s caching framework, minimizing middleware usage, and using Django’s ManifestStaticFilesStorage for static files to improve caching efficiency.

If after these investigations the issue persists, I recommend reaching out to DigitalOcean support with your findings for further assistance:

https://www.digitalocean.com/support/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel