Really confused by Warmup Requests on NodeJS + not working!

27 views
Skip to first unread message

David Williams

unread,
Aug 23, 2019, 4:58:53 PM8/23/19
to Google App Engine
I have a node server running in App Engine Standard using a custom domain. Everything works fine.

When I deploy a new version there is a huge latency spike as the old instances are stopped and new ones started.

From reading the docs, it would appear that I need to:
1. Enable warmup requests by adding to app.yaml
inbound_services:
-  warmup
2. Create a handler for /_ah/warmup
3. Deploy new version without promoting: gcloud deploy --no-promote app.yaml
4. From the App Engine versions page, use Migrate to move traffic from old to new

I'm new to App Engine, and the docs are vague so I'm have questions and a major problem:

1. What is the point of the /_ah/warmup handler? Since I initialize everything I need to when the node app starts, there is nothing for this handler to do.
2. Is the handler optional? I assume yes since I read somewhere that a 404 response would be OK.
3. If it's not optional, what response is expected?

4. This is the biggie!:

I've tried this (omitting the handler). The Migrate button becomes available and appears to migrate traffic to the new version HOWEVER, after a while my site starts failing. The problem is different after each Migrate -  one time was corrupt/invalid HTML, another a JavaScript syntax error, another the entire site was wrapped inside a PRE tag in HTML I didn't write! The only way I've found to "fix" the corruption is to remove inbound_services: -warmup from app.yaml & re-deploy

To make it even weirder, the corruption only happens if the site is accessed from the custom domain. If I hit the appspot.com address everything is OK

My head hurts. Any help/insight gratefully received

David Williams

unread,
Aug 23, 2019, 4:58:53 PM8/23/19
to Google App Engine
I have a node js server running in App Engine using a custom domain. Everything works fine.

George (Cloud Platform Support)

unread,
Aug 23, 2019, 5:57:10 PM8/23/19
to Google App Engine
Hello David, 

Warmup requests load your app's code into a new instance before any live requests reach that instance.  You may find related detail on the "Configuring Warmup Requests to Improve Performance" documentation page

Handler might be considered in a way optional, as you app would finally work as expected anyhow, even if request and response latency would likely prove higher without configured warmup requests. 

Expected response or functionality is related to the needed execution of per-instance one-time warmup and initialization actions. 
Reply all
Reply to author
Forward
0 new messages