NJSD eBPF 技术文档 - 0924版本
Curve⽂件系统性能 ⽹易数帆科技 向东提纲 • 什么是Curve • Curve的应⽤场景及挑战 • Curve客户端⾯临问题及分析 • 什么是ebpf • 基于epbf的Curve Cache设计 • Curve社区介绍Curve是什么? • Curve云原⽣软件定义存储 • Curve分布式块存储 • Curve分布式⽂件存储 • ⾼性能、易运维、云原⽣Curve⽂件系统框架和主要应⽤场景 Daemon⼤概10us以内 • 瓶颈在/dev/fuse通讯开销基于FUSE可能的优化点 • 降低内核与libfuse通讯延迟 • 基于⽂件属性的操作内核直接返回? • 基于⽂件数据的操作先内核读写 cache?实现POSIX兼容API途径及问题 • 基于FUSE的实现 • curve / ceph / gluster • LD_PRELOAD重载⽂件系统系统调⽤ • vpp / f-stack 进程共享内存通信延迟10us+ • others 开销 10us+ • fuse_ll_ops开销10us-基于FUSE的优化框架 • 框架优化的要点 • 共享inode cache • 共享data cache的映射 • GETATTR流程 • ⽂件读取流程 • 相关⼯作 • extFUSE • google android12 passthrough什么是eBPF0 码力 | 20 页 | 7.40 MB | 5 月前3CurveFS Client 概要设计
readdir getattr & setattr access rename symlink & readlink link flush & fsync 其他 功能分析 模块划分 接口设计 Cache设计 时间 作者 内容 2021-04-27 许超杰 初稿 背景 CurveFS初步设计见 , 目前需细化Client端设计 Cur size]位置的空间是否有分配:如果未分配或只有部分分配空间,则调用空间分配器分配空间,并根据空间分配器返回结果,修改inode结构(包括file length); inode修改需要持久化到底层并修改本地cache; 调用curve client接口,写curve卷对应[offset,len] 数据。 (这里涉及到一个问题,是否从fuse下来的请求是4k对齐的,如果不是,那么这里还需要修改为read merge len] 调用curve client写); 修改inode结构,如果上述区域存在先前未写过的区域,则需要去掉unwritten,具体方式根据inode结构而定;inode修改需要持久化到底层并修改本地cache;© XXX Page 6 of 11 read void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct0 码力 | 11 页 | 487.92 KB | 5 月前3Curve支持S3 数据缓存方案
XXX Page 3 of 9 1.append接口目前采用先从s3 get,在内存中合并完后再put的方式,对s3操作过多 2.对于4k 小io每次都要和s3交互,导致性能非常差。 因此需要通过Cache模块解决以上2个问题。 整体设计 整个dataCache的设计思路,在写场景下能将数据尽可能的合并后flush到s3上,在读场景上,能够预读1个block大小,减少顺序读对于底层s3的访问频次。 ient直接修改inode的len,由metaserver的碎片整 理(马杰负责)模块进行truncate的无效数据清理 后台刷数据线程© XXX Page 4 of 9 启动后台线程,将写Cache定时刷到S3上,同时通过inodeManager更新inode缓存中的s3InfoList。具体细节见 本地磁盘缓存 如果有配置writeBack dev,则会调用diskStroage进行本 ,获取返回数据填充readBuf。 ReleaseCache流程 1.由于删除采用异步的方式,所以对于delete操作仅仅需要释放client的cache缓存。这里同时要保证的一点是:上层确保该文件没有被打开,才能调用该接口,因此不用考虑cache被删除的同时又有人来增加或修 改 2.根据inodeId找到对应FileCacheManager ,调用ReleaseCache接口,一层一层将缓存释放。0 码力 | 9 页 | 179.72 KB | 5 月前3CurveFS S3本地缓存盘方案
whether the obj is cached in local cache disk. */ bool IsCached(std::string name); void addCache(std::string name); /** * @brief tell whether the cache disk is full or not. */ bool IsDiskCacheFull(); bool IsDiskCacheSafe(); /**© XXX Page 5 of 9 * @brief trim cache func. */ void TrimCache(); /** * @brief: start trim thread. */ void TrimRun(); const char* buf, uint64_t length);© XXX Page 6 of 9 /** * @brief Create Disk Write Cache Dir. */ int CreateDir(const std::string cacheDir); bool IsDirExist(const std::string dir);0 码力 | 9 页 | 150.46 KB | 5 月前3Open Flags 调研
stateless file I/O and not store anything in fi->fh. There are also some flags (direct_io, keep_cache) which the filesystem may set in fi, to change the way the file is opened. See fuse_file_info structure /** In case of a write operation indicates if this was caused by a delayed write from the page cache. If so, then the context's pid, uid, and gid fields will not be valid, and the *fh* value other contexts (in particular it does nothing when set by opendir()). */ unsigned int keep_cache : 1; /** Indicates a flush operation. Set in flush operation, also maybe set in highlevel0 码力 | 23 页 | 524.47 KB | 5 月前3TGT服务器的优化
COMMAND,提高性能 • 已经修改TGT,让驱动可以声明自己是否支持DPO & FUA • 由于增加的Curve 驱动没有本地cache,所以DPO & FUA可以turn on. • sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA • 这个对于curve驱动,Linux0 码力 | 15 页 | 637.11 KB | 5 月前3Bazel
clang 编译 CC=clang CXX=clang++ bazel build …2 制作镜像 docker run -v $(pwd):/curve -v /root/.cache/bazel:/root/.cache/bazel -it opencurvedocker/curve-base:build-debian11 # 容器内 cd /curve/curvefs make build0 码力 | 6 页 | 4.69 MB | 5 月前3BRPC与UCX集成指南
用UCX实现BRPC对RDMA的支持 徐逸锋2 BRPC简介 ●BRPC是Curve的基础通讯框架 ●支持远程过程调用 –C++ –TCP传输 –bthread协程(m:n调度,减少基于内核的下文切换 ,减少cache miss) ●多协议支持 –baidu_std,http,grpc… ●protobuf3 BRPC简介 ●Client/Server架构 ●使用Protobuf定义协议文件 –例如: ●有性能测试工具 ●比较详细的文档2223 UCS ●是一些工具代码,例如 –链表 –hash table –epoll event loop – memory register cache –config file24 UCT ●特点是比较原始,开销小,但是没有很强的功能 ●是网络接口层,主要功能是网卡发现和远程内存传输支持,提供component查询和 memory domain的打开0 码力 | 66 页 | 16.29 MB | 5 月前3CurveFs 用户权限系统调研
instead of using a busy-loop). */ unsigned congestion_threshold; /** * When FUSE_CAP_WRITEBACK_CACHE is enabled, the kernel is responsible * for updating mtime and ctime when write requests are received used * by kernel and filesystem will differ (and result in an apparent * change of times after a cache flush). * * To prevent this problem, this variable can be used to inform the * kernel about0 码力 | 33 页 | 732.13 KB | 5 月前3Curve文件系统元数据Proto(接口定义)
specific language governing permissions and * limitations under the License. */ syntax="proto2"; package curvefs.mds; option cc_generic_services = true; enum FSStatusCode { OK = 0; // specific language governing permissions and * limitations under the License. */ syntax="proto2"; package curvefs.metaserver; option cc_generic_services = true; enum MetaStatusCode { OK = 0; specific language governing permissions and * limitations under the License. */ syntax="proto2"; package curvefs.space; option cc_generic_services = true; enum SpaceStatusCode { OK = 0;0 码力 | 15 页 | 80.33 KB | 5 月前3
共 16 条
- 1
- 2