Evaluating Knative-Eventing

41 views
Skip to first unread message

Pankaj Chaudhary

unread,
May 28, 2021, 5:02:51 PMMay 28
to Knative Users
Hi,

We are evaluating Knative as our Serverless platform and are in pretty initial phase, so please excuse me if some questions sound too naive.

During our PoC phase we faced some issues, so would love to hear how other members have solved this issue. We are using Java (Spring Boot & Spring Cloud projects), postgres db & Kafka as our broker.

Challenges faced:
1. The cold start time for the application was around 20 sec.
     (We tried GraalVM but found it tedious too get it working consistently)
2. We are using KafkaSource CRD's that keeps 1 pod of KafkaSource running all the time,
      which reduced cost optimization factor. Is there any alternate way?
3. How is observability managed in this volatile environment (tracing, metrics and
      monitoring) 

Would love to talk to people if they are open to connect.

Regards,
Pankaj.
Message has been deleted
Message has been deleted
Message has been deleted

Evan Anderson

unread,
May 28, 2021, 6:48:27 PMMay 28
to Knative Users

Hi Pankaj,

Thanks for trying out Knative! It would be awesome to hear more about your experiences developing with and running Knative! A list of "top 5 pain points" and "5 things that really helped" would be great for those of us inside the project; when you work on something from day to day, you forget what it looks like from the outside.

On Friday, May 28, 2021 at 2:02:51 PM UTC-7 Pankaj Chaudhary wrote:
Hi,

We are evaluating Knative as our Serverless platform and are in pretty initial phase, so please excuse me if some questions sound too naive.

During our PoC phase we faced some issues, so would love to hear how other members have solved this issue. We are using Java (Spring Boot & Spring Cloud projects), postgres db & Kafka as our broker.

Challenges faced:
1. The cold start time for the application was around 20 sec.
     (We tried GraalVM but found it tedious too get it working consistently)

There are a few knobs you can adjust here; I'm basing it off this blog post, which is a few years old. I'll see if the Spring Boot folks have any better suggestions / updates.

* See if you can switch to Spring WebFlux, which seemed to be good for about 50% cold start time reduction 17s -> 9s in the mentioned post
* Packaging with Jib rather than a Dockerfile was good for another 50% in Guillaume's testing of a small app. I'd expect that using buildpacks instead of Dockerfiles might also get a lot of these benefits.

(My first sending failed, so here's an update from the Spring Boot folks):

Based on this blog post, you should be able to go from start.spring.io to a native image with mvn spring-boot:build-image, which should have <100ms startup time, at the cost of possibly 15-20x compilation time (10s -> 200s for a JDBC app).
 
2. We are using KafkaSource CRD's that keeps 1 pod of KafkaSource running all the time,
      which reduced cost optimization factor. Is there any alternate way?

You'll still end up with a pod running for the cluster, but you might look at KEDA for scaling the KafkaSource's reader; KEDA should be able to scale the reader based on the Kafka queue length, including scaling a particular Kafka reader down to zero. There are some current experiments doing this, but they aren't yet production ready. I believe that the KafkaSource has also implemented a multi-tenant source so one container should be able to be shared across multiple projects and namespaces, but I'm not familiar enough to be 100% sure.
 
3. How is observability managed in this volatile environment (tracing, metrics and
      monitoring) 

We've got the start of some documentation in the new administrator's guide (coming in the next release, preview here), but metrics, logging and traces _should_ all work with your existing Kubernetes integrations and tools (e.g. Splunk, ELK, etc for metrics, Prometheus, Stackdriver, Datadog, Wavefront, etc for metrics & traces).

Salaboy Mauricio Salatino

unread,
May 29, 2021, 2:57:50 AMMay 29
to Evan Anderson, Knative Users
Hi there.. 
feel free to connect with me on LinkedIn or via email. I am also a Java, spring cloud developer and had some experience with the topics that you mentioned.

Usually, for cold starts with Java it’s about two things.. the Java startup itself and the resources allocated to the container. If the Java app starts fast in your laptop but not when running inside a container, that’s container resource allocations hitting you there.

Regarding Kafka Broker, that is part of the infrastructure for running your application, some components just need to be there for things to work. Serverless doesn’t mean that there are no servers or things running. Can you share your requirements around this? Because sometimes it is just the desire of showing that nothing is running. 

For metrics I believe that you can use any tools that you are already using, are you experiencing problems with this? 

Cheers 

Mauricio 

Sent from my iPhone

On 28 May 2021, at 23:48, Evan Anderson <evan.k....@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "Knative Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knative-users/716e7dfb-743e-469e-84d0-3709ad339570n%40googlegroups.com.

Ville Aikas

unread,
May 29, 2021, 7:10:16 AMMay 29
to Pankaj Chaudhary, Knative Users

--
You received this message because you are subscribed to the Google Groups "Knative Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.

Oliver Hughes

unread,
May 29, 2021, 9:47:41 AMMay 29
to Ville Aikas, Pankaj Chaudhary, Knative Users
Hi

The slow cold start time with the spring boot app might be caused by cpu requests being set too low. I have found setting cpu requests to 1 makes a dramatic improvement to start up time. Also look at memory allocation and JVM flags 

Thanks 
Ollie Hughes

Sent from my iPhone

On 29 May 2021, at 12:10, Ville Aikas <vai...@gmail.com> wrote:



Lionel Villard

unread,
May 31, 2021, 9:35:59 AMMay 31
to vai...@gmail.com, knativ...@googlegroups.com, pankaj.c...@rkusbu.com
Hi Pankaj,
 
for KafkaSource, you can try the multi-tenant KafkaSource implementation (see mt-source.yaml) to see if it works better for you. Both, the default KafkaSource and the multi-tenant KafkaSource implementations are compatible with https://github.com/knative-sandbox/eventing-autoscaler-keda.
 
 
Lionel  
 
 
----- Original message -----
From: Ville Aikas <vai...@gmail.com>
Sent by: knativ...@googlegroups.com
To: Pankaj Chaudhary <pankaj.c...@rkusbu.com>
Cc: Knative Users <knativ...@googlegroups.com>
Subject: [EXTERNAL] Re: Evaluating Knative-Eventing
Date: Sat, May 29, 2021 7:10 AM
 
For the kafka source, you can use: https://github.com/knative-sandbox/eventing-autoscaler-keda And in particular: https://github.com/knative-sandbox/eventing-autoscaler-keda#example-of-kafka-source-autoscaled-by-keda Which should scale it for ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd

Reply all
Reply to author
Forward
0 new messages