# obs-tutorial **Repository Path**: yzj2001/obs-tutorial ## Basic Information - **Project Name**: obs-tutorial - **Description**: No description available - **Primary Language**: Unknown - **License**: CC-BY-SA-4.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2022-03-24 - **Last Updated**: 2022-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Introduction Object Storage Tutorial. ## Basic Concept SNIA Tutorials on Object Storage: * [Object Storage 101](http://www.snia.org/sites/default/files/Object_Storage_101.pdf) * [Object Storage 201](https://www.snia.org/sites/default/files/Object_Storage_201_Final_1.pdf) * [Object Storage Technology](http://www.snia.org/sites/default/education/tutorials/2013/spring/file/BrentWelch_Object_Storage_Technology.pdf). The **Storage Networking Industry Association** ([SNIA](https://www.snia.org/)) is a not–for–profit global organization, made up of member companies spanning the global storage market. ## Lab1: Preparation ### Environment #### Git and Repository Git tutorial . Alternatives: [bitbucket](https://bitbucket.org/), [gitlab](https://about.gitlab.com/), [gitee](https://gitee.com/). #### How to establish Python Environment * Python Distributions: * Option 1: [Anaconda](https://www.anaconda.com/) * Option 2: [WinPython](http://winpython.github.io/) * Fast deployment by docker: * Option 3: Python Docker , E.g.: * `docker pull zhan2016/python-lab:3.6.0` * `docker login daocloud.io && docker pull daocloud.io/zhan2016/python-lab:master-31a932d` #### How to establish Java Environment **Ongoing course**: Java Programming, [2019-2020 2nd semester](http://jwc.hust.edu.cn/info/1161/7796.htm), just follow your teacher's guide. Installation helper scripts (_**For adventurers**_). #### How to establish Rust Environment * Installing Rust: * Learning Rust: #### How to use Linux in Windows or MacOS (_**Optional**_) **Goal**: try mock-s3 and s3proxy with less trouble **Method**: Virtual Machine: Virtualbox, VMWare ... Go directly to GUI, or using vagrant,refer to . #### How to run servers within docker container (_**Optional**_) **Goal**: try Openstack Swift or Ceph with less trouble Better run within docker, refer to Docker tutorial . * [Ceph docker images](https://hub.docker.com/r/ceph/ceph) * [Openstack Swift all-in-one docker image](https://hub.docker.com/r/fnndsc/docker-swift-onlyone) ### Object Storage Server * Object Storage for Beginners: * Option 1: [Minio](https://minio.io/), latest version . * Experimental Mock Servers: * Option 2: [mock-s3](https://github.com/ShiZhan/mock-s3), a Python clone of fake-s3, Amazon S3 mimic. * Option 2.1: Original version **Requires Python 2.7** . * Option 3: [s3proxy](https://github.com/gaul/s3proxy), access other storage via the S3 API. **Binary bundles [here](https://github.com/gaul/s3proxy/releases)** * Option 3.1: Use Java/Maven to build `mvn package -Dmaven.test.skip=true`. * Option 4: [fake-s3](https://github.com/jubos/fake-s3), a lightweight server clone of Amazon S3. **Depends on Ruby**, the Origin project. * Option 5: [s3mock](https://github.com/findify/s3mock), S3 mock library for Java/Scala. **Java/SBT Building is required**. * Option 6: [S3Mock](https://github.com/adobe/S3Mock), S3 mock as Docker image or JUnit rule. **Use Java/Maven to build, use docker to run**, contributed by Adobe (c). * Industry Level Projects: * Option 7: [Openstack Swift](https://wiki.openstack.org/wiki/Swift), fast deployment by All-in-one container: . * Option 8: [Ceph](https://ceph.com/), docker files and images to run Ceph in containers: . Besides _Option 1_, _Option 2, 3_ offer compile-free executable. ### Object Storage Client * Standalone Utilities: * Option 1: **Minio Client** * **Installation**: download and run * Option 2: **s3cmd** * **Installation**: run `pip install s3cmd` in python environment * Configure for Minio * Option 3: **aws-shell** * **Installation**: run `pip install aws-shell` in python environment * Configure for Minio * Official Manual * Option 4: **osm** * **Installation**: `go get -u github.com/appscode/osm` * [Windows binary](https://share.weiyun.com/jPYFmvmw) * APIs: * Option 4: **aws-sdk-java** * Option 5: **boto** * Option 6: **aws-sdk-rust** Binary available for *Option 1*, *Option 2 & 3* require Python, *Option 4* require Go, *Option 6* require Rust. ### Basic Functionality In computer programming, [create, read, update, and delete (as an acronym CRUD)](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) are the four basic functions of persistent storage. | Operation | SQL | HTTP | | :--------------: | :----: | :----------------: | | Create | INSERT | PUT / POST | | Read (Retrieve) | SELECT | GET | | Update (Modify) | UPDATE | PUT / POST / PATCH | | Delete (Destroy) | DELETE | DELETE | Try object storage in some applications: [zfile](https://github.com/zhaojun1998/zfile). ## Lab2: Performance Evaluation ### Object Storage Benchmark * Option 1: **S3 Bench** * **Installation** ```bash go get -u github.com/igneous-systems/s3bench ``` * Linux: default location for built binary is `~/go/bin/s3bench` * [Prebuilt Windows binary](https://share.weiyun.com/BICMfA4G), download and put into this directory. * Command line example ```bash s3bench \ -accessKey=hust -accessSecret=hust_obs \ -endpoint=http://127.0.0.1:9000 \ -bucket=loadgen -objectNamePrefix=loadgen \ -numClients=10 -numSamples=100 -objectSize=1024 ``` * [Script example](./run-s3bench.sh) * Customize before using this script, for a broader coverage. * [Windows version](./run-s3bench.cmd) * Option 2: **s3-benchmark** * **Installation** The original version contains broken dependency, lacks minio support, use one of its fixed fork instead ```bash go get -u github.com/chinglinwen/s3-benchmark ``` * Command line example ```bash s3-benchmark \ -a hust -s hust_obs -u http://127.0.0.1:9000 -b wasabi-benchmark \ -d 3 -t 1 -z 1K Wasabi benchmark program v2.0 Parameters: url=http://127.0.0.1:9000, bucket=wasabi-benchmark, region=us-east-1, duration=3, threads=1, loops=1, size=1K Loop 1: PUT time 3.0 secs, objects = 191, speed = 63.5KB/sec, 63.5 operations/sec. Slowdowns = 0 Loop 1: GET time 0.4 secs, objects = 191, speed = 449.9KB/sec, 449.9 operations/sec. Slowdowns = 0 Loop 1: DELETE time 0.5 secs, 367.2 deletes/sec. Slowdowns = 0 result title: name-concurrency-size, uloadspeed, downloadspeed result csv: 127-1-1K,0.06,0.44 ``` * Option 3: **COSBench** * User Guide . * Example workload . * Other examples . * Literatures * COSBench: cloud object storage benchmark * COSBench: A Benchmark Tool for Cloud Object Storage Services * COSBench: A benchmark tool for Cloud Storage * Option 4: **s3-bench-rs** or . * User Guide: * Examples: ### Observation **Metrics**: *Throughput*, *Latency* under different *object size*, *concurrency*, *server total*. **Suggested topics**: * How object size affects performance? * for a particular application, is there a best way to fit into OBS? * The main factors behind I/O latency? * Get latency distribution first. * For evaluating percentile latency, s3bench is recommended. * What will happen when clients are crowded? * How concurrency affects latency distribution and throughput? How to enforce SLA by controlling? * The outcome of scaling out (putting more servers into system)? More insights are encouraged. ### Further thoughts * How to do these experiments on your own codes * besides COSBench, s3bench, use aws-sdk or boto3 instead. * Using Python as Lab Platform * Jupyter Notebook Tutorial ## Lab3: Tail Latency Challenge ### How to handle? * Hedged request * Tied request ### How to predict? * queueing Theory * Sequence prediction ## Experiences and Problems * [Known issues](known-issues.md). * Contribute your experiences in . * Report more problems in . ## Future Readings * Recent SNIA blog posts on Object Storage . * Enterprise level [Object Store comparison](http://gaul.org/object-store-comparison/). * Build your own object storage system with Golang . * Delimitrou C, Kozyrakis C. Amdahl’s Law for Tail Latency[J]. Commun. ACM, 2018, 61(8): 65–72. * Dean J, Barroso L A. The Tail at Scale[J]. Commun. ACM, 2013, 56(2): 74–80. [Zhan.Shi](https://shizhan.github.io/) @ 2017, 2018, 2019, 2020, 2021