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

better/more benchmarks using logstash-core-event-java #4481

Closed
colinsurprenant opened this Issue Jan 13, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@colinsurprenant
Copy link
Contributor

commented Jan 13, 2016

it would be interesting to run an exhaustive set of benchmark to compare both logstash-core-event and logstash-core-event-java implementations.

@colinsurprenant

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2016

After a small fix (#4594) in the Java Event JSON generation (yet uncommitted), these are the numbers using the tests currently in https://github.com/elastic/logstash-performance-testing comparing master using the legacy Ruby Event implementation and the new Java Event.

Bench Ruby Event Java Event % increase
simple line in/out 47480 83200 75%
simple line in/json out 50040 83840 67%
json codec in/out 30300 24400 -20%
line in/json filter/json out 31080 31960 3%
apache in/json out 44360 59000 33%
apache in/grok codec/json out 22680 27880 22%
syslog in/json out 6880 8360 22%

The only thing to note is that the tests using JSON deserialization are slowed down because of the double type conversion going on. The current deserializer produces a Ruby object tree which get passed to the new Event and is converted back to pure Java object. To fix this, I will introduce a new Event#from_json method which will bypass all type conversions altogether in the Java Event. The codec (or plugins) will be able to use use this method if it is exposed (for backward compatibility).

@colinsurprenant

This comment has been minimized.

Copy link
Contributor Author

commented Jan 30, 2016

I locally hacked a quick POC of Event#from_json to see how would look the json_lines deserialization:

Bench Ruby Event Java Event % increase
json codec in/out 30300 34160 12%

From -20% to 12%. Good.

@suyograo

This comment has been minimized.

Copy link
Member

commented Feb 2, 2016

Machine specs:

8 core CPU, bare metal box

$ lshw -short
WARNING: you should run this program as super-user.
H/W path       Device  Class          Description
=================================================
                       system         Computer
/0                     bus            Motherboard
/0/0                   memory         31GiB System memory
/0/1                   processor      Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
/0/100                 bridge         4th Gen Core Processor DRAM Controller
/0/100/2               display        Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Single LS instance was used for these tests. Configs are located here: https://github.com/elastic/logstash-performance-testing/tree/master/examples/config

@colinsurprenant

This comment has been minimized.

Copy link
Contributor Author

commented Feb 3, 2016

@suyograo actually, the benchmarks I did were on my local laptop.

  • MBP 13r, 2.8GHz, Core i7, OSX 10.11.3

In any case, the absolute TPS numbers are irrelevant, its the differential between both implementation that is interesting and should be similar when run on any hardware.

@colinsurprenant

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2016

closing. all benchmarks agree on the performance improvement here.

@suyograo

This comment has been minimized.

Copy link
Member

commented Mar 28, 2016

Reran benchmarks with 2.2.0 and latest 2.3.0 RC on machine specs mentioned here.

Logstash Configuration 2.2.0 Events/sec 2.3.0 Events/sec % increase
simple line in/out 95100 170160 79
simple line in/json out 116400 168613 44
json codec in/out 58216 99146 70
line in/json filter/json out 57879 68417 18
apache in/json out 92737 145029 56
apache in/grok codec/json out 55129 65155 18
syslog in/json out 18663 22248 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.