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

How the cost works? #84

Closed
woodliu opened this issue Apr 19, 2024 · 4 comments
Closed

How the cost works? #84

woodliu opened this issue Apr 19, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@woodliu
Copy link

woodliu commented Apr 19, 2024

Every node has a cost value, when add a node otter will compare the node cost with the policy.MaxAvailableCost(), if it is larger than later, otter will reject to add this node.
I don't fullt understand how the cost infect the s3-FIFO policy. As i know, in s3-FIFO, the length of the queues of s3-FIFO is limited by the cost, a node with large cost will occupy more queue space, but the cost won't affect the evict sequence.
So what the cost does to the otter, will it improve some performance or hit rate in some cases?

@woodliu woodliu added the enhancement New feature or request label Apr 19, 2024
@maypok86
Copy link
Owner

You have described everything correctly. Such entries are rejected because inserting them will lead to a severe drop in the hit ratio. The queue will be completely cleared and most of the entries in it will be deleted, since they most likely have not been accessed.

@woodliu
Copy link
Author

woodliu commented Apr 22, 2024

You have described everything correctly. Such entries are rejected because inserting them will lead to a severe drop in the hit ratio. The queue will be completely cleared and most of the entries in it will be deleted, since they most likely have not been accessed.

How about remove the cost from node, that means every node will have a cost==1, what will happened if we remove the cost or set all nodes's cost == 1?

@maypok86
Copy link
Owner

This is the most common scenario, but there are cases when the cost (bytes) of entries differs very much in the workload, which is why this parameter is introduced.

@woodliu
Copy link
Author

woodliu commented Apr 23, 2024

This is the most common scenario, but there are cases when the cost (bytes) of entries differs very much in the workload, which is why this parameter is introduced.

That make sense, it can limit the memory by this parameter😁

@woodliu woodliu closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants