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

Add host benchmarking #122

Open
chris124567 opened this issue Oct 24, 2024 · 6 comments
Open

Add host benchmarking #122

chris124567 opened this issue Oct 24, 2024 · 6 comments
Assignees
Milestone

Comments

@chris124567
Copy link
Member

No description provided.

@chris124567 chris124567 self-assigned this Oct 24, 2024
@ChrisSchinnerl ChrisSchinnerl moved this to Todo in Sia Oct 25, 2024
@n8maninger n8maninger added this to the v0.1.0 milestone Nov 1, 2024
@CtrlAltDefeat94
Copy link

Not sure if it's planned already. But it would be helpful to be able to benchmark hosts while reusing the existing contract, unlike benchyd where each benchmark creates a new contract.

@chris124567
Copy link
Member Author

From a cost perspective I think it makes sense to have that as the goal.

@n8maninger
Copy link
Member

n8maninger commented Nov 27, 2024

I disagree. Stick with simplicity and do a short contract with 1 benchmark = 1 contract. Cost difference is negligible, but the implementation is significantly simpler when you can assume a new contract will need to be formed and you don't need to manage existing contracts.

@CtrlAltDefeat94
Copy link

@n8maninger could you elaborate how the cost is negligible to create a new contract every time?

I did 2 benchmarks, one with 1 sector and one with 10 sectors. It looks like the the cost difference isn't too much. Both around 0.27SC
https://siascan.com/contract/bd469bdc5e7c40caabcd350845d5417f71749de661454f8ec7330554b67e3683
https://siascan.com/contract/4c60765acba8d85738feb56d3d28433af428444a59a37250015a1b93269e80e6

Running 10 benchmarks with each their own contract would cost around 2.7SC. If a single contract 10x the size would barely make a difference compared to a single contract, how would reusing contracts not make a significant difference?

Another thing. I feel like I would be spamming the blockchain a lot if I wouldn't reuse contracts. If I were to benchmark all hosts for example 4 times a day, with 500 hosts I would be creating 60K contracts a month, with roughly 4K of them active at a time. That's more than 10% of the current active contracts on the entire network.

I'm still a newbie on this side, any feedback/elaboration is welcome :)

@n8maninger
Copy link
Member

n8maninger commented Dec 11, 2024

Contract ID Sectors Initial Allowance Final Allowance Renter Cost Cost Per Sector
bd469bdc5... 1 0.002173 0.0007788 0.001394 0.001394
4c60765ac... 10 0.02173 0.007788 0.01394 0.001394

Looking at both of those contracts, the second one has about 10x more spent than the first. Most of the cost seems to be coming from the Siafund tax on the host's collateral, which looks like it is calculated inefficiently/incorrectly. However, it's still pretty negligible.

Spamming the blockchain isn't too terribly concerning. Onboarding more renters means more active contracts too, so I generally consider that a good thing.

Having said that, I would consider the goals when trying to benchmark the whole network 4x a day. Providing trends over a longer period of time will likely provide just as useful data than frequent benchmarks over such a short period. Also significantly increases infrastructure requirements as the network grows. It's probably fine at 500 hosts, but what about 5000?

@CtrlAltDefeat94
Copy link

CtrlAltDefeat94 commented Dec 11, 2024

Thanks for the explanation. The decimal place threw me off. Would've probably been better to use a different amount of sectors than 10 😛

As described in my grant request, I want to build a system to check hosts on interval and warn them if there are any issues.
I want to use benchmarks to determine whether hosts are actually writable. Since having free space and being online doesn't always confirm a host is able to receive data.
I'm still not sure about the interval to use, 4x was an example.

I might stick to only running benchmarks on hosts that subscribed to alerts.
Maybe there's an entirely different approach that would work better. I'm open to suggestions, but that's probably something for another place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants