Coder Social home page Coder Social logo

facebook / wdt Goto Github PK

View Code? Open in Web Editor NEW
2.8K 175.0 390.0 2.03 MB

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.

Home Page: https://www.facebook.com/WdtOpenSource

License: Other

C++ 84.71% CMake 1.71% Shell 8.11% Tcl 2.27% Python 3.19%

wdt's Introduction

WDT Warp speed Data Transfer

Join the chat at https://gitter.im/facebook/wdt

Build Status

Design philosophy/Overview

Goal: Lowest possible total transfer time - to be only hardware limited (disc or network bandwidth not latency) and as efficient as possible (low CPU/memory/resources utilization)

We keep dependencies minimal in order to maximize portability and ensure a small binary size. As a bonus, this also minimizes compile time.

We aren't using exceptions for performance reasons and because using exceptions would make it harder to reason about the control flow of the library. We also believe the WDT library is easier to integrate as a result. Our philosophy is to write moderately structured and encapsulated C code as opposed to using every feature of C++.

We try to minimize the number of system calls, which is one of the reasons we are using blocking thread IOs. We can maximize system throughput because at any given point some threads are reading while others are writing, and data is buffered on both paths - keeping each subsystem busy while minimizing kernel to userspace switches.

Terminology

WDT uses "Mbytes" everywhere in its output as 1024*1024 bytes = 1048576 bytes (technically this should be the new mebibyte (MiB) standard but it felt Mbytes is be more in line with what other tools are using, clearer, easier to read and matching what a traditional "megabyte" used to mean in historical memory units where the address lines are binary and thus power of two and not of ten)

Example

While WDT is primarily a library, we also have a small command line tool which we use for tests and which is useful by itself. Here is a quick example:

Receiver side: (starts the server indicating destination directory)

[ldemailly@devbig074]$ wdt -directory /data/users/ldemailly/transfer1

Sender side: (discover and sends all files in a directory tree to destination)

[root@dev443]$ wdt -directory /usr/bin -destination devbig074.prn2

[=================================================] 100% 588.8 Mbytes/s
I0720 21:48:08.446014 3245296 Sender.cpp:314] Total sender time = 2.68699
seconds (0.00640992 dirTime). Transfer summary : Transfer status = OK. Number
of files transferred = 1887. Data Mbytes = 1582.08. Header Kbytes = 62.083
(0.00383215% overhead). Total bytes = 1658999858. Wasted bytes due to
failure = 0 (0% overhead). Total sender throughput = 588.816 Mbytes/sec
(590.224 Mbytes/sec pure transf rate)

Note that in this simple example with lots of small files (/usr/bin from a linux distribution), but not much data (~1.5Gbyte), the maximum speed isn't as good as it would with more data (as there is still a TCP ramp up time even though it's faster because of parallelization) like when we use it in our production use cases.

Performance/Results

In an internal use at Facebook to transfer RocksDB snapshot between hosts we are able to transfer data at a throttled 600 Mbytes/sec even across long distance, high latency links (e.g. Sweden to Oregon). That's 3x the speed of the previous highly optimized HTTP-based solution and with less strain on the system. When not throttling, we are able to easily saturate a 40 Gbit/s NIC and get near theoretical link speed (above 4 Gbytes/sec).

We have so far optimized WDT for servers with fast IOs - in particular flash card or in-memory read/writes. If you use disks throughput won't be as good, but we do plan on optimizing for disks as well in the future.

Dependencies

CMake for building WDT - See build/BUILD.md

gflags (google flags library) but only for the command line, the library doesn't depend on that

gtest (google testing) but only for tests

glog (google logging library) - use W*LOG macros so everything logged by WDT is always prefixed by "wdt>" which helps when embedded in another service

Parts of Facebook's Folly open source library (as set in the CMakefile) Mostly conv, threadlocal and checksum support.

For encryption, the crypto lib part of openssl-1.x

You can build and embed wdt as a library with as little as a C++11 compiler and glog - and you could macro away glog or replace it by printing to stderr if needed.

Code layout

Directories

  • top level Main WDT classes and Wdt command line source, CMakeLists.txt

  • util/ Utilities used for implementing the main objects

  • test/ Tests files and scripts

  • build/ Build related scripts and files and utils

  • fbonly/ Stuff specific to facebook/ (not in open source version)

  • bench/ Benchmark generation tools

Main files

  • CMakeLists.txt, .travis.yml, build/BUILD.md,travis_linux.sh,travis_osx.sh Build definition file - use CMake to generate a Makefile or a project file for your favorite IDE - details in build/BUILD.md

  • wdtCmdline.cpp

Main program which allows to have a server or client process to exercise the library (for end 2 end test as well as a standalone utility)

  • wcp.sh

A script to use wdt like scp for single big files - pending splitting support inside wdt proper the script does the splitting for you. install as "wcp".

  • WdtOptions.{h|cpp}

To specify the behavior of wdt. If wdt is used as a library, then the caller get the mutable object of options and set different options accordingly. When wdt is run in a standalone mode, behavior is changed through gflags in wdtCmdLine.cpp

  • WdtThread.{h|cpp} Common functionality and settings between SenderThread and ReceiverThread. Both of these kind of threads inherit from this base class.

  • WdtBase.{h|cpp}

Common functionality and settings between Sender and Receiver

  • WdtResourceController.{h|cpp}

Optional factory for Sender/Receiver with limit on number being created.

Producing/Sending

  • ByteSource.h

Interface for a data element to be sent/transferred

  • FileByteSource.{h|cpp}

Implementation/concrete subclass of ByteSource for a file identified as a relative path from a root dir. The identifier (path) sent remotely is the relative path

  • SourceQueue.h

Interface for producing next ByteSource to be sent

  • DirectorySourceQueue.{h|cpp}

Concrete implementation of SourceQueue producing all the files in a given directory, sorted by decreasing size (as they are discovered, you can start pulling from the queue even before all the files are found, it will return the current largest file)

  • ThreadTransferHistory.{h|cpp}

Every thread maintains a transfer history so that when a connection breaks it can talk to the receiver to find out up to where in the history has been sent. This class encapsulates all the logic for that bookkeeping

  • SenderThread.{h|cpp}

Implements the functionality of one sender thread, which binds to a certain port and sends files over.

  • Sender.{h|cpp}

Spawns multiple SenderThread threads and sends the data across to receiver

Consuming / Receiving

  • FileCreator.{h|cpp}

Creates file and directories necessary for said file (mkdir -p like)

  • ReceiverThread.{h|cpp}

Implements the functionality of the receiver threads, responsible for listening on a port and receiving files over the network.

  • Receiver.{h|cpp}

Parent receiver class that spawns multiple ReceiverThread threads and receives data from a remote host

Low level building blocks

  • ServerSocket.{h|.cpp}

Encapsulate a server socket listening on a port and giving a file descriptor to be used to communicate with the client

  • ClientSocket.{h|cpp}

Client socket wrapper - connection to a server port -> fd

  • Protocol.{h|cpp}

Decodes/Encodes meta information needed to interpret the data stream: the id (file path) and size (byte length of the data)

  • SocketUtils.{h|cpp}

Common socket related utilities (both client/server, sender/receiver side use)

  • Throttler.{h|cpp}

Throttling code

  • ErrorCodes.h

Header file for error codes

  • Reporting.{h|cpp}

Class representing transfer stats and reports

Future development/extensibility

The current implementation works well and has high efficiency. It is also extensible by implementing different byte sources both in and out. But inserting processing units isn't as easy.

For that we plan on restructuring the code to use a Zero copy stream/buffer pipeline: To maintain efficiency, the best overall total transfer time and time to first byte we can see WDT's internal architecture as chainable units

[Disk/flash/Storage IO] -> [Compression] -> [Protocol handling] -> [Encryption] -> [Network IO]

And the reverse chain on the receiving/writing end The trick is the data is variable length input and some units can change length and we need to process things by blocks Constraints/Design:

  • No locking / contention when possible
  • (Hard) Limits on memory used
  • Minimal number of copies/moving memory around
  • Still works the same for simple read file fd -> control -> write socked fd current basic implementation

Possible Solution(?) API:

  • Double linked list of Units
  • read/pull from left (pull() ?)
  • push to the right (push() ?)
  • end of stream from left
  • propagate last bytes to right

Can still be fully synchronous / blocking, works thanks to eof handling (synchronous gives us lock free/single thread - internally a unit is free to use parallelization like the compression stage is likely to want/need)

Another thing we touched on is processing chunks out of order - by changing header to be ( fileid, offset, size ) instead of ( filename, size ) and assuming everything is following in 1 continuous block (will also help the use case of small number of large files/chunks) : mmap'in the target/destination file The issue then is who creates it in what order - similar to the directory creation problem - we could use a meta info channel to avoid locking/contention but that requires synchronization

We want things to work with even up to 1 second latency without incurring a 1 second delay before we send the first payload byte

Submitting diffs/making changes

See CONTRIBUTING.md

Please run the tests

CTEST_OUTPUT_ON_FAILURE=1 make test

And ideally also the manual tests (integration/porting upcoming)

wdt_e2e_test.sh wdt_download_resumption_test.sh wdt_network_test.sh wdt_max_send_test.sh

(facebook only:) Make sure to do the following, before "arc diff":

 (cd wdt ; ./build/clangformat.sh )
 # if you changed the minor version of the protocol (in CMakeLists.txt)
 # run (cd wdt ; ./build/version_update.tcl ) to sync with fbcode's WdtConfig.h

 fbconfig  --clang --sanitize=address -r  wdt

 fbmake runtests --run-disabled --extended-tests
 # Optionally: opt build
 fbmake runtests_opt
 fbmake opt
 # Sender max speed test
 wdt/test/wdt_max_send_test.sh
 # Check buck build
 buck build wdt/...
 # Debug a specific test with full output even on success:
 buck test wdt:xxx -- --run-disabled --extended-tests --print-passing-details\
   --print-long-results

and check the output of the last step to make sure one of the 3 runs is still above 20,000 Mbytes/sec (you may need to make sure you /dev/shm is mostly empty to get the best memory throughput, as well as not having a ton of random processes running during the test)

Also :

  • Update this file
  • Make sure your diff has a task
  • Put (relevant) log output of sender/receiver in the diff test plan or comment
  • Depending on the changes
    • Perf: wdt/wdt_e2e_test.sh has a mix of ~ > 700 files, > 8 Gbytes/sec
    • do run remote network tests (wdt/wdt_remote_test.sh)
    • do run profiler and check profile results (wdt/fbonly/wdt_prof.sh) 80k small files at > 1.6 Gbyte/sec

wdt's People

Contributors

andrewjcg avatar aperez avatar davide125 avatar facebook-github-bot avatar hjmallon avatar ialexryan avatar igorsugak avatar ivmaykov avatar ldemailly avatar luciang avatar ma2bd avatar markisaa avatar meyering avatar michel-slm avatar nataliejameson avatar nedelchev avatar nikunjy avatar orvid avatar ot avatar r-barnes avatar sarangbh avatar sls-fb avatar stanislavglebik avatar thomasfersch avatar ttsugriy avatar uddipta avatar vgao1996 avatar viswanathgs avatar willerz avatar yfeldblum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wdt's Issues

md5sum is md5 on the mac

should find md5 in the simple test

also the test should fail instead of printing
xargs: md5sum: No such file or directory
(fix that bug first)

make a demo video/gif

something show casing the progress bar and the log output that we can embed in the docs

#1 window with
wdt -directory /usr/bin -destination ::1 --avg_mbytes_per_sec 750 --block_size_mbytes 10 -num_ports 4 2> wdt.log
# another window with
tail -F wdt.log | colorize.sh
# where colorize is:
cat colorize.sh
#! /bin/sh
# Very inneficient way to colorize log input
awk '/^I/ {system("tput setaf 2"); print $0} /^W/ {system("tput setaf 3"); print $0} /^E/ {system("tput setaf 1"); print $0} /^C/ {system("tput setaf 5"); print $0} /^[^IWEC]/ {system("tput sgr0"); print $0}'

and similar on receiver side

probably using the urls

Ask Questions

If you have questions about wdt, please comment here (or create a new Issue)

Eventually we'll gather answers on
https://github.com/facebook/wdt/wiki/FAQ

Also if you have suggestion on which collaboration medium to use - do share (we can use facebook groups for instance, or is having a facebook account a barrier?)

Can't build, no gmock library

Attempting to build on OS X 10.10

[ 75%] Linking CXX shared library libwdt4tests.dylib

ld: warning: directory not found for option '-L/Users/james/wdt/gmock/src/gmock-build/Debug'

ld: library not found for -lgmock

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [libwdt4tests.dylib] Error 1

make[1]: *** [CMakeFiles/wdt4tests.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

-- gmock download command succeeded.  See also /Users/james/wdt/gmock/src/gmock-stamp/gmock-download-*.log

[ 80%] No patch step for 'gmock'

[ 80%] No update step for 'gmock'

[ 82%] Performing configure step for 'gmock'

[ 84%] Linking CXX executable _bin/wdt/wdt

[ 84%] Built target wdt

-- gmock configure command succeeded.  See also /Users/james/wdt/gmock/src/gmock-stamp/gmock-configure-*.log

[ 86%] Performing build step for 'gmock'

-- gmock build command succeeded.  See also /Users/james/wdt/gmock/src/gmock-stamp/gmock-build-*.log

[ 88%] No install step for 'gmock'

[ 91%] Completed 'gmock'

[ 91%] Built target gmock

make: *** [all] Error 2

Extra detail: am using fish shell. Is that an issue?

wdt_e2e_test.sh not very portable

Need to revamp it so it works better outside of facebook

Right now it requires several Gbytes of free memory in /dev/shm as well as a realpath binary to deal with symlinks

Ideally we'd rewrite it all in python but that's a longer term task

logo contest

anyone wants to design a cool(er) logo ? maybe something like warpspeed related

Receiver : option for ServerSocket to listen on a specific address

Right now the Receiver listens/binds to all the addresses for a given port (*:port as shown in lsof for instance)

For some use case it would probably be good to have the option to specify the binding address/name

That parameter can be an in/out parameter in the WdtRequest and be used for the wdt://uri

transferid not set in the url returned by cmd line receiver

[ldemailly@devbig074 fbcode-hg]$ _bin/wdt/wdt --start_port 0 -directory /tmp/wdtTest/x2
I0728 14:18:53.806941 2208757 wdtCmdLine.cpp:119] Running WDT 1.14.1507270-fbcode p 14
I0728 14:18:53.807461 2208757 WdtBase.cpp:300] Generated a transfer id 918338613
I0728 14:18:53.807471 2208757 WdtBase.cpp:268] using wdt protocol version 14
I0728 14:18:53.807497 2208757 WdtBase.cpp:261] Setting transfer id
I0728 14:18:53.807606 2208757 Receiver.cpp:156] Registered 8 sockets
I0728 14:18:53.807622 2208757 Receiver.cpp:168] Transfer id
I0728 14:18:53.807632 2208757 wdtCmdLine.cpp:140] Starting receiver with connection url
wdt://devbig074.prn2.facebook.com?ports=36005,40903,38821,43869,64260,41130,59955,44966&protocol=14&id=

connection error should indicate the ip it tried to connect to

W0730 16:14:53.266710 2300510 ClientSocket.cpp:126] connect did not succeed : Connection refused
E0730 16:14:53.266685 2300509 Sender.cpp:483] Unable to connect to devbig074.prn2.facebook.com 22358 despite 20 retries in 0.956401 seconds.

we should also indicate the addr used

WdtResourceControllerTest.RequestSerializationTest fails on mac

E0727 20:46:06.290021 1968128768 WdtBase.cpp:158] Couldn't convert �ithub to valid port number
E0727 20:46:06.290083 1968128768 WdtBase.cpp:158] Couldn't convert wdt_github_eclipse126 to valid port number
/Users/ldemailly/github/wdt/WdtResourceControllerTest.cpp:322: Failure
Value of: OK
Actual: 0
Expected: dummy.errorCode
Which is: 20
E0727 20:46:06.290189 1968128768 WdtBase.cpp:167] Transfer request has errors present
/Users/ldemailly/github/wdt/WdtResourceControllerTest.cpp:323: Failure
Value of: serialized
Actual: "wdt://localhost?dir=/tmp/wdt_resoure_controller_test&protocol=14&ports=24689,24690,24691,24692,24693,24694,24695,24696&id=invalid-namespace0"
Expected: dummy.generateUrl(true)
Which is: "URI_PARSE_ERROR"
/Users/ldemailly/github/wdt/WdtResourceControllerTest.cpp:324: Failure
Value of: transferRequest
Actual: 136-byte object <24-69 6E-76 61-6C 69-64 2D-6E 61-6D 65-73 70-61 63-65 30-00 00-00 00-00 0E-00 00-00 00-00 00-00 A0-27 D0-4A FE-7F 00-00 C0-27 D0-4A FE-7F 00-00 C0-27 D0-4A FE-7F 00-00 12-6C 6F-63 61-6C 68-6F ... 00-00 00-00 00-00 00-00 31-00 00-00 00-00 00-00 20-00 00-00 00-00 00-00 C0-27 D0-4A FE-7F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 01-00 00-00>
Expected: dummy
Which is: 136-byte object <24-69 6E-76 61-6C 69-64 2D-6E 61-6D 65-73 70-61 63-65 30-00 00-00 00-00 0E-00 00-00 00-00 00-00 30-83 C0-4A FE-7F 00-00 38-83 C0-4A FE-7F 00-00 38-83 C0-4A FE-7F 00-00 12-6C 6F-63 61-6C 68-6F ... 12-6C 6F-63 61-6C 68-6F 31-00 00-00 00-00 00-00 20-00 00-00 00-00 00-00 70-8A C0-4A FE-7F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 14-00 00-00 FF-7F 00-00>
I0727 20:46:06.290452 1968128768 WdtResourceControllerTest.cpp:331] wdt://localhost?dir=&protocol=14&ports=0&id=
I0727 20:46:06.290477 1968128768 WdtResourceControllerTest.cpp:333] wdt://localhost?protocol=14&ports=0&id=
I0727 20:46:06.290526 1968128768 WdtBase.cpp:299] Generated a transfer id 1401679360
I0727 20:46:06.290940 1968128768 Receiver.cpp:156] Registered 8 sockets
I0727 20:46:06.290954 1968128768 Receiver.cpp:168] Transfer id 1401679360
I0727 20:46:06.290974 1968128768 WdtResourceControllerTest.cpp:347] ldemailly-mbp.local
W0727 20:46:06.290994 1968128768 Receiver.cpp:238] The receiver is not joinable. The threads will never finish and this method will never return
W0727 20:46:06.291004 1968128768 Receiver.cpp:273] WDT receiver's transfer has been finished
I0727 20:46:06.291012 1968128768 Receiver.cpp:274] Transfer status (local) = ERROR, (remote) = OK. Number of blocks transferred = 0. Data Mbytes = 0. Header kBytes = 0 (100% overhead). Total bytes = 0. Wasted bytes due to failure = 0 (100% overhead).
E0727 20:46:06.291088 1968128768 WdtBase.cpp:158] Couldn't convert 123* to valid port number
E0727 20:46:06.291105 1968128768 WdtBase.cpp:158] Couldn't convert * to valid port number
E0727 20:46:06.291122 1968128768 WdtBase.cpp:158] Couldn't convert * to valid port number
E0727 20:46:06.291142 1968128768 WdtBase.cpp:158] Couldn't convert * to valid port number
E0727 20:46:06.291152 1968128768 WdtBase.cpp:167] Transfer request has errors present
E0727 20:46:06.291158 1968128768 WdtBase.cpp:64] URL doesn't have a valid host name wdt://
E0727 20:46:06.291194 1968128768 WdtBase.cpp:145] Error parsing protocol version
E0727 20:46:06.291209 1968128768 WdtBase.cpp:167] Transfer request has errors present
W0727 20:46:06.291218 1968128768 WdtResourceController.cpp:226] Shutting down the controller
W0727 20:46:06.291229 1968128768 WdtResourceController.cpp:235] Shutdown the wdt resource controller
[ FAILED ] WdtResourceControllerTest.RequestSerializationTest (3 ms)
[ RUN ] WdtResourceControllerTest.TransferIdGenerationTest
I0727 20:46:06.291265 1968128768 WdtBase.cpp:299] Generated a transfer id 1844604178
I0727 20:46:06.291276 1968128768 WdtBase.cpp:299] Generated a transfer id 1921304324
[ OK ] WdtResourceControllerTest.TransferIdGenerationTest (0 ms)
[----------] 3 tests from WdtResourceControllerTest (3 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 2 test cases ran. (7 ms total)
[ PASSED ] 6 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] WdtResourceControllerTest.RequestSerializationTest

1 FAILED TEST

continous build for opensource

we have internal continous build but let's hook up travis-ci so pull requests and open source trunk can be auto tested

have toString() or toDebugString() and operator<< calling it for all objects

have toString() or toDebugString() and operator<< calling it for all objects

so we can replace stuff like

LOG(ERROR) << "Transfer aborted during connect " << port_ << " " << fd_;
WLOG(ERROR) << "Transfer aborted during connect"
// would turn into:
LOG(ERROR) << *this << ":" <<  "Transfer aborted during connect"

Make Wdt URI more awesome

Couple of things can be added to WdtUri

  1. Short URL should have the capability to shorten ports if all ports are continous into numports and hostName:startPort
  2. If hostname is empty or ports are empty, try to build from wdt options
  3. ErrorCode could be sent as part of URL

wdt_tuner

We found that various settings and things can impede good performance we could have a checker that checks:

the kernel version
xfs mount options
tcp buffers
tcp queue workaround

and more, including telling the user how to fix various issues

possibly tied to running a benchmark as well to verify good settings

how to do a local transfer test?

receiver side: wdt -directory wdtData/
sender side : wdt -directory /usr/bin/ -destination localhost

can't get the content transfered frome /usr/bin/ to wdtData, the receiver and sender run on a same mac book.

Windows support

Is the code for WDT platform independent ? Is it tweakable so it runs on windows ?

client with -ipv6 and server without any flag don't connect

 _bin/wdt/wdt -skip_writes -transfer_id 1
 _bin/wdt/wdt -destination localhost -directory wdt -transfer_id 1 -ipv6

...
W0730 16:33:57.951288 2325264 ClientSocket.cpp:126] connect did not succeed : Connection refused
E0730 16:33:57.951324 2325264 Sender.cpp:483] Unable to connect to localhost 22360 despite 20 retries in 0.956459 seconds.

should work - it doesn't (side effect of my change of default for ipv6 to be false)

no flag/default should be for server to listen to all addr and work with ipv6 (if there is one)

Destination host is transmitting as much data as receiving

I just compiled wdt today and, although it transfers data quickly, I noticed that the destination host was transmitting exactly the same amount of data as it was receiving.

I'm using Gnome's System Monitor to monitor the network traffic. Both sender and receiver hosts were running wdt from within a Docker container (Ubuntu 14.04.3 LTS).

wcp fails with -n and relative path

because of how the symlink is setup

wcp -n x/y/z dest:
will fail to find x/y/z in the temp dir

workaround pwd/x/y/z

need also to use the connection url like in the e2e_simple test

IP Connection Fails when given an Ipv4 instead of a name as input and --ipv6 is true (default)

I get the following error when trying to connect to the receiver via IP address.

E0729 17:08:27.555832 26484736 ClientSocket.cpp:49] Failed getaddrinfo 192.168.2.2 , 22363 : 8 : nodename nor servname provided, or not known

I thought this was a DNS lookup issue, but that doesn't seem to be the case. Adding the address to my host file and using the specified hostname resulted in the same error.

Sender is OS X 10.9.5
Receiver is 10.10.2

Direct connection via ethernet.

cleanup constructors

sender for instance has too many constructors and they are chained in a bad way like changing the ports vector

the command line also should exercise all/most of them

it's related to WdtBase refactoring too

help text for --ipv6 is incorrect

wdt --help|grep ipv
-ipv4 (use ipv4 only, takes precedence over -ipv6) type: bool
-ipv6 (use ipv4 only, takes precedence over -ipv6) type: bool default: true

find out why gmock isn't found with xcode without the hack

trying

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22624db..d17ffad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -238,7 +238,8 @@ if (BUILD_TESTING)
   # ${BINARY_DIR}/libgmock.a works everywhere except xcode...
 # so ugly weird hack generating warnings about unknown dir for now:
   target_link_libraries(wdt4tests
-    "-L ${BINARY_DIR} -L ${BINARY_DIR}/Debug -lgmock"
+    # "-L ${BINARY_DIR} -L ${BINARY_DIR}/Debug -lgmock"
+    "-L ${BINARY_DIR} -lgmock"
     wdtlib
   )

yields in xcode builder:

ld /Users/ldemailly/github/ldemailly/xcode/Debug/libwdt4tests.dylib normal x86_64
    cd /Users/ldemailly/github/ldemailly/wdt
    export MACOSX_DEPLOYMENT_TARGET=10.10
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/ldemailly/github/ldemailly/xcode/Debug -F/Users/ldemailly/github/ldemailly/xcode/Debug -filelist /Users/ldemailly/github/ldemailly/xcode/WDT.build/Debug/wdt4tests.build/Objects-normal/x86_64/wdt4tests.LinkFileList -install_name @rpath/libwdt4tests.dylib -Xlinker -rpath -Xlinker /Users/ldemailly/github/ldemailly/xcode/Debug -mmacosx-version-min=10.10 -dynamiclib -Wl,-headerpad_max_install_names -L /Users/ldemailly/github/ldemailly/xcode/gmock/src/gmock-build -lgmock /Users/ldemailly/github/ldemailly/xcode/Debug/libwdtlib.dylib /Users/ldemailly/github/ldemailly/xcode/Debug/libwdtlib_min.dylib /Users/ldemailly/github/ldemailly/xcode/Debug/libfolly4wdt.dylib /usr/local/lib/libglog.dylib /usr/local/lib/libgflags.dylib /usr/local/lib/libboost_system-mt.dylib -single_module -Xlinker -dependency_info -Xlinker /Users/ldemailly/github/ldemailly/xcode/WDT.build/Debug/wdt4tests.build/Objects-normal/x86_64/wdt4tests_dependency_info.dat -o /Users/ldemailly/github/ldemailly/xcode/Debug/libwdt4tests.dylib

ld: library not found for -lgmock
clang: error: linker command failed with exit code 1 (use -v to see invocation)

and with it everybody else gets the

ld: warning: directory not found for option '-L/Users/ldemailly/github/ldemailly/build/gmock/src/gmock-build/Debug'

)

need to ask on CMake mailing list (or if anyone here has an idea ?)

V0825 18:42:30.977504 1186405 ServerSocket.cpp:153] poll() timed out52086 3

should be a higher -v level so one can run with -v=1 or -v=2 without a flood of

V0825 18:42:29.976109 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.076251 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.176393 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.276528 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.376662 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.476794 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.576927 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.677085 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.777232 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.877367 1186405 ServerSocket.cpp:153] poll() timed out52086 3
V0825 18:42:30.977504 1186405 ServerSocket.cpp:153] poll() timed out52086 3

also it's missing a space

test failure related to symlink on xfs (travis linux) and mac

(if you have md5sum/with a fix for #28 )

Total sender throughput = 266.945 Mbytes/sec (267.767 Mbytes/sec pure transf rate)
        0.62 real         0.03 user         0.11 sys
Verifying for run without follow_symlinks
Checking for difference Tue Jul 28 22:48:55 PDT 2015
Transfered 168396   /tmp/wdtTest/DyQu7S/dst kbytes across       44 files
Should be no diff
Verifying for run with follow_symlinks
Checking for difference Tue Jul 28 22:48:56 PDT 2015
Transfered 168412   /tmp/wdtTest/DyQu7S/dst_symlinks kbytes across       48 files
Should be no diff
--- src_symlinks.md5s   2015-07-28 22:48:56.000000000 -0700
+++ dst_symlinks.md5s   2015-07-28 22:48:57.000000000 -0700
@@ -5,6 +5,7 @@
 MD5 (./a) = d41d8cd98f00b204e9800998ecf8427e
 MD5 (./c) = 0f343b0931126a20f133d67c2b018a3b
 MD5 (./d/a) = 0f343b0931126a20f133d67c2b018a3b
+MD5 (./d/e/a) = 0f343b0931126a20f133d67c2b018a3b
 MD5 (./inp1024.1) = 75918399c3d7d1620c295a80c7f8fd47
 MD5 (./inp1024.2) = 75918399c3d7d1620c295a80c7f8fd47
 MD5 (./inp1024.3) = 75918399c3d7d1620c295a80c7f8fd47
Server logs:
W0728 22:48:54.831984 42045440 Receiver.cpp:1386] Last thread finished. Duration of the transfer 0.952766
W0728 22:48:54.832458 1968128768 Receiver.cpp:268] WDT receiver's transfer has been finished
W0728 22:48:55.563597 267108352 Receiver.cpp:1386] Last thread finished. Duration of the transfer 0.611939
W0728 22:48:55.563712 1968128768 Receiver.cpp:268] WDT receiver's transfer has been finished
Bad run (1) - keeping full logs and partial transfer in /tmp/wdtTest/DyQu7S
ldemailly-mbp:build ldemailly$ ls -l /tmp/wdtTest/DyQu7S/src
src/               src.md5s           src_symlinks.md5s
ldemailly-mbp:build ldemailly$ ls -l /tmp/wdtTest/DyQu7S/src
src/               src.md5s           src_symlinks.md5s
ldemailly-mbp:build ldemailly$ ls -l /tmp/wdtTest/DyQu7S/src/d/
total 16
lrwxr-xr-x  1 ldemailly  wheel  4 Jul 28 22:48 a -> ../c
lrwxr-xr-x  1 ldemailly  wheel  4 Jul 28 22:48 e -> ../d
ldemailly-mbp:build ldemailly$ ls -l /tmp/wdtTest/DyQu7S/src/d/e
lrwxr-xr-x  1 ldemailly  wheel  4 Jul 28 22:48 /tmp/wdtTest/DyQu7S/src/d/e -> ../d
ldemailly-mbp:build ldemailly$ ls -l /tmp/wdtTest/DyQu7S/src/
total 336784
drwxr-xr-x  4 ldemailly  wheel       136 Jul 28 22:48 TestDir
-rw-r--r--  1 ldemailly  wheel         0 Jul 28 22:48 a
lrwxr-xr-x  1 ldemailly  wheel        11 Jul 28 22:48 badlink -> doesntexist
-rw-r--r--  1 ldemailly  wheel      1024 Jul 28 22:48 c

error message improvement: when permission denied on big file - error should include block #

we cut big files in blocks, right opening error do not indicate we are opening say block 23/54 so it looks like somehow we retry the same file open many times for no reason - let's add a indication those errors are for different blocks of each file

current example:

I0723 18:29:29.728066 1244704 DirectorySourceQueue.cpp:290] Number of files explored: 1928, errors: false
[                                                 ] 0% 9.5 0.0 Mbytes/s  E0723 18:29:29.751385 1244709 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[==========>                                      ] 22% 699.4 620.9 Mbytes/s  E0723 18:29:30.284780 1244709 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[=============>                                   ] 28% 663.8 620.9 Mbytes/s  E0723 18:29:30.450438 1244711 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[===============>                                 ] 32% 667.6 620.9 Mbytes/s  E0723 18:29:30.558434 1244707 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[===================>                             ] 40% 709.9 620.9 Mbytes/s  E0723 18:29:30.711453 1244709 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[=====================>                           ] 45% 717.8 795.7 Mbytes/s  E0723 18:29:30.818106 1244709 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[========================>                        ] 50% 697.7 795.7 Mbytes/s  E0723 18:29:30.981444 1244706 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[==========================>                      ] 54% 729.8 795.7 Mbytes/s  E0723 18:29:31.031445 1244709 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[==========================>                      ] 54% 705.0 795.7 Mbytes/s  E0723 18:29:31.091792 1244707 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[============================>                    ] 59% 701.6 795.7 Mbytes/s  E0723 18:29:31.198081 1244705 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[===================================>             ] 72% 727.7 776.2 Mbytes/s  E0723 18:29:31.465771 1244710 FileByteSource.cpp:46] error opening file /usr/bin/big1: Permission denied [13]
[============================================>    ] 91% 749.5 798.4 Mbytes/s  E0723 18:29:31.861701 1244708 FileByteSource.cpp:46] error opening file /usr/bin/sudo: Permission denied [13]

refactor without threadlocal

we only need 1 buffer per thread but that can be explicit in each sender/receiver thread

related to refactoring ThreadData too

also relates to how odirect is handled - could be determined once at the beginning

options template

We find that we would like different sets of options for say,

open source command line
library running as a daemon
fb internal settings
etc...

an example is when I changed the ipv6 to false so it works on ipv4 only machines - which is reasonable for the general release, I broke some facebook internal deployement because the default changed but we should have a way to name/have "sets" of options

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.