Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

storage/netstore: optimize fetchers for faster forwarding #1982

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

acud
Copy link
Member

@acud acud commented Nov 26, 2019

This PR aims to optimize fetchers for faster forwarding of chunks.

The main problem with the current implementation on master is that a delivery of a fetcher is notified to the goroutines blocking on the delivery only after the chunk has been put to the localstore (by the means of closing the Delivered channel on the fetcher). This is an obvious forfeit on performance.

The proposed solution is to add a Chunk field on the Fetcher struct. This field will be safely set when once.Do() is called upon chunk delivery. The goroutines blocking on the delivery will then unblock and read the data from the Chunk field. This skips the localstore Put and Get when delivering the chunks.

@acud acud added this to the 0.5.4 milestone Nov 26, 2019
@acud acud self-assigned this Nov 26, 2019
@acud acud added this to Backlog in Swarm Core - Sprint planning via automation Nov 26, 2019
@acud acud modified the milestones: 0.5.4, 0.5.5, 0.5.6 Nov 28, 2019
@acud acud force-pushed the fetcher-faster-forward branch 2 times, most recently from fe92a6b to 12a7ed0 Compare November 29, 2019 07:42
@acud acud requested review from janos, zelig and nolash November 29, 2019 07:58
@acud acud moved this from Backlog to In review (includes Documentation) in Swarm Core - Sprint planning Nov 29, 2019
@acud acud force-pushed the fetcher-faster-forward branch 2 times, most recently from 775f0bf to 3a3ba3d Compare November 29, 2019 09:13
@janos
Copy link
Member

janos commented Dec 2, 2019

Smoke tests are passing on this branch https://snapshot.raintank.io/dashboard/snapshot/6TJcQ0gERiQSPyEjrvqbreJqmNCPPWWc and show a bit higher average download speed (5.253 MBs) then it was on 0.5.3 release #1974 (comment) (3.25 MBs).

@janos
Copy link
Member

janos commented Dec 3, 2019

Smoke tests are running stable for one day, with average download speed 5.088 MB/s https://snapshot.raintank.io/dashboard/snapshot/rkqGTaAMStPFQYrxBI6RM2rfUte8vjC1.

@zelig zelig merged commit 1b16711 into master Dec 4, 2019
Swarm Core - Sprint planning automation moved this from In review (includes Documentation) to Done Dec 4, 2019
@acud acud deleted the fetcher-faster-forward branch December 12, 2019 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants