Better HN
topnewbestaskshowjobs
Log inSign up

yogeshpandey

5 karma · joined May 29, 2018 (8y ago) · 8 submissions

Submissions

comment 8y ago · link · parent

Thanks, The counters are synced in CRDT way , every node has both local and global counters and local counter are synced asynchronously with global counter periodically or on certain events. Usually the rates would be defined in a period of few minutes or seconds. So after the window is over the counter value will vanish automatically. so making counter durable seems unnecessary overhead as of now. But durability can be added in project if the need comes

comment 8y ago · link · parent

Yes that's what I meant. The best size from Ipv4 is 4 bytes. Its better instead of using 111.111.111.111

comment 8y ago · link · parent

absolutely right, Unix sockets are quite faster than even loopback tcp connections. We have plan to introduce that in roadmap. But to start with we wanted to cover general usecases first. Http interface also make it platform independent. Infact loopback tcp connections are also giving decent performance as the requests are routed though different interface

comment 8y ago · link · parent

Can you please elaborate more on the usecase

comment 8y ago · link · parent

Agree with this. Space used by keys can be reduced by hashing the key. Or for IPs they can be converted to an int value.

comment 8y ago · link · parent

Sadly ringpop is no more active. But in golimit we are using just clustering constructs of ringpop, which seems to be quite stable in latest version.

We are using distributed counter for rate calculation. Every node stores a local and global counter value. Rate limit is applied on local+global value. The local value is synced periodically on configured interval or when local counter threshold exceeds a configured threshold value.

comment 8y ago · link · parent

Golimit tries to reuse the allocated keys counter entry in case the counter has expired and its not collected by GC. There is a very simple GC logic where GC is invoked periodically, and scans for all buckets one by one and cleans them up. The GC invocation frequency can be configured by setting "gcinterval" property in yaml.

comment 8y ago · link · parent

you can write LUA code in Haproxy to call golimit on http endpoint. and react based on response