-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added documentation for SysVCacheItemPool #995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These updates look great.
For the bit regarding spanner and sessions, WDYT about a note linking out to here for guiding users on more information on how to use the session pool?
README.md
Outdated
@@ -1005,6 +1005,21 @@ $storage = new StorageClient([ | |||
]); | |||
``` | |||
|
|||
The [Google Auth library](https://github.com/google/google-auth-library-php) provides a PSR-6 implementation with the SystemV shared memory. This implementation is only available on *nix machines, but it's the one of the fastest implementations and you can share the cache among multiple processes. The following example shows how to use it. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spanner/README.md
Outdated
|
||
$sessionPool = new CacheSessionPool( | ||
$sessionCache, | ||
['minSession' => 10, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spanner/README.md
Outdated
|
||
## Session warmup | ||
|
||
To issue a query against the Spanner service, the client library needs to request a session id to the server under the cover. This API call will add significant latency to your program. The Spanner client library provides a handy way to alleviate this problem by having a cached session pool. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spanner/README.md
Outdated
|
||
$authCache = new SysVCacheItemPool(); | ||
$sessionCache = new SysVCacheItemPool([ | ||
'proj' => 'B' // Use different from the default |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spanner/README.md
Outdated
); | ||
|
||
$database = $client->connect( | ||
$instance, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spanner/README.md
Outdated
$db, | ||
['sessionPool' => $sessionPool] | ||
); | ||
// `warmup` will actually create the session for the first time. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Additionally, we could now update this verbiage. |
See #989
Preview available on:
https://github.com/tmatsuo/google-cloud-php/tree/docs-for-989
https://github.com/tmatsuo/google-cloud-php/tree/docs-for-989/Spanner
https://github.com/tmatsuo/google-cloud-php/blob/docs-for-989/Spanner/src/Session/CacheSessionPool.php