{"id":16408826,"url":"https://github.com/sysnet4admin/kdbench","last_synced_at":"2025-10-26T17:32:17.154Z","repository":{"id":41557179,"uuid":"475709089","full_name":"sysnet4admin/kDbench","owner":"sysnet4admin","description":"Kubernetes Storage Benchmark thru fio: IOPS, Bandwidth MB/s and Latency","archived":false,"fork":false,"pushed_at":"2022-07-04T05:07:06.000Z","size":8079,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T22:06:21.134Z","etag":null,"topics":["bandwidth","benchmark","fio","iops","kubernetes","latency","storage"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysnet4admin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-30T03:45:48.000Z","updated_at":"2024-11-29T03:43:03.000Z","dependencies_parsed_at":"2022-08-10T02:50:26.033Z","dependency_job_id":null,"html_url":"https://github.com/sysnet4admin/kDbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnet4admin%2FkDbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnet4admin%2FkDbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnet4admin%2FkDbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnet4admin%2FkDbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysnet4admin","download_url":"https://codeload.github.com/sysnet4admin/kDbench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238375324,"owners_count":19461583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bandwidth","benchmark","fio","iops","kubernetes","latency","storage"],"created_at":"2024-10-11T06:18:00.471Z","updated_at":"2025-10-26T17:32:11.655Z","avatar_url":"https://github.com/sysnet4admin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `kDbench`: Kubernetes Stroage Performance Test\n[![version](https://img.shields.io/badge/version-1.0.0-yellow.svg)](https://semver.org)\n![Proudly written in Bash](https://img.shields.io/badge/written%20in-bash-ff69b4.svg)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\u003c/br\u003edbench source image from [leeliu/dbench](https://github.com/leeliu/dbench)\n\n## **`kDbench`** DEMO \n![kdbench-demo GIF](img/kdbench-demo.gif)\n\n-----\n## Requirement \nk8s's API \u003e= `1.21.x` or feature gate `ttlSecondsAfterFinished` is enable\n```bash\n[root@m-k8s ~]# kubectl get nodes\nNAME     STATUS   ROLES                  AGE   VERSION\nm-k8s    Ready    control-plane,master   54d   v1.23.1\nw1-k8s   Ready    \u003cnone\u003e                 54d   v1.23.1\nw2-k8s   Ready    \u003cnone\u003e                 54d   v1.23.1\nw3-k8s   Ready    \u003cnone\u003e                 54d   v1.23.1\n```\nLess than kubernetes version in `1.21.x`, it won't be work properly due to the `ttlSecondsAfterFinished` feature cannot enable as a default on Managed k8s(eks,aks,gke)\u003c/br\u003e\nThus in case of self-hostsed or others should turn on `ttlSecondsAfterFinished` \n\n## Purpose \nSimple and automatically benchmark for your k8s storageclasses.\u003c/br\u003e \n(i.e. for lazy engineer who like me) \n\n-----\n## Usage\nHighly recommanedation to install [`fzf`](https://github.com/junegunn/fzf) before you run. \u003c/br\u003e\n[`fzf`](https://github.com/junegunn/fzf) could support **interactively** select a storageclass.\n\n```bash \n  kdbench                           : Select storageclass with fzf\n  kdbench \u003cSTORAGECLASS NAME\u003e       : Select storageclass manually (w/o fzf)\n  kdbench -q, --quick               : Quick run mode        (w/ fzf)\n  kdbench -d, --direct              : Direct fio write mode (w/ fzf)\n  kdbench -a  \u003crwo,rox,rwx,rwop\u003e    : Set access mode       (w/ fzf)\n  kdbench -s  \u003cstorage size\u003e        : Set stroage size      (w/ fzf)\n  kdbench -f  \u003cYAML FILE\u003e           : Run as a file         (w/ fzf)\n  kdbench reset                     : Reset all of resources\n  kdbench -h, --help                : Show this message\n```\n\n### Interactive mode \n```bash\n$ kdbench \n# select one of them \nefs-sc \ngp2\n\n# run automatically \npersistentvolumeclaim/kdbench-pv-claim created\njob.batch/kdbench created\nWaiting for kdbench's load....Working dir: /ON-efs-sc\n\nTesting Read IOPS...\nread_iops: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64\nfio-3.29-148-ge3de2\nStarting 1 process\nread_iops: Laying out IO file (1 file / 2048MiB)\n\u003csnipped\u003e\nAll tests complete for [efs-sc]\n\n=============================\n= Kubernetes Dbench Summary =\n=============================\nRandom Read/Write IOPS............................ [24.4k / 7330]\nBandwidth Read/Write.............................. [300MiB/s / 100MiB/s]\nAverage Latency Read(usec)/Write(usec)............ [2542.07 / 7907.11]\nSequential Read/Write............................. [301MiB/s / 102MiB/s]\nMixed Random Read/Write IOPS...................... [7121 / 2391]\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nWaiting for job finished by ttlSecondsAfterFinished...\n\n# delete automatically\nkdbench finsihed and pvc will delete\npersistentvolumeclaim \"kdbench-pv-claim\" deleted\n```\n\n### Manual mode \n```bash\n$ kdbench \u003cstorageclass name\u003e\n\u003csnipped\u003e\nAll tests complete for [standard-rwx]\n\n=============================\n= Kubernetes Dbench Summary =\n=============================\nRandom Read/Write IOPS............................ [53.3k / 1572]\nBandwidth Read/Write.............................. [942MiB/s / 126MiB/s]\nAverage Latency Read(usec)/Write(usec)............ [264.60 / 2812.10]\nSequential Read/Write............................. [1228MiB/s / 128MiB/s]\nMixed Random Read/Write IOPS...................... [4674 / 1575]\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nWaiting for job finished by ttlSecondsAfterFinished...\n\n# delete automatically \nkdbench finsihed and pvc will delete\npersistentvolumeclaim \"kdbench-pv-claim\" deleted\n```\n\n### Other options \n\n#### Quick mode \nWhen you choose quick-mode, Only IOPS and Bandwidth will be tested \n```bash\n$ kdbench -q \n```\n_OR_\n```bash\n$ kdbench --quick \n```\n\n#### Direct fio write \nIf value is true, use non-buffered I/O. This is usually O_DIRECT. Note that OpenBSD and ZFS on Solaris don’t support direct I/O. On Windows the synchronous ioengines don’t support direct I/O. Default: false.\nhttps://fio.readthedocs.io/en/latest/fio_doc.html\n```bash\n$ kdbench -d \n```\n_OR_\n```bash\n$ kdbench --direct \n```\n\n#### Set access-mode \nThe [access modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) is changable. \n```\n- RWO  | rwo   (ReadWriteOnce) \u003c\u003c\u003c\u003c\u003c **default** \n- ROX  | rox   (ReadOnlyMany)              \n- RWX  | rwx   (ReadWriteMany)             \n- RWOP | rwop  (ReadWriteOncePod)          \n```\n\n#### Set storage size  \nSize is matter somtimes. \nFor instance GKE's [filestore](https://cloud.google.com/filestore/docs/limits) \n```bash\n$ kdbench -s \u003cstorage size\u003e \n```\n#### Run as a file   \nIf you want to run various options. you could change whatever you want.\nHere is `kdbench-sample.yaml` in working directory.\nFree to change but you should input storageclass manually.\n\n```bash\n$ kdbench -f \u003cYAML FILE\u003e\n\n```\n`kdbench-sample.yaml`\n```yaml \nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n  name: kdbench-pv-claim\n  labels:\n    fio: kdbench\nspec:\n  storageClassName: \u003c\u003c INPUT STORAGECLASS \u003e\u003e # Must change in here \n  # storageClassName: managed-nfs-storage \n  # storageClassName: gp2 \n  # storageClassName: default \n  # storageClassName: standard \n  # storageClassName: nks-block-storage\n  accessModes:\n    - ReadWriteOnce   # (optional) RWO - ReadWriteOnce, ROX - ReadOnlyMany, RWX - ReadWriteMany, RWOP - ReadWriteOncePod\n  resources:\n    requests:\n      storage: 100Gi  # (optional) filestore standard - 1000Gi, filestore premium - 2560Gi \n---\n\u003csnipped\u003e\n```\n\n#### From fio file \n`[TBD]` by ConfigMap \n\n#### Reset  \nWhen abnormal behavior has been occurred, please run `reset` and then rerun kdbench command.  \n```bash\n$ kdbench reset\n```\n-----\n## Install kDbench \n\n### Using git\n```bash \ngit clone --depth 1 https://github.com/sysnet4admin/kdbench.git  ~/.kdbench\n~/.kdbench/install\n```\n\n-----\n## Uninstall kDbench \n\n```bash\n~/.kdbench/uninstall\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysnet4admin%2Fkdbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysnet4admin%2Fkdbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysnet4admin%2Fkdbench/lists"}