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

Try to speed up kafka admin CLI invocations #25

Closed
wants to merge 51 commits into from
Closed

Conversation

solsson
Copy link
Owner

@solsson solsson commented Jun 13, 2019

... using native image ideally. If that fails a small improvement might be achieved by bypassing the shell wrapper and reducing the volume of classpath libs.

./bin/kafka-topics.sh to kafka-topics is the first step, but it currently fails on GraalVM native-image with jopt-simple.

solsson added 14 commits June 11, 2019 05:18
based on the observation that, bar custom env, the analysis done at every start is static.
Utilities that run as for example kube jobs could be speedier if we mod the entrypoint.
Might still be useful becasue it hides the hideous classpath string

and is less picky than regular java invocations in CLI args ordering
but why does it require the lz4 lib at all for mere topic admin?
The stack trace indicates an issue in CompressionType which could be
what is worked around in
https://github.com/quarkusio/quarkus/tree/0.16/extensions/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/graal

Can we instead block analysis before it ends up in CompressionType stuff,
for the topic admin use case?
... and with these resource limits it takes ~20s on my local dev cluster.
@solsson
Copy link
Owner Author

solsson commented Jun 15, 2019

solsson/kafka-topics@sha256:3506069ce16ee683352d7d9811f0588f4433bdd584985186a095352b76ecafeb

solsson added 15 commits June 17, 2019 06:46
Caused by: java.lang.InstantiationException: Type `sun.security.provider.ConfigFile` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
"or the no-parameter constructor has not been added explicitly to the native image"
com.fasterxml.jackson.databind.ext.Java7Support <clinit>
WARNING: Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
@solsson
Copy link
Owner Author

solsson commented Dec 23, 2019

Did some experiments with Kafka 2.4.0 (as Yolean/kubernetes-kafka#297 says it would be great to not have to specify replication factor and partitions in topic-create jobs) but I think we should wait until Quarkus is at Graal 19.3.0 and Kafka 2.4.0. Currently builds fail with:

Parameter 0 of org.apache.kafka.common.utils.Utils.closeQuietly(AutoCloseable, String) has declared type java.lang.AutoCloseable which is incompatible with types in state
...
Detailed message:
Call path from entry point to org.apache.kafka.common.utils.Utils.closeQuietly(AutoCloseable, String): 
	at org.apache.kafka.common.utils.Utils.closeQuietly(Utils.java:832)
	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1220)

@solsson
Copy link
Owner Author

solsson commented Jul 10, 2020

#29 builds on the discoveries from this PR and produces up to date images solsson/kafka:native-cli.

@solsson solsson closed this Jul 10, 2020
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.

1 participant