Giter Site home page Giter Site logo

whalefs's Introduction

whalefs

目标: PB级分布式文件存储,优化海量小文件存储. volume存储原理基于facebook haystack

##特性

  • 高并发,低延迟
  • 存储节点没有单点错误(冗余)
  • 维护简单,代码量少

##安装

$ go get -u github.com/030io/whalefs

##帮助

$ whalefs --help-long

##运行

####master

# master需要使用redis存储元数据
$ whalefs master --redisIP localhost --redisPort 6379 --redisPW password --redisN databaseNum
# 冗余: --replication abc
# a: 相同machine的备份数
# b: 相同datacenter但不同machine的备份数
# c: 不同datacenter且不同machine的备份数

####volume manager(存储节点)

$ whalefs manager --dir volume_dir
# 以下两个选项跟冗余有关
# --machine 默认为volume manager跟master通信的ip
# --dataCenter 默认为空

####benchmark

$ whalefs benchmark

##API

  • 上传: curl -F [email protected] http://localhost:8888/dir/dst.jpg
  • 删除: curl -X DELETE http://localhost:8888/dir/dst.jpg
  • 获取: wget http://localhost:8888/dir/dst.jpg

##性能测试:

# mac i7 ssd 单个volume manager节点
upload 10000 1024byte file:

concurrent:             16
time taken:             6.81 seconds
completed:              10000
failed:                 0
transferred:            10240000 byte
request per second:     1467.62
transferred per second: 1502843.99 b/s


read 10000 1024byte file:

concurrent:             16
time taken:             0.62 seconds
completed:              10000
failed:                 0
transferred:            10240000 byte
request per second:     16185.35
transferred per second: 16573796.70 b/s

# vps 单核 机械硬盘 单个volume manager节点
upload 800000 1024byte file:

concurrent:             64
time taken:             2415.91 seconds
completed:              800000
failed:                 0
transferred:            819200000 byte
request per second:     331.14
transferred per second: 339085.81 b/s


read 800000 1024byte file:

concurrent:             64
time taken:             242.18 seconds
completed:              800000
failed:                 0
transferred:            819200000 byte
request per second:     3303.31
transferred per second: 3382590.28 b/s

##注意:

  • --replication 冗余需要在搭建时就确定好,在运行过程中更改master的冗余选项,volume有可能变成只读,需要手动平衡(复制/删除)volume
  • volume manager节点的 machine dataCenter 同上

whalefs's People

Contributors

030io avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.