Dramatic slowdown when streaming large body

I am trying to debug what might be causing my production deployment to respond so slowly. Here is the link: https://h2-prod-a12f47db3018f82aae88.o2.myshopify.dev/business/fleet-aware. As you can see the server response time of the initial html is approximately 1s. However I have logged the execution time of all my code from beginning to end including react rendering time and I am logging <100ms processing times. I can see this seems to be an issue specifically with the worker runtime because I can see that if I run my code locally the execution time I log is indeed longer (400ms) but the initial html request server time I see in the browser is roughly identical (~400ms) indicating no overhead when running locally. I believe this 900ms slowdown when running in production is proportional to the body of the HTML because I observe approximately 100ms slowdown for a much smaller body page: https://h2-prod-a12f47db3018f82aae88.o2.myshopify.dev/business/cs-test. (The initial request is usually over 1s, but subsequent requests range from 200ms to 800ms). Here are the basic facts laid out: Slow page (https://h2-prod-a12f47db3018f82aae88.o2.myshopify.dev/business/fleet-aware) Payload size: 1.27mb In production: measured time: ~100ms, browser dev tools reported server time: 900 - 1700ms, download time: 70ms In production build running locally through localhost: measured time: ~400ms, browser dev tools reported server time: ~400ms, download time: 50ms. In production build running locally through ngrok tunnel: measured time: ~400ms, browser dev tools reported server time: ~450ms, download time: 300ms. Faster page (still unacceptably slow https://h2-prod-a12f47db3018f82aae88.o2.myshopify.dev/business/cs-test): Payload size: 61kb In production: measured time: ~70ms, browser dev tools reported server time: 200ms - 1000ms, download time: ~70ms In production build running locally through localhost: measured time: ~300ms, browser dev tools reported server time: ~300ms, download time: 50ms. In production build running locally through ngrok tunnel: measured time: ~300ms, browser dev tools reported server time: ~350ms, download time: ~200ms. Also, just to be clear this is a shopify hydrogen/remix site running in an oxygen worker based on the cloudflare worker runtime. I am trying to determine how the oxygen worker could possibly be configured that might cause this kind of issue and shopify has not been very helpful. The only thing I can figure is that there is some process that the worker is running that processes the html body, thus causing a slowdown that is proportional to the html response body.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?