# TensorFlow Serving parallelism

**URL:** <https://discuss.ai.google.dev/t/tensorflow-serving-parallelism/31622>\
**Category:** General Discussion\
**Tags:** models, tf-serving\
**Created:** [January 11, 2023, 10:55pm UTC](https://discuss.ai.google.dev/t/tensorflow-serving-parallelism/31622 "2023-01-11T22:55:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehran\_S](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/mehran_s/32/11933_2.png) [@Mehran\_S](https://discuss.ai.google.dev/u/Mehran_S)\
**Post date:** [January 11, 2023, 10:55pm UTC](https://discuss.ai.google.dev/t/tensorflow-serving-parallelism/31622/1 "2023-01-11T22:55:57Z")

</div>

TensorFlow serving provides two parameters to utilize the CPU (`tensorflow_intra_op_parallelism` and `tensorflow_inter_op_parallelism`). Tuning these parameters can have great impact on the model server performance (throughput, latency). I couldn’t find a good documentation for them in TensorFlow Serving website. My main question is:

- How these thread pools relate to [rest\_api\_num\_threads](https://github.com/tensorflow/serving/blob/master/tensorflow_serving/model_servers/main.cc#L93). Are the thread pools shared between ops of all the requests on the model server?

---

<div class="post-metadata">

**Author:** ![Jetti\_Bharat](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jetti_bharat/32/1510_2.png) [@Jetti\_Bharat](https://discuss.ai.google.dev/u/Jetti_Bharat)\
**Post date:** [March 27, 2025, 6:49pm UTC](https://discuss.ai.google.dev/t/tensorflow-serving-parallelism/31622/3 "2025-03-27T18:49:39Z")

</div>

Hello @Mehran_S

Thank you for using TensorFlow

The `tensorflow_intra_op_parallelism` and `tensorflow_inter_op_parallelism` are parameters used by TensorFlow during model execution, `rest_api_num_threads` affects the number of threads available for handling incoming API requests in Serving. The thread pools for these are not directly shared.  
Tuning `tensorflow_intra_op_parallelism` and `tensorflow_inter_op_parallelism` will directly may improve model inference performance, while `rest_api_num_threads` handles multiple concurrent requests from requests.
