Optimize CPU usage for sttp backend with cats when retrying #3286
Unanswered
vuhainguyen
asked this question in
Q&A
Replies: 2 comments 5 replies
-
I don't think there's a problem in the code you linked. Are you doing |
Beta Was this translation helpful? Give feedback.
4 replies
-
FWIW we tried to use this flag with a higher number of processor requested and got better usage on the CPU stats :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
We build our Retryingbackend using cats effect and sttp backend as below:
https://github.com/cognitedata/cognite-sdk-scala/blob/master/src/main/scala/com/cognite/sdk/scala/sttp/RetryingBackend.scala
And we use Spark to run jobs that send request using the backend above. I noticed that during a period that we have many failed request that we need to retry, the % CPU usage of Spark executors is down because the thread is blocked to sleep and wait til next moment of retry so this slow down our Spark application. I wonder if there's a way to optimize, telling the thread that "hey, you know that you will do nothing so instead of waiting for the next retry, why don't you you take some thing else to do".
I tried to use this flag ActiveProcessorCount as part of the spark.executor.extraJavaOptions when submitting Spark, but doesn't look like it helps.
Any ideas on how to optimize the code of RetryingBackend maybe?
Thanks in advance for your help :)
Beta Was this translation helpful? Give feedback.
All reactions