Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Details
Sentry
Sentry
Sentry
Created October 19, 2021 at 2:56 PM
Updated January 28, 2025 at 7:06 PM
Resolved January 25, 2025 at 6:19 AM
BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io
The ability to specify one or more warm up URLs for CommandBox to fire after the server is started in order to warm up the server. For now it's just a predicate handler that accepts
urls
– array of URLs to hit (required)requestStrategy
– during warmup…block
URLS with 503queue
requests until the server is ready (at which point they will be processed)allow
requests to flood in before warmup is complete (default)async
-- fire warmup URLs one at a time, or all at once (default totrue
)timeoutSeconds
-- how long to wait for the warm up URLs (default to60
)If async is false, the timeout is applied separately to each URL. So, each URL is given the full timeout. If async is true, the timeout simply begins when they are all fired and applies to all of them at the same time. When the timeout is reached, we don’t end the request. It will still load in the background, but if the
requestStrategy
is block or queue, we will no longer block or queue new traffic.The queue size is 10,000 and cannot be changed right now. That means up to 10,000 requests can come into the server while it is warming up and be queued. Once the queue is full, a 503 status code will be immediately returned for any additional traffic, which is the same as the block strategy. The first 10,000 requests int he queue will still process once the server is warmed up.
You can do a simple single-URL setup, which doesn't block or queue by default like so. The example uses positional args and only has a single URL so the
{}
array notation is not needed.{ "web":{ "rules":[ "warm-up-server( 'http://127.0.0.1:8080' )" ] } }
Or a more complicated setup with more than one URL and custom settings. This uses named params and has more than one URL, so we use the
{}
notation.{ "web":{ "rules":[ "warm-up-server( urls={'https://cnn.com','http://www.google.com','http://127.0.0.1:8080/warmup.cfm?brad=wood'}, requestStrategy=queue, async=false, timeoutSeconds=10 )" ] } }
URls can also be a relative URI, and the default base URL for that site (the same as what we would use to open the browser) will be used to create the complete URL. This can be handy for a site with uses different ports or hostnames across environments.
{ "web":{ "rules":[ "warm-up-server( '/myfile.cfm?foo=bar' )" ] } }