GitXplorerGitXplorer
n

slowfs

public
31 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
d140619dc16dedc29359b198fe92af5f60959e8f

Improve installation instructions

mmureinik committed 5 years ago
Unverified
5f62f830d184c0f99b384f0653231dab52fbad50

Fix tests, broken by making slowfs a script

nnirs committed 7 years ago
Unverified
cb52b223509334652753863f76bb698e18213387

Fix interpreter name

nnirs committed 7 years ago
Unverified
8217345a0aeb511c3587eb9234dbbdff661b210a

Update installation and usage instructions

nnirs committed 7 years ago
Unverified
89778ed2ac242c4f5e7fe5a79ac6c27b9c9b0ada

Add option to allow other users access to the slow file system

nnirs committed 7 years ago
Unverified
70d8da04dedce6bcd5816b863501af75698f6d7f

Make installation useful

nnirs committed 7 years ago

README

The README file for this repository.

slowfs

A very slow file system for simulating overloaded storage

Build Status

Installation

Installing prerequisites on Fedora/RHEL/CentOS

# dnf install -y git python python-pip fuse fuse-devel

Installing prerequisites on Debian/Ubuntu

# apt-get install -y git python python-pip fuse

Further steps

# git clone https://github.com/nirs/slowfs.git
# cd slowfs
# pip install -r requirements.txt
# python setup.py install

Usage

# mkdir /realfs /slowfs
# slowfs -c slowfs.cfg /realfs /slowfs

You will see all files in /realfs under /slowfs. Manipulating the files under slowfs will be slow as you configure in slowfs.cfg

Configuration

The config file is a Python module, with key value pairs for all fuse operations.

Example: adding delay of 60 seconds when removing a file:

# slowfs.cfg
unlink = 60

Operations without configuration use no delay. See slowfs.cfg.example for more info.

To change configuration when the mount is online, edit the configuration file and reload the configuration:

slowfsctl reload

Note: you must run this in the same directory you started slowfs. slowfsctl uses the "control" socket created by slowfs in the worrking directory.

Controlling slowfs

You can use slowfsctl tool to modify slowfs without restarting it.

Available comamnds:

  • help
  • status
  • disable
  • enable
  • reload
  • get
  • set
  • log

help

slowfsctl help

Print available commands

status

slowfsctl status

Print current status (Enabled, Disable)

disable

slowfsctl disable

Disable current configuration, deactivating all delays.

enable

slowfsctl enable

Enable current configuration, activating all delays

reload

slowfsctl reload

Reload configuration from cofiguration file specified using the -c, --config option. If slowfs is running without configuration file, reset configuration to defaults.

get

slowfsctl get NAME

Print current delay for fuse operation NAME.

set

slowfsctl set NAME VALUE

Set dealy for fuse opration NAME to VALUE, overriding value read form configuration file.

log

slowfsctl log LEVEL

Change logging level to (debug, info, warning, error)

Note: debug log level is extermely detailed and slow, logging every read or written to storage, generating gigabytes of logs.

Exporting via NFS

Assuming you mounted your slowfs filesystem on /slowfs

Edit /etc/exports and add:

/slowfs    *(rw,sync,no_subtree_check,anonuid=36,anongid=36,fsid=0)

Notes:

  • fsid=NNN is required
  • anonid=36,anongid=36 - required for ovirt
  • seems that all_squash does not work with fuse

Restart nfs service:

systemctl restart nfs

Testing the mount on the client side:

# mkdir mountpoint
# mount -t nfs my.server.name:/slowfs mountpoint
# touch mnt/test
# time rm mnt/test
# time rm mnt/test

real    1m0.063s
user    0m0.000s
sys     0m0.001s

Note: unlink() was configured with 60 seconds sleep.

Talks

Contributing

To run the tests locally, please install tox:

pip install tox

To run the tests locally:

$ tox

You can also run specific env:

$ tox -e py27

To stop on the first failure:

$ tox -- -x

To see test logs in tests output:

$ tox -- -s

To see slowfs debug logs in tests output, set the DEBUG environment variable:

$ DEBUG=1 tox -- -s

Note that this creates extremely verbose logs.