Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethstats: reduce ethstats traffic by trottling reports #14563

Merged
merged 1 commit into from
Jun 1, 2017

Conversation

karalabe
Copy link
Member

This PR changes the ethstats package a bit to throttle transaction reports to once per second max and chain head reports too. This should help lessen the load from ethstats if it's being overwhelmed.


for {
select {
// Notify of chain head events, but drop if too frequent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't actually drop if too frequent here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does drop in

select {
case headCh <- head.Data.(core.ChainHeadEvent).Block:
default:
}

If the channel already contains a head, then I'm not waiting to add another one.

The reason I've added an additional 1sec throttling for txs is because the payload is tiny, so when a lot of txs are added, still a lot of requests manage to slip through to ethstats.

@karalabe karalabe added this to the 1.6.3 milestone Jun 1, 2017
@karalabe karalabe merged commit f4d8117 into ethereum:master Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants