Skip to content
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

Data cache benchmark guide #1523

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_01_sc_storage_class_balanced]
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: pd-balanced-data-cache-sc
provisioner: pd.csi.storage.gke.io
parameters:
type: pd-balanced
data-cache-mode: writethrough
data-cache-size: "100Gi"
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# [END gke_databases_data_cache_01_sc_storage_class_balanced]

28 changes: 28 additions & 0 deletions databases/data-cache/manifests/01-sc/storage-class-ssd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_01_sc_storage_class_ssd]
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: pd-ssd-data-cache-sc
provisioner: pd.csi.storage.gke.io
parameters:
type: pd-ssd
data-cache-mode: writethrough
data-cache-size: "100Gi"
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# [END gke_databases_data_cache_01_sc_storage_class_ssd]

55 changes: 55 additions & 0 deletions databases/data-cache/manifests/02-postgres/psql-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_02_postgres_psql_client]
apiVersion: v1
kind: Pod
metadata:
name: psql
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: NotIn
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
containers:
- name: main
image: postgres:17
command: ["sleep", "360000"]
resources:
requests:
memory: 2Gi
cpu: "1"
limits:
memory: 2Gi
cpu: "2"
env:
- name: PGDATABASE
value: postgres
- name: PGUSER
value: postgres
- name: PGPASSWORD
value: benchmark
# [END gke_databases_data_cache_02_postgres_psql_client]

57 changes: 57 additions & 0 deletions databases/data-cache/manifests/02-postgres/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_02_postgres_cluster]
global:
postgresql:
auth:
postgresPassword: "benchmark"
primary:
resources:
requests:
memory: 8Gi
cpu: "2"
limits:
memory: 8Gi
cpu: "4"
extraEnvVars:
- name: POSTGRESQL_MAX_CONNECTIONS
value: "400"
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: In
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 150Gi
readReplicas:
replicaCount: 0
shmVolume:
enabled: true
sizeLimit: "1Gi"
# [END gke_databases_data_cache_02_postgres_cluster]

49 changes: 49 additions & 0 deletions databases/data-cache/manifests/03-elasticsearch/es-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_03_elasticsearch_client]
apiVersion: v1
kind: Pod
metadata:
name: esrally
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: NotIn
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
containers:
- name: main
image: kokutoubanira/esrally:1.0.0
command: ["sleep", "360000"]
resources:
requests:
memory: 4Gi
cpu: "1"
limits:
memory: 4Gi
cpu: "2"

# [END gke_databases_data_cache_03_elasticsearch_client]

61 changes: 61 additions & 0 deletions databases/data-cache/manifests/03-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_03_elasticsearch_cluster]
security:
elasticPassword: "benchmark"
tls:
restEncryption: false
autoGenerated: false
verificationMode: "none"

master:
masterOnly: false
replicaCount: 1
resources:
requests:
memory: 8Gi
cpu: "2"
limits:
memory: 8Gi
cpu: "4"
heapSize: "4g"
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: In
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 150Gi
data:
replicaCount: 0
coordinating:
replicaCount: 0
ingest:
replicaCount: 0
# [END gke_databases_data_cache_03_elasticsearch_cluster]

43 changes: 43 additions & 0 deletions databases/data-cache/manifests/04-mysql/benchmarkpod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v1
kind: Pod
metadata:
name: sysbench
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: NotIn
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
containers:
- name: main
image: perconalab/sysbench
command: ["sleep", "720000"]
resources:
requests:
memory: 2Gi
cpu: "1"
limits:
memory: 2Gi
cpu: "2"
env:
- name: LUA_PATH
value: /sysbench/sysbench-tpcc/?.lua
- name: MYSQL_ROOT_PASSWORD
value: benchmark
resources:
requests:
cpu: 1000m
memory: 1Gi
limits:
cpu: 1000m
memory: 1Gi
57 changes: 57 additions & 0 deletions databases/data-cache/manifests/04-mysql/mysql-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gke_databases_data_cache_mysql_client]
apiVersion: v1
kind: Pod
metadata:
name: mysql-client
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: NotIn
values:
- "data-cache"
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "data-cache"
effect: NoSchedule
containers:
- name: main
image: mysql:8.4.3
command: ["sleep", "360000"]
resources:
requests:
memory: 2Gi
cpu: "1"
limits:
memory: 2Gi
cpu: "2"
env:
- name: MYSQL_ROOT_PASSWORD
value: benchmark
resources:
requests:
cpu: 1000m
memory: 1Gi
limits:
cpu: 1000m
memory: 1Gi
# [END gke_databases_data_cache_mysql_client]
Loading