- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 07:20 AM
Hello fellow developers,
I'm experiencing an issue with a custom API we've developed, which is integrated with ServiceNow. We're facing timeout issues and have identified that the cause is a high "Session Wait Time" during API requests.
Our requests to the custom API generally take between 2-10 seconds to complete. However, when we try to call our Web Service in ServiceNow, we encounter timeouts. Analyzing the transaction logs, we've observed up to 300 seconds of session wait time, which seems to be causing the problem.
I was wondering if anyone has experience with this issue and could provide some guidance on the following questions:
- Is there a way to disable session wait time for an API user account in ServiceNow?
- If not, is it possible to increase the session wait time limit to avoid our requests stacking up and timing out?
- Are there alternative approaches or best practices we should consider to avoid these types of performance issues in our custom API and ServiceNow integration?
Any insights, suggestions, or resources on this matter would be greatly appreciated. We're eager to find a solution to this problem and improve the performance of our custom API.
Thank you in advance for your assistance.
Best regards,
Scott
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 07:02 AM - edited 05-11-2023 07:05 AM
We were using dotnet 7 to call the API in ServiceNow. The HttpClient in dotnet 7 persists cookies between calls by default, this resulted in us reusing the same ServiceNow session for all of our API Calls. Since each session is only allowed one request at a time, this resulted in the "session wait" times and eventual timeouts.
We were able to resolve the issue by disabling cookies in the dotnet HTTP Client which stopped the session reuse.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 09:35 AM
Thanks for this solution. My APIs were taking 300 seconds to execute. Clearing cache really helped.