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

Filterx performance improvements #400

Merged
merged 13 commits into from
Dec 2, 2024

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Dec 1, 2024

These are the smaller micro optimizations I was doing on filterx_expr_eval(). The improvement:

branch:

(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 90635.76 msg/sec, count=952000, time=10.5036, (average) msg size=256, bandwidth=22658.94 kB/sec
(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 97369.38 msg/sec, count=974000, time=10.0031, (average) msg size=256, bandwidth=24342.34 kB/sec
(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 94165.86 msg/sec, count=989000, time=10.5027, (average) msg size=256, bandwidth=23541.46 kB/sec

main (e654f38):

(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 65314.82 msg/sec, count=686000, time=10.503, (average) msg size=256, bandwidth=16328.70 kB/sec
(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 64745.14 msg/sec, count=680000, time=10.5027, (average) msg size=256, bandwidth=16186.28 kB/sec
(dbld)bazsi@bzorp2:/source$ /install/bin/loggen -r 1000000 -s 256 -I 10 -S localhost 2000  
average rate = 65125.94 msg/sec, count=684000, time=10.5027, (average) msg size=256, bandwidth=16281.48 kB/sec

bazsi added 8 commits December 1, 2024 13:59
The references for these variables in _search() are already dropped
as filterx_generator_create_container_new() takes those references over.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
To avoid it using almost an entire cacheline in FilterXExpr.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi bazsi force-pushed the filterx-performance-improvements branch from 67ac610 to dbddfc2 Compare December 1, 2024 13:14
@MrAnno
Copy link
Member

MrAnno commented Dec 1, 2024

Can you please share your configuration as well?

(I tried to measure the perf diff of this branch using our internal configs without success.)

$ bin/loggen -r 1000000 -s 256 -I 20 -S localhost 514 #bazsi:filterx-performance-improvements
average rate = 15313.40 msg/sec

$ bin/loggen -r 1000000 -s 256 -I 20 -S localhost 514 #main
average rate = 14984.77 msg/sec

MrAnno
MrAnno previously approved these changes Dec 1, 2024
bazsi added 5 commits December 2, 2024 08:47
…very iteration

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ront

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Otherwise we had a lot of clock_gettime() calls.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi
Copy link
Member Author

bazsi commented Dec 2, 2024

Oh, I didn't see the review results, and push a couple more patches. Can you re-approve?

My config was a lot simpler:

@version: current

log {
	source { tcp(port(2000) flags(no-parse) log-iw-size(10k) log-fetch-limit(10k)); };

	filterx {
		meta = json();
		meta.splunk = json();
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
		meta.splunk.index = "foo";
		meta.splunk.host = "bar";
		meta.splunk.sourcetype = "baz";
		meta.splunk.sourcetype = "bax";
	};

	destination { file("/dev/null"); };
};

Also I noticed that my CPU governor was playing tricks

@MrAnno
Copy link
Member

MrAnno commented Dec 2, 2024

Thank you. I will do my usual measurements too, but I don't see a reason to delay the merge of these commits.

@MrAnno MrAnno merged commit 2246b77 into axoflow:main Dec 2, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants