cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ServiceNow calls to the AppBroker API that checks to validate user email is valid as well as that the computer has a valid deployment is taking over 25 seconds.

ServiceNow calls to the AppBroker API that checks to validate user email is valid as well as that the computer has a valid deployment is taking over 25 seconds.
Example call: 'http://localhost /ESD/api/users?filter=email%3D%3D"name@domain.com"&machineName=computer1'
We believe the call may be taking more than 30 seconds at times which causes the workflow in ServiceNow to fail.

Does anyone know of a way to improve the response time for the API calls to AppBroker or are we going to have to increase the timeout on ServiceNow.

(1) Solution
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

I think that perhaps you may be running into an issue where the REST API "listener" may be shut down, and is taking a while to warm back up.. As a quick test, could you try hitting the rest API http://localhost/esd/api/categories in a browser on the App Broker machine, followed by the validate Request Data REST call in ServiceNow? Do you see the same delay if you "warm up" the REST calls by hitting the categories endpoint? If not, then perhaps I can suggest that you call  http://localhost/esd/api/categories in a PowerShell script invoked by a scheduled task to keep things warm.. This is something that engineering is considering doing, though they would do it as part of the ESD Service timers. The categories API is very light weight, so you might try starting with every 30-60 seconds.

View solution in original post

(2) Replies
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

I think that perhaps you may be running into an issue where the REST API "listener" may be shut down, and is taking a while to warm back up.. As a quick test, could you try hitting the rest API http://localhost/esd/api/categories in a browser on the App Broker machine, followed by the validate Request Data REST call in ServiceNow? Do you see the same delay if you "warm up" the REST calls by hitting the categories endpoint? If not, then perhaps I can suggest that you call  http://localhost/esd/api/categories in a PowerShell script invoked by a scheduled task to keep things warm.. This is something that engineering is considering doing, though they would do it as part of the ESD Service timers. The categories API is very light weight, so you might try starting with every 30-60 seconds.

Thank you Charles.
I created a simple PowerShell script and scheduled it to run as the AppPortal service account and will see if that improves the average response.
$webClient = New-Object System.Net.WebClient
# Set the UseDefaultCredentials property to $true to use the current user's credentials
$webClient.UseDefaultCredentials = $true
# Use the WebClient to download the content from the API endpoint
$response = $webClient.DownloadString( "http://localhost/ESD/api/categories")
Write-Host $response