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

Disable shim logging to stdout #17

Closed
radu-matei opened this issue Feb 22, 2024 · 2 comments · Fixed by #19
Closed

Disable shim logging to stdout #17

radu-matei opened this issue Feb 22, 2024 · 2 comments · Fixed by #19
Labels
bug Something isn't working

Comments

@radu-matei
Copy link
Member

radu-matei commented Feb 22, 2024

The way containerd handles shim logging, there is a ~17x performance penalty right now to throughput for a Spin application running through the shim because of logging to stdout:

Simple test on my current machine with the current version of the Spin shim:

Statistics        Avg      Stdev        Max
  Reqs/sec      7987.75    1452.81   24490.93
  Latency       63.75ms    34.08ms   290.82ms
  HTTP codes:
    1xx - 0, 2xx - 80503, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     1.22MB/s

Compared against a branch that hard disables all logging per request:

Statistics        Avg      Stdev        Max
  Reqs/sec    149855.88    6520.46  163453.38
  Latency        3.41ms   735.86us    56.52ms
  HTTP codes:
    1xx - 0, 2xx - 1498034, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    22.85MB/s

Note: setting the containerd --log-level flag seems to have no effect, so I had to manually go through the dependencies of the shim and comment out info logging...

cc @Mossaka @jsturtevant

@radu-matei radu-matei added the bug Something isn't working label Feb 22, 2024
@jsturtevant
Copy link
Contributor

Note: setting the containerd --log-level flag seems to have no effect, so I had to manually go through the dependencies of the shim and comment out info logging...

this is coming from https://github.com/containerd/rust-extensions/blob/cc445f54c0fa8e9b35376550874422c932ad1566/crates/shim/src/logger.rs#L135-L139

Temporarily you should be able to disable logging via:

https://github.com/containerd/rust-extensions/blob/cc445f54c0fa8e9b35376550874422c932ad1566/crates/shim/src/synchronous/mod.rs#L257

example:

    shim_main::<WasmtimeInstance>("wasmtime", version!(), revision!(), "v1", Some(Config{no_setup_logger: true, ..Default::default()}));

@jsturtevant
Copy link
Contributor

I've got a change that could help here: containerd/rust-extensions#247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants