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
|
/home/nodejs/queue-cdn-purge.sh $site build-site |
. This also includes when the website index HTML page is detected as being older than index.json which 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
|
/home/nodejs/queue-cdn-purge.sh $site promote |
. 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.
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.
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:build/ansible/www-standalone/resources/scripts/build-site.sh
Line 61 in 3221213
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)build/ansible/www-standalone/resources/scripts/check-build-site.sh
Line 16 in 3221213
build/ansible/www-standalone/tools/promote/resha_release.sh
Line 28 in 3221213
build/ansible/www-standalone/tools/promote/_promote.sh
Line 61 in 3221213
To give an idea of frequency, these are the cdn-purges from today (including the Node.js 20.4.0 release):
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.