Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is disk latency really getting injected? #18

Open
db-vmw opened this issue Jan 17, 2019 · 5 comments
Open

Is disk latency really getting injected? #18

db-vmw opened this issue Jan 17, 2019 · 5 comments

Comments

@db-vmw
Copy link

db-vmw commented Jan 17, 2019

Hello Team,
I have mounted charybdefs on my ubuntu machine. I have written a small python code to simulate slow write (disk latency). The python code will connect to thrift module as documented in the charybdefs blogpost.
I have run the python script with the following parameters

python inject_fault.py -o disklatency -l 2000000 -p 9090

Here, I was expecting 20seconds of delay for the write operation. But, the below dd command has finished in 6.6 seconds. Before injecting the above fault (20 seconds delay) the same dd command had completed with 165MB/s (6.3s). I don't know if the charybdefs is really injecting fault here. Can you please confirm if any thing wrong here?

$ sudo dd if=/dev/zero of=/var/data-dir/file_1gb_after_20s_delay_2 bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 6.60714 s, 163 MB/s

Python client code:

import sys

sys.path.append('gen-py')
import errno

from server import server
from server.ttypes import *

from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from argparse import ArgumentParser

if __name__ == "__main__":
    parser = ArgumentParser()
    parser.add_argument("-o", "--operation", dest="operation", help="the type of the operation that has to be executed",
                    choices=["disklatency", "ioError", "randomError", "NOSPCError", "QUOTAExceed", "remediate"])
    parser.add_argument("-l", "--latency", dest="latency", help="Disk Latency in milliseconds")
    parser.add_argument("-p", "--port", dest="socketPort", help="socket Port for client connection")
try:
    args = parser.parse_args()
except:
    parser.error("Error parsing arguments..")
    sys.exit()

try:

    transport = TSocket.TSocket('127.0.0.1', int(args.socketPort))
    transport = TTransport.TBufferedTransport(transport)
    protocol = TBinaryProtocol.TBinaryProtocol(transport)
    client = server.Client(protocol)
    transport.open()


    if args.operation == "ioError":
         print('Executing the injection of ioError fault')
         client.set_all_fault(False, errno.EIO, 0, "", False, 0, False)
    if args.operation == "disklatency":
         print('Executing the injection of DiskLatency fault')
         client.set_all_fault(False, 0, 0, "", False, int(args.latency), True)
except Thrift.TException as tx:
    print('%s' % tx.message)

@db-vmw
Copy link
Author

db-vmw commented Jan 17, 2019

@lmr , @bentsi can you please help me here?
Note: Including top contributors of this project to comment on my observation.

@bentsi
Copy link
Contributor

bentsi commented Jan 17, 2019

@db-vmw what is the command that you used to mount CharybdeFS?

@db-vmw
Copy link
Author

db-vmw commented Jan 18, 2019

Hi @bentsi , I'm using the following command:

./charybdefs /var/data-dir -omodules=subdir,subdir=/var/skpscyla/data-dir -o nonempty -o allow_other

I'm injecting the disk latency (slow disk) using charybdefs on to /var/data-dir

Thanks,
Dinesh

@db-vmw
Copy link
Author

db-vmw commented Jan 25, 2019

Hi @bentsi , any comments on the observation?

@bentsi
Copy link
Contributor

bentsi commented Jan 29, 2019

Looking in the C++ code again, the latency is implemented as a delay before executing the syscall, you can fix this and fire a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants