Thread saturation due to connect rest timeout in container call in pega cdh

We have configure a connect rest in our pega cdh container activity. With connect rest timeout as 3500ms. But even if it is timing out the threads are not closing. Due to this threads are getting saturated and we are getting huge 503,504 errors. Does anyone faced this and solved this issue.