setHttpTimeout() performance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2022 11:23 PM
Hi Team,
We are working on integration to fetch user details to ServiceNow, from scheduled job we called the rest api and for data return it's taking time as 35 Sec, so we have added a setHttpTimeout(35000) method in script.
Adding 35 sec timeout will create any performance issue or not.
Thanks,
Preethi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2022 11:32 PM
Hi Preethi,
Setting timeout will probably increase performance due to ending a long transaction if set properly. One thing that I'll be concerned is it 35 seconds the max time? If it's the average time, many session will timeout and may increase traffic because there would be more retries. Check timeout with retries to make sure retries are also kept to the minimum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2022 02:04 AM
Hi Ozawa,
It may depends on data, so currently it's giving us 35 sec, if data increases then may time will also increase.
Is there any other way?
Thanks
Preethi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2022 04:51 AM
Hi,
Just a caution to check retries because it hurts performance. Other than that, have to try it out and monitor the performance.
If all responses are coming within 35 sec, then there shouldn't be any performance problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 11:57 PM
Hi Preethi,
There are couple of things to consider when you increase the timeout...
1. How long the job would be running, I mean execution time of the job?
2. Try couple of optimisation techniques to speed up the response time and decrease the timeout.
3. Make sure that Job is scheduled in such a way that same job is not running parallel, as it come's with other challenges like concurrent execution, locking, duplications, load and performance issues on the source server etc...
Regards,