Skip to content

Commit 3ccfe09

Browse files
committed
Fix ttl for attached notebook + fix session size
2GB is enough for the used data
1 parent bd80f73 commit 3ccfe09

6 files changed

+27
-23
lines changed

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-self-managed.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ or the manual for more details on the parameters.
9292
----
9393
from graphdatascience.session import AlgorithmCategory, CloudLocation, SessionMemory
9494
95-
# Explicitly define the size of the session
96-
memory = SessionMemory.m_8GB
97-
9895
# Estimate the memory needed for the GDS session
9996
memory = sessions.estimate(
10097
node_count=20,
10198
relationship_count=50,
10299
algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],
103100
)
104101
102+
# Explicitly define the size of the session
103+
memory = SessionMemory.m_2GB
104+
105105
print(f"Estimated memory: {memory}")
106106
107107
# Specify your cloud location

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-standalone.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ or the manual for more details on the parameters.
8989
----
9090
from graphdatascience.session import AlgorithmCategory, CloudLocation, SessionMemory
9191
92-
# Explicitly define the size of the session
93-
memory = SessionMemory.m_4GB
94-
9592
# Estimate the memory needed for the GDS session
9693
memory = sessions.estimate(
9794
node_count=20,
@@ -101,6 +98,9 @@ memory = sessions.estimate(
10198
10299
print(f"Estimated memory: {memory}")
103100
101+
# Explicitly define the size of the session
102+
memory = SessionMemory.m_2GB
103+
104104
# Specify your cloud location
105105
cloud_location = CloudLocation("gcp", "europe-west1")
106106

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,17 @@ or the manual for more details on the parameters.
9393
----
9494
from graphdatascience.session import AlgorithmCategory, SessionMemory
9595
96-
# Explicitly define the size of the session
97-
memory = SessionMemory.m_8GB
98-
9996
# Estimate the memory needed for the GDS session
10097
memory = sessions.estimate(
10198
node_count=20,
10299
relationship_count=50,
103100
algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],
104101
)
102+
103+
print(f"Estimated memory for the session: {memory}")
104+
105+
# Explicitly define the size of the session
106+
memory = SessionMemory.m_2GB
105107
----
106108

107109
[source, python, role=no-test]
@@ -122,9 +124,9 @@ db_connection = DbmsConnectionInfo(
122124
gds = sessions.get_or_create(
123125
# we give it a representative name
124126
session_name="people_and_fruits",
125-
memory=SessionMemory.m_4GB,
127+
memory=memory,
126128
db_connection=db_connection,
127-
ttl=timedelta(minutes=2),
129+
ttl=timedelta(minutes=30),
128130
)
129131
----
130132

examples/graph-analytics-serverless-self-managed.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@
128128
"source": [
129129
"from graphdatascience.session import AlgorithmCategory, CloudLocation, SessionMemory\n",
130130
"\n",
131-
"# Explicitly define the size of the session\n",
132-
"memory = SessionMemory.m_8GB\n",
133-
"\n",
134131
"# Estimate the memory needed for the GDS session\n",
135132
"memory = sessions.estimate(\n",
136133
" node_count=20,\n",
137134
" relationship_count=50,\n",
138135
" algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],\n",
139136
")\n",
140137
"\n",
138+
"# Explicitly define the size of the session\n",
139+
"memory = SessionMemory.m_2GB\n",
140+
"\n",
141141
"print(f\"Estimated memory: {memory}\")\n",
142142
"\n",
143143
"# Specify your cloud location\n",

examples/graph-analytics-serverless-standalone.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@
129129
"source": [
130130
"from graphdatascience.session import AlgorithmCategory, CloudLocation, SessionMemory\n",
131131
"\n",
132-
"# Explicitly define the size of the session\n",
133-
"memory = SessionMemory.m_4GB\n",
134-
"\n",
135132
"# Estimate the memory needed for the GDS session\n",
136133
"memory = sessions.estimate(\n",
137134
" node_count=20,\n",
@@ -141,6 +138,9 @@
141138
"\n",
142139
"print(f\"Estimated memory: {memory}\")\n",
143140
"\n",
141+
"# Explicitly define the size of the session\n",
142+
"memory = SessionMemory.m_2GB\n",
143+
"\n",
144144
"# Specify your cloud location\n",
145145
"cloud_location = CloudLocation(\"gcp\", \"europe-west1\")\n",
146146
"\n",

examples/graph-analytics-serverless.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@
129129
"source": [
130130
"from graphdatascience.session import AlgorithmCategory, SessionMemory\n",
131131
"\n",
132-
"# Explicitly define the size of the session\n",
133-
"memory = SessionMemory.m_8GB\n",
134-
"\n",
135132
"# Estimate the memory needed for the GDS session\n",
136133
"memory = sessions.estimate(\n",
137134
" node_count=20,\n",
138135
" relationship_count=50,\n",
139136
" algorithm_categories=[AlgorithmCategory.CENTRALITY, AlgorithmCategory.NODE_EMBEDDING],\n",
140-
")"
137+
")\n",
138+
"\n",
139+
"print(f\"Estimated memory for the session: {memory}\")\n",
140+
"\n",
141+
"# Explicitly define the size of the session\n",
142+
"memory = SessionMemory.m_2GB"
141143
]
142144
},
143145
{
@@ -162,9 +164,9 @@
162164
"gds = sessions.get_or_create(\n",
163165
" # we give it a representative name\n",
164166
" session_name=\"people_and_fruits\",\n",
165-
" memory=SessionMemory.m_4GB,\n",
167+
" memory=memory,\n",
166168
" db_connection=db_connection,\n",
167-
" ttl=timedelta(minutes=2),\n",
169+
" ttl=timedelta(minutes=30),\n",
168170
")"
169171
]
170172
},

0 commit comments

Comments
 (0)