首页 > 其他分享 >ZenFS tutorial

ZenFS tutorial

时间:2022-10-04 16:22:20浏览次数:43  
标签:sudo ZenFS dev echo zenfs nr local tutorial

ZenFS

git clone https://github.com/facebook/rocksdb.git
cd rocksdb
git clone https://github.com/westerndigitalcorporation/zenfs plugin/zenfs
sudo DEBUG_LEVEL=0 ROCKSDB_PLUGINS=zenfs make db_bench install//如果报错的话把libgflags删掉(sudo apt remove libgflags-dev)试试
cd plugin/zenfs/util
make
//报错的话把gflags改为google

0. create device

#!/bin/bash

if [ $# != 7 ]; then
        echo "Usage: $0 <sect size (B)> <zone size (MB)> <zone capacity (MB)> <max open zones> <max active zones> <nr conv zones> <nr seq zones>"
        exit 1
fi

scriptdir=$(cd $(dirname "$0") && pwd)

modprobe null_blk nr_devices=0 || return $?

function create_zoned_nullb()
{
        local nid=0
        local bs=$1
        local zs=$2
	local zc=$3
	local max_open_zones=$4
	local max_active_zones=$5
        local nr_conv=$6
        local nr_seq=$7

        cap=$(( zs * (nr_conv + nr_seq) ))

        while [ 1 ]; do
                if [ ! -b "/dev/nullb$nid" ]; then
                        break
                fi
                nid=$(( nid + 1 ))
        done

        dev="/sys/kernel/config/nullb/nullb$nid"
        mkdir "$dev"

        echo $bs > "$dev"/blocksize
        echo 0 > "$dev"/completion_nsec
        echo 0 > "$dev"/irqmode
        echo 2 > "$dev"/queue_mode
        echo 1024 > "$dev"/hw_queue_depth
        echo 1 > "$dev"/memory_backed
        echo 1 > "$dev"/zoned

        echo $cap > "$dev"/size
        echo $zs > "$dev"/zone_size
	echo $zc > "$dev"/zone_capacity
	echo $max_open_zones > "$dev"/zone_max_open
	echo $max_active_zones > "$dev"/zone_max_active
        echo $nr_conv > "$dev"/zone_nr_conv

        echo 1 > "$dev"/power

        echo mq-deadline > /sys/block/nullb$nid/queue/scheduler

        echo "$nid"
}

nulldev=$(create_zoned_nullb $1 $2 $3 $4 $5 $6 $7)
echo "Created /dev/nullb$nulldev"

1. 创建ZenFs File System

sudo ./plugin/zenfs/util/zenfs mkfs --zbd=nullb0 --aux_path=/home/parallels/Desktop/zenfs/log

>ZenFS file system created. Free space: 255232 MB

2. 设置IO Scheduler deadline

sudo echo deadline > sudo /sys/class/block/nullb0/queue/scheduler

3. use db_bench to benchmark

fail

sudo ./db_bench --fs_uri=zenfs://dev:nullb0 --benchmarks=fillrandom --use_direct_io_for_flush_and_compaction

null_blk

 sudo modprobe null_blk nr_devices=1 zoned=1 //创建null_blk
 sudo blkzone report /dev/nullb0  //查看zone信息

标签:sudo,ZenFS,dev,echo,zenfs,nr,local,tutorial
From: https://www.cnblogs.com/attack204/p/16753955.html

相关文章

  • CARLA Tutorial
    InstallCarla0.9.13InstallAnacondaandsetittousablestateinordertohavepython3.7virtualenvironmentRunthefilenamedCarlaUE4.exeintheunzippe......
  • DevOps Tutorials All In One
    DevOpsTutorialsAllInOneDevOps导论https://www.icourse163.org/learn/NJU-1003664002refs©xgqfrms2012-2020www.cnblogs.com/xgqfrms发布文章使用:只允......
  • raspberry pi mount a usb drive tutorial
    #fdiskisatooltomanagedisksonLinux#thiswilldisplayalldisks#Attheendofthedisplayinglines,youwillseeyourusbdrive,checkthefilesyste......
  • AUTOSAR Basic Software (BSW) Tutorial
    Inthisarticlewewillseethe AUTOSARBSW(BasicSoftware) layer(thelayerbelow RTE).itisoneoftheimportantlayerswhichhelpsapplicationlayert......
  • Simple RegEx Tutorial
    https://dl.icewarp.com/online_help/203030104.htm SimpleRegExTutorialRegularExpressioncanbeusedinContentFilterconditions.RegularExpressionscan......
  • RocksDB and Zenfs Install and emulated by null_blk
    RocksDBGithubRepohttps://github.com/facebook/rocksdbInstallGuidehttps://github.com/facebook/rocksdb/blob/main/INSTALL.mdthenexecutemakeshared_lib&&su......