Skip to content

Commit 5009e8a

Browse files
committed
Document default ttl + explicit session memory value
1 parent 6629365 commit 5009e8a

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

doc/modules/ROOT/pages/gds-session.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ This is a `DbmsConnectionInfo` object that contains the URI of an Neo4j instance
7171
This optional parameter specifies the time-to-live of the session.
7272
The session will be automatically deleted if the session was unused for the provided duration.
7373
Usage is defined as the computation of an algorithm or the projection of a graph.
74+
By default, the session will be deleted after 1 hour of inactivity.
7475

7576
- **Cloud location**.
7677
This is a `CloudLocation` object that specifies the cloud provider and region where the GDS Session will run. Required if the DBMS connection is for a self-managed database.

doc/modules/ROOT/pages/tutorials/gds-sessions-self-managed.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ delete the session ourselves.
8282

8383
[source, python, role=no-test]
8484
----
85-
from graphdatascience.session import AlgorithmCategory
85+
from graphdatascience.session import AlgorithmCategory, SessionMemory
86+
87+
# Explicitly define the size of the session
88+
memory = SessionMemory.m_8GB
8689
8790
# Estimate the memory needed for the GDS session
8891
memory = sessions.estimate(
@@ -91,6 +94,8 @@ memory = sessions.estimate(
9194
algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],
9295
)
9396
97+
print(f"Estimated memory: {memory}")
98+
9499
# Find out and specify where to create the GDS session
95100
cloud_locations = sessions.available_cloud_locations()
96101
print(f"Available locations: {cloud_locations}")

doc/modules/ROOT/pages/tutorials/gds-sessions.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ delete the session ourselves.
8383

8484
[source, python, role=no-test]
8585
----
86-
from graphdatascience.session import AlgorithmCategory
86+
from graphdatascience.session import AlgorithmCategory, SessionMemory
87+
88+
# Explicitly define the size of the session
89+
memory = SessionMemory.m_8GB
8790
8891
# Estimate the memory needed for the GDS session
8992
memory = sessions.estimate(

examples/gds-sessions-self-managed.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@
120120
"metadata": {},
121121
"outputs": [],
122122
"source": [
123-
"from graphdatascience.session import AlgorithmCategory\n",
123+
"from graphdatascience.session import AlgorithmCategory, SessionMemory\n",
124+
"\n",
125+
"# Explicitly define the size of the session\n",
126+
"memory = SessionMemory.m_8GB\n",
124127
"\n",
125128
"# Estimate the memory needed for the GDS session\n",
126129
"memory = sessions.estimate(\n",
@@ -129,6 +132,8 @@
129132
" algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],\n",
130133
")\n",
131134
"\n",
135+
"print(f\"Estimated memory: {memory}\")\n",
136+
"\n",
132137
"# Find out and specify where to create the GDS session\n",
133138
"cloud_locations = sessions.available_cloud_locations()\n",
134139
"print(f\"Available locations: {cloud_locations}\")\n",

examples/gds-sessions.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@
120120
"metadata": {},
121121
"outputs": [],
122122
"source": [
123-
"from graphdatascience.session import AlgorithmCategory\n",
123+
"from graphdatascience.session import AlgorithmCategory, SessionMemory\n",
124+
"\n",
125+
"# Explicitly define the size of the session\n",
126+
"memory = SessionMemory.m_8GB\n",
124127
"\n",
125128
"# Estimate the memory needed for the GDS session\n",
126129
"memory = sessions.estimate(\n",

0 commit comments

Comments
 (0)