Giter Site home page Giter Site logo

Performance issue about carbon-relay-ng HOT 6 CLOSED

grafana avatar grafana commented on August 21, 2024
Performance issue

from carbon-relay-ng.

Comments (6)

Dieterbe avatar Dieterbe commented on August 21, 2024

this should fix it f1d6f48

from carbon-relay-ng.

Dieterbe avatar Dieterbe commented on August 21, 2024

btw

~/g/s/g/g/carbon-relay-ng ❯❯❯ go test -bench=Send -run=XXX
PASS
BenchmarkSendAndReceive        1    1001640486 ns/op
ok      github.com/graphite-ng/carbon-relay-ng  2.622s

1second to send 1000 metrics. unacceptable of course. i will on some profiling and optimisations (right now it's spending way too much time in GC)

from carbon-relay-ng.

Dieterbe avatar Dieterbe commented on August 21, 2024

actually, those numbers are offset because it needs to initiate the connection the testendpoint first.
also i did some GC/malloc fixes

$ go test -bench=Send -run=XXX
PASS
BenchmarkSendAndReceiveThousand        1    1004344092 ns/op # 995 metrics/s
BenchmarkSendAndReceiveTenThousand         1    1004823407 ns/op # 9951 metrics/s
BenchmarkSendAndReceiveHundredThousand         1    5006029614 ns/op # 19975 metrics/s
BenchmarkSendAndReceiveMillion         1    47004007110 ns/op # 21274 metrics/s
ok      github.com/graphite-ng/carbon-relay-ng  54.088s

so clearly for the lower amounts the connection overhead is the deciding factor, then it goes up to about 20k metrics/s or 1.2M per minute, this should be enough for me, but i might tune it a bit more.

your thoughts/findings?

from carbon-relay-ng.

Dieterbe avatar Dieterbe commented on August 21, 2024

also note the test now sleeps 10 microseconds between every metric send because if the connection is slow the sender will drop packets and we don't want this in the tests. it's a little too "sensitive" in the current code, i should probably look into this and improve this but anyway because of this it's artificially capped to 100k per second.

from carbon-relay-ng.

Dieterbe avatar Dieterbe commented on August 21, 2024

running idle, carbon-relay-ng takes about 0.5% cpu for me now :)

from carbon-relay-ng.

pwielgolaski avatar pwielgolaski commented on August 21, 2024

it looks much better now, thx

from carbon-relay-ng.

Related Issues (20)

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.