Skip to content
Permalink
Browse files

Add example for lusture max cached size tuning

  • Loading branch information
leakingtapan committed Oct 21, 2019
1 parent 7443ce9 commit 23c3f134a84129c3659a485e83a42ccc73b5fb9d
@@ -0,0 +1,35 @@
## Tuning Lustre Max Memory Cache
This example shows how to set lustre `llite.*.max_cached_mb` using init container. Lustre client interacts with lustre kernal module for data caching at host level. Since the cache resides in kernal space, it won't be counted toward application container's memory limit. Sometimes it is desireable to reduce the lustre cache size to limit memory consumption at host level.

### Edit [Pod](./specs/pod.yaml)
```
apiVersion: v1
kind: Pod
metadata:
name: fsx-app
spec:
initContainers:
- name: set-lustre-cache
image: amazon/aws-fsx-csi-driver:latest
securityContext:
privileged: true
command: ["/sbin/lctl"]
args: ["set_param", "llite.*.max_cached_mb=32"]
containers:
- name: app
image: amazonlinux:2
command: ["/bin/sh"]
args: ["-c", "sleep 999999"]
volumeMounts:
- name: persistent-storage
mountPath: /data
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: fsx-claim
```
The `fsx-app` pod has an init container that sets `llite.*.max_cached_mb` using `lctl`.

## Notes
* The aws-fsx-csi-driver image is reused in the init container for the `lctl` command. You could chose your own container image for this purpose as long as the lustre client user space tools `lctl` is available inside the image.
* The init container needs to be privileged as required by `lctl`
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fsx-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: fsx-sc
resources:
requests:
storage: 1200Gi
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Pod
metadata:
name: fsx-app
spec:
initContainers:
- name: set-lustre-cache
image: amazon/aws-fsx-csi-driver:latest
securityContext:
privileged: true
command: ["/sbin/lctl"]
args: ["set_param", "llite.*.max_cached_mb=32"]
containers:
- name: app
image: amazonlinux:2
command: ["/bin/sh"]
args: ["-c", "sleep 999999"]
volumeMounts:
- name: persistent-storage
mountPath: /data
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: fsx-claim
@@ -0,0 +1,10 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fsx-sc
provisioner: fsx.csi.aws.com
parameters:
subnetId: subnet-0d7b5e117ad7b4961
securityGroupIds: sg-05a37bfe01467059a
mountOptions:
- flock

0 comments on commit 23c3f13

Please sign in to comment.
You can’t perform that action at this time.