0
votes

I have a spanner instance which currently has about 20000 active sessions connected to it. I am not sure how I would be able to delete them all in one go?

I tried makeing an api request here: https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances.databases.sessions/delete

but I can delete only one session at a time here.

1

1 Answers

2
votes

There is not an API for batch deleting sessions, and we don't currently have one planned.

The session management API you linked to is one solution. Note also that if a session is left idle for one hour, Cloud Spanner will delete it on its own (though most of the client libraries will send regular keepalive messages to sessions in their pools).