[erlang-questions] count events within last XX minutes

Loïc Hoguin essen@REDACTED
Sun Aug 26 11:45:21 CEST 2012


On 08/26/2012 10:41 AM, Gleb Peregud wrote:
> On Sunday, August 26, 2012, Max Bourinov wrote:
>
>         Lately when working on project with up to a million concurrent
>         clients connected I had to replace few instances of central
>         servers with a public ets'es to avoid bottlenecks under heavy
>         concurrent access. So choice of data storage may depend on what
>         are access patterns of your data - i.e. how concurrent reads and
>         writes are.
>
>     That is a good point.
>
>     I have idea how to utilize ETS in my case too: one process will
>     write to ETS, and all other will read from ETS.
>
>     The question now: will it benefit me or not?
>
> Probably yes, if read_concurrency is enabled and you have enough
> concurrent processes reading data. The best way to answer for sure is to
> implement both and measure under some high load situation.

If he's using update_counter then he only needs write_concurrency. 
update_counter is a write operation that also returns the new value; if 
you update_counter with an increment of 0, then you just happened to 
read the value with a write context.

-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-questions mailing list