|
| 1 | +# S3 over RDMA (EXPERIMENTAL) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +S3 over RDMA is a new technology that enhances I/O performance directly to the applications memory, or directly to GPU memory! RDMA is extremely efficient, it bypasses the operating system, TCP stack, and much of the networking CPU overhead. Layering S3 on top of RDMA fits like a glove for modern applications. And the same endpoints can serve both RDMA and non-RDMA clients with a simple HTTP header. |
| 6 | + |
| 7 | +This feature is still EXPERIMENTAL and is not yet available for production use. This document outlines the usage and design of this feature. |
| 8 | + |
| 9 | +## What is needed to use S3 over RDMA? |
| 10 | + |
| 11 | +Hardware: |
| 12 | +- High performance RDMA network 100G/.../800G |
| 13 | +- Infiniband or RoCE (must support DC transport) |
| 14 | +- Compute Nodes with optional GPU devices and NVIDIA CUDA toolkit |
| 15 | +- Storage Nodes with NVMe drives, can be same as compute nodes |
| 16 | + |
| 17 | +Software: |
| 18 | +- RHEL / UBUNTU |
| 19 | +- High performance file system (GPFS, Lustre, etc.) |
| 20 | +- NooBaa RPM / build from source with RDMA support. |
| 21 | +- NVIDIA's cuObject (beta) and cuFile RDMA libraries. |
| 22 | + |
| 23 | + |
| 24 | +## Which applications can benefit from S3 over RDMA? |
| 25 | + |
| 26 | +- boto3 - S3 sdk for python applications |
| 27 | +- s3-connector-for-pytorch - library for AI/ML applications (data loaders, checkpoints, etc.) |
| 28 | +- rclone - a standalone CLI that can copy data between files/dirs and S3 |
| 29 | +- nodejs - using aws-sdk-js-v3 to store data collected from web services |
| 30 | +- (share with us your use case and we will add to the list...) |
| 31 | + |
| 32 | +## Lets dig right in |
| 33 | + |
| 34 | +- Clone the noobaa-core repository |
| 35 | +- Install the required dependencies (nodejs, nasm, etc. - see the noobaa-core README) |
| 36 | +- Standard build - simple `make` should succeed. |
| 37 | + |
| 38 | +Build the project with RDMA support: |
| 39 | + |
| 40 | +```bash |
| 41 | +$ make RDMA=1 |
| 42 | +``` |
| 43 | + |
| 44 | +or with RDMA and CUDA support: |
| 45 | + |
| 46 | +```bash |
| 47 | +$ make RDMA=1 CUDA=1 |
| 48 | +``` |
| 49 | + |
| 50 | +Define the following runtime variables: |
| 51 | + |
| 52 | +```bash |
| 53 | +CUDA_PATH="$(realpath /usr/local/cuda)" |
| 54 | +CUOBJ_PATH="$(realpath ../cuObject-0.7.2-Linux_x86_64/src)" |
| 55 | +CUFILE_ENV_PATH_JSON="$(realpath ../cuobj.json)" |
| 56 | +RDMA_LIBS="$CUOBJ_PATH/lib/libcuobjserver.so $CUOBJ_PATH/lib/libcuobjclient.so $CUOBJ_PATH/lib/libcufile.so.1.13.0 $CUOBJ_PATH/lib/libcufile_rdma.so.1.13.0" |
| 57 | +``` |
| 58 | + |
| 59 | +**NOTE**: If compilation fails to find cuda_runtime.h use: `touch $CUOBJ_PATH/include/cuda_runtime.h` |
| 60 | + |
| 61 | +Create the configuration directory as described in [this doc](https://github.com/noobaa/noobaa-core/blob/master/docs/NooBaaNonContainerized/GettingStarted.md#configuration) (no need to build and install RPM because we build from source), and finally start the noobaa server with RDMA support: |
| 62 | + |
| 63 | +```bash |
| 64 | +$ LD_PRELOAD=$RDMA_LIBS node src/cmd/nsfs |
| 65 | +``` |
| 66 | + |
| 67 | +## Getting Started |
| 68 | + |
| 69 | +First we use the s3perf tool in the noobaa repo to test the RDMA performance. Here is a basic example that reads the same 8MB file 10 continuously and reports the speed: |
| 70 | + |
| 71 | +```bash |
| 72 | +$ LD_PRELOAD="$RDMA_LIBS" \ |
| 73 | + CUFILE_ENV_PATH_JSON="$CUFILE_ENV_PATH_JSON" \ |
| 74 | + UV_THREADPOOL_SIZE=16 \ |
| 75 | + DISABLE_INIT_RANDOM_SEED=true \ |
| 76 | + node src/tools/s3perf.js \ |
| 77 | + --endpoint http://172.16.0.61:6001 \ |
| 78 | + --access_key "AK" --secret_key "SK" \ |
| 79 | + --bucket bucket1 --get file8M --samekey \ |
| 80 | + --time 120 --size_units MB --size 8 --concur 8 --forks 6 --rdma |
| 81 | +``` |
| 82 | + |
| 83 | +Will output something like: |
| 84 | + |
| 85 | +```sh |
| 86 | +Feb-20 5:50:05.386 [/3039076] [LOG] CONSOLE:: S3: 11240.0 MB/sec (average 9650.2) | OPS: 1405 min:20.7ms max:50.8ms avg:34.2ms |
| 87 | +Feb-20 5:50:06.386 [/3039076] [LOG] CONSOLE:: S3: 11216.0 MB/sec (average 9685.5) | OPS: 1402 min:20.3ms max:54.2ms avg:34.3ms |
| 88 | +Feb-20 5:50:07.386 [/3039076] [LOG] CONSOLE:: S3: 11040.0 MB/sec (average 9715.4) | OPS: 1380 min:17.1ms max:55.8ms avg:34.7ms |
| 89 | +Feb-20 5:50:08.387 [/3039076] [LOG] CONSOLE:: S3: 11024.0 MB/sec (average 9743.7) | OPS: 1378 min:17.4ms max:58.3ms avg:34.9ms |
| 90 | +``` |
| 91 | + |
| 92 | +Remove the --rdma flag to compare the performance with and without RDMA. |
| 93 | + |
| 94 | +```bash |
| 95 | +Feb-20 5:53:16.867 [/3040865] [LOG] CONSOLE:: S3: 3931.9 MB/sec (average 3785.4) | OPS: 495 min:53.1ms max:169.3ms avg:98.0ms |
| 96 | +Feb-20 5:53:17.869 [/3040865] [LOG] CONSOLE:: S3: 3918.4 MB/sec (average 3788.3) | OPS: 490 min:58.0ms max:161.3ms avg:98.0ms |
| 97 | +Feb-20 5:53:18.869 [/3040865] [LOG] CONSOLE:: S3: 3978.2 MB/sec (average 3792.3) | OPS: 497 min:50.9ms max:157.1ms avg:97.2ms |
| 98 | +Feb-20 5:53:19.871 [/3040865] [LOG] CONSOLE:: S3: 3949.0 MB/sec (average 3795.5) | OPS: 489 min:52.5ms max:159.1ms avg:96.6ms |
| 99 | +``` |
| 100 | + |
| 101 | +The --cuda flag tests the performance using the GPU memory. It can be used with or without the --rdma flag. Currently this is failing. Stay tuned. |
| 102 | + |
| 103 | +```bash |
| 104 | + |
| 105 | +## Next steps |
| 106 | + |
| 107 | +- Integrate S3 over RDMA to python applications |
| 108 | +- Support multiple Server IP's |
| 109 | +- Optimization for GPFS |
0 commit comments