Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Set status to Completed

...

IDIEP-46
Author
Sponsor
Created

 

Status

Status
colourGreen
titleDRAFTCOMPLETED


Table of Contents

Motivation

...

OP_SERVICE_GET_PROXY message format

Request
StringService name
String
Interface nameN
byte

Flags:

0x01 Sticky flag

0x02 Keep binary flag

longTimeout
intCount of nodes
 
 selected to invoke service. If this value is 0, no server nodes should be explicitly listed in the message, but all server cluster nodes should be selected. 
UUID * count

Node

ID #1...

IDs


UUIDNode ID #N
Response
longresourceId

Resulting resourceId should be used to call the service with OP_SERVICE_INVOKE and to release the proxy with OP_RESOURCE_CLOSE.

...

Operation codes

New client operations are operation is required:

Name

Code

OP_SERVICE_INVOKE7000

...

Arguments
Request
StringService name
StringInterface name
byte

Flags:

0x01 Keep binary flag

0x02 "Has parameter types" flag (see "service name resolve logic")

longTimeout
intCount of nodes N selected to invoke service. If this value is 0, no server nodes should be explicitly listed in the message, but all server cluster nodes should be selected. 
UUIDUUID * count

Node ID #1

...
UUIDNode ID #N

IDs

StringMethod name
intArgument count
int[](int? + Object) * countArgument type IDs to resolve method (optional, can be NULL, see "service name resolve logic")  
intArgument count
Object * count
if "has parameter types" flag is set) + Arguments


Response
ObjectResult

Benchmark results

Benchmarks were made by Yardstick framework with 4 servers and 4 drivers (each server and driver on own hardware host). Each driver has 128 threads to invoke cluster-singleton service. Each thread has its own client. Each benchmark was run for 3 minutes with 1 minute warmup. Service proxies were created at warmup, benchmark threads just invoke method from already created proxies. 

There 20 benchmarks totally were made (10 with the one-operation approach and 10 with the two-operations approach).

Results:

tps 1, op/sec, AVGlatency 1, nsec, AVGtps 2, op/sec, AVGlatency 2, nsec, AVGdelta tpsdelta latency
390113262510339393026002880,98%-0,95%
38330726715313708312762661-3,25%3,41%
378431270638138254026787671,09%-1,02%
372316275031437788427113881,50%-1,42%
38325826729523807902689943-0,64%0,64%
381941268163939800625734714,21%-4,03%
378778270399937997126953590,31%-0,32%
374484273575838026026948531,54%-1,50%
37953526983153750982731863-1,17%1,24%
37419627370323730182746522-0,31%0,35%

Conclusion: there is almost no difference between the one-operation approach and the two-operations approach (about 1% on average), so there is no reason to implement two-operations approach. Single-operation approach should be implemented as more convenient from the user's point of view.

Service method resolve logic

...

To solve this problem we can pass additional information (parameter types) optionally instead of just method name. If parameter types are passed - method should be resolved using this information, if NULL is passed as parameter types are not passed method should be resolved using argument values (the same way as PlatformServices.ServiceProxyHolder#getMethod).

Parameter types it's an array of binary type IDsTo pass parameter types "has parameter types" flag of the request should be set. In this case, each argument is prefixed by int value - argument's binary type ID.

Client-side API (java thin client)

...