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
Copy file name to clipboardExpand all lines: README.md
+22-19Lines changed: 22 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,29 +212,29 @@ In this feature launch, the [Java Datastore client](https://github.com/googleapi
212
212
The client can be built from the `grpc-experimental` branch on GitHub. For private preview, you can also download the artifact with the instructions provided below.
213
213
214
214
1. Download the datastore private preview package with dependencies:
And if you have not yet, add below to `<repositories/>` section:
232
-
```xml
233
-
<repository>
234
-
<id>local-repo</id>
235
-
<url>file://${user.home}/.m2/repository</url>
236
-
</repository>
237
-
```
232
+
```xml
233
+
<repository>
234
+
<id>local-repo</id>
235
+
<url>file://${user.home}/.m2/repository</url>
236
+
</repository>
237
+
```
238
238
239
239
#### How to Use
240
240
To opt-in to the gRPC transport behavior, simply add the below line of code (`setTransportOptions`) to your Datastore client instantiation.
@@ -286,7 +286,7 @@ There are new gRPC specific features available to use in this update.
286
286
287
287
##### Connection Pool
288
288
A connection pool, also known as a channel pool, is a cache of database connections that are shared and reused to improve connection latency and performance. With this update, now you will be able to configure the channel pool to improve application performance. This section guides you in determining the optimal connection pool size and configuring it within the Java datastore client.
289
-
To customize the number of channels your client uses, you can update the channel provider in the DatastoreOptions.
289
+
To customize the number of channels your client uses, you can update the channel provider in the DatastoreOptions.
290
290
###### Determine the best connection pool size
291
291
The default connection pool size is right for most applications, and in most cases there's no need to change it.
292
292
@@ -310,12 +310,15 @@ These steps are expressed in the following equations:
310
310
```
311
311
312
312
###### Example
313
-
Your application typically sends 50,000 requests per second, and the average latency is 10 ms. Divide 1,000 by 10 ms to determine that you can send 100 requests serially per second. Divide that number into 50,000 to get the parallelism needed to send 50,000 QPS: 500. Each channel can have at most 100 requests out concurrently, and your target channel utilization is between 10 and 50 concurrent streams. Therefore, to calculate the minimum, divide 500 by 50 to get 10. To find the maximum, divide 500 by 10 to get 50. This means that your channel pool size for this example should be between 10 and 50 connections.
313
+
Your application typically sends 50,000 requests per second, and the average latency is 10 ms. Divide 1,000 by 10 ms to determine that you can send 100 requests serially per second.
314
+
Divide that number into 50,000 to get the parallelism needed to send 50,000 QPS: 500. Each channel can have at most 100 requests out concurrently, and your target channel utilization
315
+
is between 10 and 50 concurrent streams. Therefore, to calculate the minimum, divide 500 by 50 to get 10. To find the maximum, divide 500 by 10 to get 50. This means that your channel
316
+
pool size for this example should be between 10 and 50 connections.
314
317
315
318
It is also important to monitor your traffic after making changes and adjust the number of connections in your pool if necessary.
316
319
317
320
###### Set the pool size
318
-
The following code sample demonstrates how to configure the channel pool in the client libraries using `DatastoreOptions`.
321
+
The following code sample demonstrates how to configure the channel pool in the client libraries using `DatastoreOptions`.
319
322
See [ChannelPoolSettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.ChannelPoolSettings) and [Performance Best Practices](https://grpc.io/docs/guides/performance/) for more information on channel pools and best practices for performance.
0 commit comments