Hi Team, Actually, we are facing high cpu usage p...
# announcements
f
Hi Team, Actually, we are facing high cpu usage problem when we are trying to figure out variations for a user. SDK - JAVA Features Count - 200 Load - 100 TPS CPU Usage goes upto - 80% Are we doing something wrong?? or it this expected ?? Please Help!!!
s
Hi, @freezing-apple-73992 let me take a look into this. Are you a cloud user or self-hosted?
b
is this in your java app, or on your self-hosted instance?
f
Yes..this is a java app...
I am a self-hosted user...
b
thanks for clarifying. is it the self-hosted growthbook instance that is causing the feature usage to spike, or is it your java app? we'd like to pinpoint if there's an issue in the java SDK or if this is with the growthbook deployment itself.
f
The sdk part... Is kind of causing the spike
b
can you tell us about your implementation? • which version of the java SDK are you using? we released 0.8.1 a couple weeks ago and it has a minor fix that may have impacted performance. if you are on an earlier version, try updating and seeing if that helps. • what framework are you using, if any (e.g. spring, micronaut, ktor, etc.) • can you share your features URL (if public, unencrypted)? i want to see if there may be issues due to the size of the features JSON. • can you share the code you're using for networking, e.g. your implementation of the GBFeaturesRepository or where you're making the calls manually • have you done any profiling to pinpoint the cause of the problem? e.g. is it in the networking implementation, or in the feature or experiment evaluation? previously a user mentioned that the example in our docs (which uses
<http://java.net|java.net>.http.HttpClient
) is not performant in spring. if using spring, did you look at the spring examples? there's several implementations in here (e.g. using the GBFeaturesRepository class, or making calls with your own networking implementation). there may also be a better way to do the same thing in spring or your framework of choice—the repository class is meant to be framework agnostic.