Commit Graph

32 Commits

Author SHA1 Message Date
Jeromy
8f0623255d replace imports with absolute path instead of using symlink
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-03 14:30:50 -07:00
Jeromy
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
Jeromy
c3280ce885 use new methods from goprocess/context, remove thirdparty/waitable
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-08 21:37:40 -07:00
Juan Batiz-Benet
6e705e1ef0 bitswap/provide: improved rate limiting
this PR greatly speeds up providing and add.

(1) Instead of idling workers, we move to a ratelimiter-based worker.
We put this max at 512, so that means _up to_ 512 goroutines. This
is very small load on the node, as each worker is providing to the
dht, which means mostly waiting. It DOES put a large load on the DHT.
but i want to try this out for a while and see if it's a problem.
We can decide later if it is a problem for the network (nothing
stops anyone from re-compiling, but the defaults of course matter).

(2) We add a buffer size for provideKeys, which means that we block
the add process much less. this is a very cheap buffer, as it only
stores keys (it may be even cheaper with a lock + ring buffer
instead of a channel...). This makes add blazing fast-- it was being
rate limited by providing. Add should not be ratelimited by providing
(much, if any) as the user wants to just store the stuff in the local
node's repo. This buffer is initially set to 4096, which means:

  4096 * keysize (~258 bytes + go overhead) ~ 1-1.5MB

this buffer only last a few sec to mins, and is an ok thing to do
for the sake of very fast adds. (this could be a configurable
paramter, certainly for low-mem footprint use cases). At the moment
this is not much, compared to block sizes.

(3) We make the providing EventBegin() + Done(), so that we can
track how long a provide takes, and we can remove workers as they
finish in bsdash and similar tools.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-04 20:07:25 +02:00
Jeromy
ff1bf3058e add in some events to bitswap to emit worker information
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-07 12:14:57 -07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Jeromy
efa442ada2 adjust naming 2015-05-29 18:28:50 -07:00
Jeromy
f574cd4b80 Move findproviders out of main block request path
This PR moves the addition of new blocks to our wantlist (and their
subsequent broadcast to the network) outside of the clientWorker loop.
This allows blocks to more quickly propogate to peers we are already
connected to, where before we had to wait for the previous findProviders
call in clientworker to complete before we could notify our partners of
the next blocks that we want. I then changed the naming of the
clientWorker and related variables to be a bit more appropriate to the
model. Although the clientWorker (now named providerConnector) feels a
bit awkward and should probably be changed.

fix test assumption
2015-05-29 18:28:36 -07:00
Jeromy
594c7786c3 turn rebroadcast back on 2015-05-21 03:08:31 -04:00
Jeromy
6bf33ad62f WIP: super awesome bitswap cleanup fixtime 2015-05-21 03:08:31 -04:00
Jeromy
ef967ceeef contextify peermanager 2015-05-21 03:08:31 -04:00
Jeromy
a159e6825c implement peermanager to control outgoing messages
Also more refactoring of bitswap in general, including some perf
improvements and eventlog removal.

clean up, and buffer channels

move some things around

correctly buffer work messages

more cleanup, and improve test perf

remove unneccessary test

revert changes to bitswap message, they werent necessary
2015-05-21 03:08:30 -04:00
Jeromy
225b58e31a remove inflect package 2015-05-20 15:09:20 -07:00
Juan Batiz-Benet
99596435a7 Merge pull request #1166 from ipfs/fix/bitswap-multisend
try harder to not send duplicate blocks
2015-05-05 00:07:53 -04:00
Jeromy
867186c054 dont create a new ticker each loop 2015-05-01 23:11:40 -07:00
Jeromy
86fb07aed7 try harder to not send duplicate blocks 2015-04-29 01:36:47 -07:00
Jeromy Johnson
43eeab9549 change env var for bitswap
changed IPFS_TASK_WORKERS to IPFS_BITSWAP_TASK_WORKERS
2015-04-19 13:10:43 -07:00
Jeromy
16e04356b9 address comments from CR 2015-04-19 11:19:51 -07:00
Jeromy
3629d7d548 make number of workers tuneable by an env var 2015-04-17 15:57:50 -07:00
Jeromy
3178dfe78b add more bitswap task workers 2015-04-17 12:43:31 -07:00
Jeromy
8450a8d4d8 address comments from CR 2015-04-06 21:49:14 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Henry
aa55eebe7e fixed two more 2015-03-07 14:47:07 +01:00
Jeromy
34961a5aef toprovide -> toProvide 2015-03-05 16:37:40 -08:00
Jeromy
bfee4894b4 simplify provideCollector 2015-03-05 16:27:47 -08:00
Jeromy
8937f5fbda implement a worker to consolidate HasBlock provide calls into one to alieviate memory pressure 2015-03-05 15:18:57 -08:00
Henry
d743801638 godep: changed back to inflect upstream 2015-03-01 13:22:27 +01:00
Jeromy
b514478f32 rename wantlist to bitswap, add stat command 2015-02-27 00:12:21 -08:00
Jeromy
8256b18058 make sure not to orphan any extra goroutines 2015-02-26 23:22:12 -08:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
5924f4a3db rename for clarity 2015-02-19 20:07:02 -08:00
Jeromy
d7eb57f48f add worker to bitswap for reproviding new blocks 2015-02-19 20:07:02 -08:00