Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Improve peers to db efficiency #104

Closed
karmacoma opened this issue May 9, 2016 · 3 comments
Closed

Improve peers to db efficiency #104

karmacoma opened this issue May 9, 2016 · 3 comments

Comments

@karmacoma
Copy link
Contributor

karmacoma commented May 9, 2016

Currently peers information is separately inserted / updated on every API request hitting the transport module. Under heavy loads, this becomes very inefficient.

@karmacoma karmacoma self-assigned this May 9, 2016
@karmacoma karmacoma added this to the Mainnet Launch milestone May 9, 2016
@fix
Copy link
Contributor

fix commented May 16, 2016

first guess is to remove this
https://github.com/LiskHQ/lisk/blob/462d59882b878180ed39d78ed8dee4c0f1770244/modules/transport.js#L39

and include this function in some "strategic" router.get function. I think on receiving blocks could be a good start.

@karmacoma karmacoma added ready and removed ready labels May 19, 2016
@fix
Copy link
Contributor

fix commented May 21, 2016

linked to #135

@karmacoma
One idea is to have 2 lists : the current peers, and the removed one.
This removed list is checked if an unknown peer arrives.

The removed list stores as well the date of removal and a score (like how many times it has been removed). The time and score tells you can retest to connect the peer after score*60s (example) after the last removal. This way bad peers don't pop up often in the networks. If finally the peer is connected, the peer can be removed from the removed list or maybe the score decreased...

@karmacoma karmacoma removed this from the Mainnet Launch milestone May 23, 2016
@fix
Copy link
Contributor

fix commented Aug 12, 2016

@karmacoma some codes have been implemented (the list of peers that have been removed).

Not sure there are some more strategic implementation to improve things? Also maybe move on to the issue to prevent "lite client" from being recorded to the database.

@karmacoma karmacoma modified the milestone: Community Forging Aug 17, 2016
@karmacoma karmacoma modified the milestone: Mainchain Stabilisation Aug 31, 2016
@karmacoma karmacoma added the hard label Sep 30, 2016
karmacoma pushed a commit that referenced this issue Oct 6, 2016
karmacoma pushed a commit that referenced this issue Oct 10, 2016
- Replacing insert / update with single upsert.
- Chaining database queries when adding dapp peer.
MaciejBaj added a commit that referenced this issue Dec 5, 2018
DoS attack leads to exhaust node's memory, P2P layer - Closes #104
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants