Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Overrepresented function during profiling: add_elasticsearch_index_name_field #21

Open
blofroth opened this issue May 31, 2019 · 1 comment

Comments

@blofroth
Copy link

We were troubleshooting some performance issues of fluentd in an Openshift cluster, and experimented with running the Rbspy sampling profiler on a running fluentd pod when we had full queues. See attached flamegraph. We see that a block in "add_elasticsearch_index_name_field" is active in 35% of sampled stack frames.

loadedFluentdFlamegraph

Note: in the end it seems our main bottleneck was a slow syslog server, so maybe this does not indicate an issue for any users.

I figured I would at least report it, since it could be an interesting data point.

I'm not a Ruby developer, but just skimming this
https://www.monitis.com/blog/20-ruby-performance-tips/

I would guess it could have something to do with date parsing when constructing the "elasticsearch_index_name"

@richm
Copy link
Member

richm commented May 31, 2019

I suppose as an optimization we could see if the time string is already in rfc3339 format, and do a string value extraction rather than parse + strftime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants