grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

Create a stress test client for Java

Open sreecha opened this issue 10 years ago • 10 comments

The specification for the stress test client is at : https://github.com/grpc/grpc/blob/master/tools/run_tests/stress_test/STRESS_CLIENT_SPEC.md

FYI: The C++ stress test client is here

sreecha avatar Mar 23 '16 22:03 sreecha

@sreecha I have got a Java implementation with a similar feature set as the C++ client, however I would like to support all interop tests. So my questions are:

  • Should the interop tests all use plaintext communication?
  • What about the RPCs that need Authentication? Where to specify the e.g. OAuth2 credentials?

thanks!

buchgr avatar Apr 06 '16 14:04 buchgr

@sreecha Also, regarding the flags that will be removed from the C++ client (like metrics_collection_interval_secs and sleep_duration_ms), should we just use the default values in the java client i.e. collect metrics every 5 seconds and don't sleep between calls?

I am asking this, because the spec mentions that the stress testing framework will use this to determine whether the client crashed.

Thanks!

buchgr avatar Apr 06 '16 14:04 buchgr

/cc @ejona86 and @louiscryan

Hi @buchgr ,

  • I am not sure how the current interop tests are implemented in java (for rpcs that need authentication or whether they all use plain text communication). Can you please check with either Louis or Eric ?
  • Regarding metrics_collection_interval_secs: In C++, I wanted to keep the metrics_server.cc (the one that implemented metrics.proto) generic and independent of the stress client (i.e metrics server only deals with Gauges and has no concept of Qps) - so I had to invent the metrics_collection_interval_secs flag so that the stress client can keep calculating qps regularly and keep updating a Gauge. In hindsight, it felt like an overkill.. I should have just baked-in the metrics_server in the stress client itself and should have just maintained total test case counts. That way, whenever the metrics_client calls GetGauge or GetAllGauges, I can just send back up-to-date qps i.e (total test cases so far) / (currTimeInSecs - testStartTimeInSecs) Anyway, long story short, you should not be needing that flag.. If you also tried to do a generic metrics server like I did, then yeah, the default of 5 seconds sounds reasonable.
  • Regarding sleep_duration_ms, that is totally unnecessary. I initially added it so that I can get guarantee a fixed qps from each client. That seems unnecessary in hindsight and I'll be deleting it soon.

The framework does not use any of its flags.. it has a separate setting that controls how often it polls these clients for qps (by calling metrics_client to get the qps).

sreecha avatar Apr 06 '16 16:04 sreecha

@sreecha thanks!

I am not sure how the current interop tests are implemented in java (for rpcs that need authentication or whether they all use plain text communication).

Oh, so the java stress test client only needs to work with the java interop server? I figured it also needs to work with the c++ interop server and in that case, details like whether to use TLS and authenticaton seemed to me like they should be put in the spec?

buchgr avatar Apr 06 '16 17:04 buchgr

Hi @buchgr , The java client should be able to work with C++ (and other languages) interop servers as well (but that is already the case with current interop tests.. i.e java interop client already works with interop servers in all languages). So I am assuming it shouldn't be difficult for the stress test client.. I do not know more specific details (sorry : ( )....Eric or Louis should be able to help..

thanks, Sree

sreecha avatar Apr 06 '16 17:04 sreecha

Hi @sreecha ,

thanks for your fast replies :-). I think I phrased my question wrong. I ll give it one more try.

My understanding is that the stress testing framework launches a interop server, and all the clients test against this server. Correct? So I was wondering if that server requires all the clients to talk TLS with a specific certificate and/or specific auth credentials?

Thanks!

buchgr avatar Apr 06 '16 17:04 buchgr

Sorry for my vague replies.

You are correct that the framework launches an interop_server and several stress test clients against that server.

Currently it does not expect the clients to talk TLS.

This is because, currently I did not implement any interop tests that require tls, oauth2 or jwt in my C++ stress client and I do not know specific details like where is the test-cert installed, where should the json service account key file etc. (and this is the reason why my answers on this topic are vague and redirecting you to the grpc-java team folks :) )..

However, the reason I am confident that won't be complicated is because all these questions are already answered/solved for interop-tests (i.e for interop test suite, we currently create docker images for interop client and interop server and the code to create those images ensure that the certs / service account keys are properly installed. I reused most of that code to create docker images for stress test client as well). So, technically if the stress test client did exactly the same thing the current interop client did (i.e made the same assumptions / got creds the same way..etc), things should work..

However, I suggest you do not use TLS for now and do not implement tests that require some form of creds..like jwt_token_creds or oauth2_auth_token or per_rcp_creds. We can implement them later once C++ client does it..

sreecha avatar Apr 06 '16 19:04 sreecha

@sreecha thanks so much!

buchgr avatar Apr 07 '16 12:04 buchgr

@sreecha - Can this be closed now?

louiscryan avatar Apr 15 '16 00:04 louiscryan

Looks like the pull request https://github.com/grpc/grpc-java/pull/1641 is not merged yet. We can close it once the pull request is merged..

sreecha avatar Apr 15 '16 00:04 sreecha