Skip to content

slow anonymous downloads: Crypto CPU bottleneck #1882

@synctext

Description

@synctext

The CPU seams to be the reason for slow <1 MByte/sec anonymous downloads.

possible problem
Running crypto on twisted thread blocks all other Tribler activity. Unclear if we needs 256bit GCM mode. Anything that checks a signature, decrypt a message, etc. needs to be traced.

possible long-term solution
Separate thread for the tunnel community or even an isolated thread for each community.
Low hanging fruit: parallel execution of relaying, make it multi-threaded. Real threads: Twisted reactor versus import multiprocessing...

goal

  1. benchmark raw openssl C code GCM MBps.

  2. Create a minimal benchmark comparing current situation in Tribler with alternatives. Not re-using Tribler code, but a performance test processing 10.000 UDP

  • Only generating packets and decrypting one layer, then another layer. Current approach.
  • Doing the same on a threadpool within Twisted.
  • Separate Python OS process, communicate using a ringbuffer. Twisted has build-in support for this, treating it like just another thread.

EDIT: use 10k UDP packets through exit node as benchmark.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions