Giter Site home page Giter Site logo

elfo's People

Contributors

goldsteine avatar jazvit avatar l4l avatar laplab avatar leonqn avatar loyd avatar quasiyoke avatar ricogit avatar sargarass avatar white-oak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elfo's Issues

Print error's backtraces

  • Custom eyre's handler that captures backtrace at the moment of error.
  • Remove all frames starting at the exec function to provide short traces.
  • Print error.stack = [...] in logger.

Detect hanging actors

An actor containing an infinite loop cannot be detected by elfo_busy_time_seconds for now, because the metric is updated after polling the actor's future. Thus, we need to have a way to calculate the metric also outside of the polling.

One possible implementation is to have some "global" ThreadLocal<(Addr, Timestamp)> (thread_local). Before polling the future we can store here the current actor's address and ts. Then, the special actor iterates over it periodically and updates the metric.

However, it requires a way to emit metrics with a custom ActorMeta. Also requires #8

Revise `UpdateConfig` and `ConfigUpdated` mechanism

  • ValidateConfig should be discarded by default.
  • UpdateConfig should bypass a mailbox UpdateConfig shouldn't be sent as request.

It should highly decrease the time of config updating in case of many actors.

Metrics for responses

ctx.request(..).await doesn't produce any metric for responses. Actually, we produce no special counters for all incoming messages, but it's ok for incoming via the mailbox metrics because there is elfo_handling_time_seconds_count.

The sump for hanging actors

There is no protection against hanging tasks (e.g. due to an infinite loop) in tokio.

One possible way is to have one dedicated CPU for threads with hanging actors. Once a hanging actor is detected, all other tasks should be moved to other threads. Then, we can set the affinity of the thread to the sump CPU. All hanging actors will share the same CPU and rely on OS's scheduler.

Unlikely it's possible to do using tokio's scheduler because of a leak of the appropriate API.

Improve actors' budgets

Now we're limiting the number of recv() calls to avoid starving other actors on the same scheduler's thread.

However, there are several ways to improve it:

  • Reset the counter if the mailbox is empty. Requires moving to try_recv() + separate recv().await calls.
  • (Need to discuss it). If the current timestamp is calculated already (e.g. for metrics), check the elapsed time instead of just counter.

Merge config sections

Works fine:

[common]
system.logging.targets.hyper.max_level = "Info"
[a]
system.logging.targets.reqwest.max_level = "Info"

Broken:

[common.system.logging.targets]
hyper.max_level = "Info"

[a]
system.logging.targets.reqwest.max_level = "Info"

Work better with `tokio::select`

Actors can use tokio::select, but the elfo_message_handling_time_seconds metric isn't calculated correctly, which breaks the calculation of utilization. Maybe we need another way to calculate utilization?

Dumping: per class settings

We can configure the dumping only for all classes at the same time. Add a way to override settings for specific classes.

Revise `elfo_busy_time_seconds`

The metric is expensive for two reasons:

  • It's emitted on every polling, which should be too expensive in the case of tokio::task::yield_now() or for a lot of fast handled messages.
  • It's a histogram metric, the most expensive of all types.

Instead, we can calculate separately elfo_busy_time_seconds_max, elfo_busy_time_seconds_sum and elfo_busy_time_seconds_count. It's enough for most use cases.

A custom panic handler

We don't need to print panics inside actors, because they are handled by the supervisor. Or we need to print them using the logger.

Label ordering matters

register_gauge!("test", "a" => "a", "b" => "b");
register_gauge!("test", "b" => "b", "a" => "a");

rendered:

test{actor_group="reporters",a="a",b="b"} 0
test{actor_group="reporters",b="b",a="a"} 0

Metrics about the dump storage usage

  • elfo_emitted_dumps_total, elfo_limited_dumps_total, elfo_lost_dumps_total, elfo_written_dumps_total
  • elfo_dumps_usage_bytes, elfo_dumps_usage_items
  • elfo_dumps_capacity (in elements? in parts?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.