Each peer gets its "fair share" of our query-answering CPU. No floor: * that would let enough peers claim more than the whole budget between * them. A small share only slows a peer's queries, nothing else. */
| 641 | * that would let enough peers claim more than the whole budget between |
| 642 | * them. A small share only slows a peer's queries, nothing else. */ |
| 643 | static u64 peer_cpu_budget(const struct peer *peer) |
| 644 | { |
| 645 | return peer->daemon->cpu_budget_usec_limit |
| 646 | / peer_htable_count(peer->daemon->peers); |
| 647 | } |
| 648 | |
| 649 | /* usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth |
| 650 | * of quota burned in one go." */ |
no outgoing calls
no test coverage detected