setHttpTimeout() performance

p t1
Kilo Sage
Kilo Sage

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

4 REPLIES 4

Hitoshi Ozawa
Giga Sage
Giga Sage

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.

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

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.

Khalil Kothia
Kilo Contributor

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,

Khalil Kothia