You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently captured a profile for my service and I see that instantiating Openai client consumes are around 16% of CPU. In order to reduce this overhead I am hoping if I can instantiate the client once at the module level and reuse it across all requests. Is this possible. If yes, are there any cons of doing so?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have recently captured a profile for my service and I see that instantiating Openai client consumes are around 16% of CPU. In order to reduce this overhead I am hoping if I can instantiate the client once at the module level and reuse it across all requests. Is this possible. If yes, are there any cons of doing so?
Beta Was this translation helpful? Give feedback.
All reactions