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

Reduce heap-memory usage of ingest-geoip plugin #28963

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we reduce heap usage of the ingest-geoip plugin by
memory-mapping the database files. Previously, we have stored these
files gzip-compressed but this has resulted that data are loaded on the
heap.

Closes #28782

With this commit we reduce heap usage of the ingest-geoip plugin by
memory-mapping the database files. Previously, we have stored these
files gzip-compressed but this has resulted that data are loaded on the
heap.

Closes elastic#28782
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -80,28 +80,38 @@
if (Files.exists(geoIpConfigDirectory) == false && Files.isDirectory(geoIpConfigDirectory)) {
throw new IllegalStateException("the geoip directory [" + geoIpConfigDirectory + "] containing databases doesn't exist");
}

boolean loadDatabaseOnHeap = Booleans.parseBoolean(System.getProperty("es.geoip.load_db_on_heap", "false"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to this escape hatch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this escape hatch? If this is to remain undocumented (which is should if it is kept as a sysprop), what would eventually allow us to remove this untested behavior?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed until we have a better understanding of the implications on nodes with small amounts of native memory.

@@ -68,8 +67,7 @@
private final Set<Property> properties;
private final boolean ignoreMissing;

GeoIpProcessor(String tag, String field, DatabaseReader dbReader, String targetField, Set<Property> properties,
boolean ignoreMissing) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing unused exception.

@danielmitterdorfer
Copy link
Member Author

I want to let this run through CI on master and will then backport accordingly later today.

danielmitterdorfer added a commit that referenced this pull request Mar 12, 2018
With this commit we reduce heap usage of the ingest-geoip plugin by
memory-mapping the database files. Previously, we have stored these
files gzip-compressed but this has resulted that data are loaded on the
heap.

Closes #28782
danielmitterdorfer added a commit that referenced this pull request Mar 12, 2018
With this commit we reduce heap usage of the ingest-geoip plugin by
memory-mapping the database files. Previously, we have stored these
files gzip-compressed but this has resulted that data are loaded on the
heap.

Closes #28782
@danielmitterdorfer
Copy link
Member Author

Backports:

The backport to 5.6 is still pending. I want to discuss this with Martijn first because #27958 (added support for ASN) is missing as well. Depending on the result of the discussion I'd not backport at all to 5.6 or open a separate PR. I'll provide an update here after our discussion.

@jasontedor
Copy link
Member

I don't think this should have backported to 6.2, and I don't think it should be backported to 5.6. It is an enhancement more than it is a bug fix and we do not do those in patch releases.

@danielmitterdorfer
Copy link
Member Author

Ok, I agree. So let's not backport it to 5.6. Do you want me to revert the backport to 6.2?

@jasontedor
Copy link
Member

Please do. I would also add a migration note (it's not a breaking change) to the 6.3 migration docs if you could please.

danielmitterdorfer added a commit that referenced this pull request Mar 12, 2018
@danielmitterdorfer
Copy link
Member Author

Reverted on 6.2 in 3a92555. I can also add a migration note later.

danielmitterdorfer added a commit to danielmitterdorfer/elasticsearch that referenced this pull request Mar 13, 2018
This commit adds a note to the 6.3 docs that Geoip database files are
now stored uncompressed.

Relates elastic#28963
@danielmitterdorfer
Copy link
Member Author

I've now opened #29006 to add migration docs for 6.3.

danielmitterdorfer added a commit that referenced this pull request Mar 13, 2018
This commit adds a note to the 6.3 docs that Geoip database files are
now stored uncompressed.

Relates #28963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >enhancement v6.3.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants