-
-
Notifications
You must be signed in to change notification settings - Fork 171
Description
I believe most of the server issues we're currently having with nodejs.org stem from our rather crude "purge everything" strategy. This is currently done by ansible/www-standalone/resources/scripts/cdn-purge.sh.j2 (which runs every five minutes) if a purge has been locally queued.
Purges are queued by calling ansible/www-standalone/resources/scripts/queue-cdn-purge.sh. This is done every time:
- the website is rebuilt . This also includes when the website index HTML page is detected as being older than
/home/nodejs/queue-cdn-purge.sh $site build-site index.jsonwhich triggers a website rebuild (I believe this is so the website picks up the most recent current and LTS releases for the download buttons/pages)[ $indexjson -nt $indexhtml ] && $buildsite $site - a release is promoted (during shasum creation)
/home/nodejs/queue-cdn-purge.sh $site resha_release - a build (e.g. nightly/V8 canary/release) is promoted . Note that nightly/V8 canary builds get promoted every 30 mins which may mean an iojs+release build can have multiple promotions depending on when the sub-builds complete and upload their assets to staging.
/home/nodejs/queue-cdn-purge.sh $site promote
To give an idea of frequency, these are the cdn-purges from today (including the Node.js 20.4.0 release):
2023-07-05T06:35:01+00:00, nodejs, promote
2023-07-05T07:35:01+00:00, nodejs, promote
2023-07-05T11:05:01+00:00, nodejs, promote
2023-07-05T12:35:01+00:00, nodejs, promote
2023-07-05T13:35:02+00:00, nodejs, promote
2023-07-05T14:00:01+00:00, nodejs, promote resha_release
2023-07-05T14:55:01+00:00, nodejs, build-site
2023-07-05T16:30:01+00:00, nodejs, build-site
The first two "promote"s are from the nightly build, the next three from the V8 canary, and the last "promote" (and "resha_release") from the manual promotion of 20.4.0. The subsequent "build-sites" are from merging nodejs/nodejs.org#5473 and nodejs/nodejs.org#5474 respectively.
Purging everything is rather heavy handed, but our current options in Cloudflare are to either purge everything (as we are doing) or purge a list of static URLs (there are further options only available for enterprise accounts which we do not have access to). Switching to a more selective cache purge requires us to determine what URLs to purge for all of the above scenarios that we are currently purging everything.