Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter for multiple warmup requests #13

Closed
mjiderhamn opened this issue Apr 20, 2020 · 6 comments
Closed

Add parameter for multiple warmup requests #13

mjiderhamn opened this issue Apr 20, 2020 · 6 comments

Comments

@mjiderhamn
Copy link

While it's possible to to set a retry count if warmup calls fail, there will only ever be 1 success call (unless you list the same suffix multiple times).

Please add a parameter so that you can require N successful requests before the app is considered warmed up.

@cmeeren
Copy link

cmeeren commented Jun 1, 2022

Please add this! I really need it.

For some reason, during deployments to Azure App Service, the app seems to restart again after the warmup task but before or while the subsequent smoke test task runs. The smoke tests then fail because the app is no longer up.

@elgorro
Copy link

elgorro commented Jul 18, 2022

At the moment you just can ignore all failures and you need to calibrate it yourself. Possible is also to add a second warmup - to be 100% sure. E.g. 10 minutes warm up with erros and then the second (or as much as you want) warmup without errors allowed. Don't know every backend technology in detail, but agree to enhance this for better usability. :)

@luuksommers
Copy link
Owner

I've added a success count parameter. You can increase this number to make sure a number of requests are successfull. Between the request it will wait the Sleep Period. The SuccessCount also counts as a Retry, so if you have more successcounts than retries, you'll get an error.

It is published in the marketplace, Package version 1.2.0, Job version 2.2.0. I'll close this issue.

@cmeeren
Copy link

cmeeren commented Aug 8, 2022

Is there a bug somewhere? Here is the output after I have configured success count = 3. Note that once it's up, it goes to -3/3, and then counts up: -2, -1, 0, 1, 2, and 3, for a total of 7 successful tries (instead of the configured 3).

2022-08-08T09:41:02.2244697Z ##[section]Starting: Warmup website
2022-08-08T09:41:02.2363044Z ==============================================================================
2022-08-08T09:41:02.2363367Z Task         : Website Warmup
2022-08-08T09:41:02.2363612Z Description  : This task warms up a website by calling its url
2022-08-08T09:41:02.2363853Z Version      : 2.2.0
2022-08-08T09:41:02.2364152Z Author       : Luuk Sommers
2022-08-08T09:41:02.2364985Z Help         : [More Information](https://github.com/luuksommers/vsts-website-warmup)
2022-08-08T09:41:02.2365347Z ==============================================================================
2022-08-08T09:41:05.6374238Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 1 / 10
2022-08-08T09:41:06.2362151Z ##[warning]The remote server returned an error: (403) Forbidden.
2022-08-08T09:41:06.2377693Z Sleep for 10 seconds, before try 2 / 10
2022-08-08T09:41:16.2398283Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 2 / 10
2022-08-08T09:41:16.3900766Z ##[warning]The remote server returned an error: (503) Server Unavailable.
2022-08-08T09:41:16.3907291Z Sleep for 10 seconds, before try 3 / 10
2022-08-08T09:41:26.3925715Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 3 / 10
2022-08-08T09:41:26.4331317Z ##[warning]The remote server returned an error: (503) Server Unavailable.
2022-08-08T09:41:26.4342467Z Sleep for 10 seconds, before try 4 / 10
2022-08-08T09:41:36.4362724Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 4 / 10
2022-08-08T09:43:40.0438304Z ##[warning]The remote server returned an error: (503) Server Unavailable.
2022-08-08T09:43:40.0444623Z Sleep for 10 seconds, before try 5 / 10
2022-08-08T09:43:50.0458284Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 5 / 10
2022-08-08T09:45:43.0124552Z Site is up, check -3 / 3, will do another check.
2022-08-08T09:45:53.0132286Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 6 / 10
2022-08-08T09:45:53.1802277Z Site is up, check -2 / 3, will do another check.
2022-08-08T09:46:03.1816828Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 7 / 10
2022-08-08T09:46:03.3453742Z Site is up, check -1 / 3, will do another check.
2022-08-08T09:46:13.3472068Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 8 / 10
2022-08-08T09:46:13.6955004Z Site is up, check 0 / 3, will do another check.
2022-08-08T09:46:23.6977390Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 9 / 10
2022-08-08T09:46:23.8502033Z Site is up, check 1 / 3, will do another check.
2022-08-08T09:46:34.2991333Z Invoke-WebRequest https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready, try 10 / 10
2022-08-08T09:46:34.2992183Z Site is up, check 2 / 3, will do another check.
2022-08-08T09:46:44.0102306Z Site returned error after 10 tries and in 338.376453 seconds!
2022-08-08T09:46:44.1858270Z ##[error]Error warm-up https://app-vbit-api-authorization-dev-002-swap.azurewebsites.net/maintenance/health/ready
2022-08-08T09:46:44.2130578Z ##[section]Finishing: Warmup website

@cmeeren
Copy link

cmeeren commented Aug 10, 2022

There seems to be another bug, too (an off-by-one error): If I configure 3 successful tries, it actually performs 4. See the last four Invoke-WebRequest below.

2022-08-10T09:27:15.9917421Z ##[section]Starting: Warmup website
2022-08-10T09:27:16.0203570Z ==============================================================================
2022-08-10T09:27:16.0203883Z Task         : Website Warmup
2022-08-10T09:27:16.0204117Z Description  : This task warms up a website by calling its url
2022-08-10T09:27:16.0204330Z Version      : 2.2.0
2022-08-10T09:27:16.0204505Z Author       : Luuk Sommers
2022-08-10T09:27:16.0205355Z Help         : [More Information](https://github.com/luuksommers/vsts-website-warmup)
2022-08-10T09:27:16.0205679Z ==============================================================================
2022-08-10T09:27:26.4833026Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 1 / 15
2022-08-10T09:27:27.0114269Z ##[warning]The remote server returned an error: (403) Forbidden.
2022-08-10T09:27:27.0122746Z Sleep for 10 seconds, before try 2 / 15
2022-08-10T09:27:37.0136743Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 2 / 15
2022-08-10T09:27:37.5676122Z Site is up, check 0 / 3, will do another check.
2022-08-10T09:27:47.5686552Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 3 / 15
2022-08-10T09:27:47.8542457Z ##[warning]The remote server returned an error: (503) Server Unavailable.
2022-08-10T09:27:47.8557930Z Sleep for 10 seconds, before try 4 / 15
2022-08-10T09:27:57.8572832Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 4 / 15
2022-08-10T09:28:08.6605425Z Site is up, check 0 / 3, will do another check.
2022-08-10T09:28:18.6630322Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 5 / 15
2022-08-10T09:28:19.0744945Z Site is up, check 1 / 3, will do another check.
2022-08-10T09:28:29.0762477Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 6 / 15
2022-08-10T09:28:29.4754616Z Site is up, check 2 / 3, will do another check.
2022-08-10T09:28:39.4778868Z Invoke-WebRequest https://chkboxapi-production-swap.azurewebsites.net/maintenance/health/ready, try 7 / 15
2022-08-10T09:28:39.8635154Z Site is running in 73.3869983 seconds
2022-08-10T09:28:39.9262744Z ##[section]Finishing: Warmup website

@luuksommers
Copy link
Owner

luuksommers commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants