Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Cache the value of the function port from k8s api#11

Open
dannyqiu wants to merge 3 commits into
vmware-archive:masterfrom
dannyqiu:master
Open

Cache the value of the function port from k8s api#11
dannyqiu wants to merge 3 commits into
vmware-archive:masterfrom
dannyqiu:master

Conversation

@dannyqiu

Copy link
Copy Markdown

Issue Ref: vmware-archive/kubeless#826

Description:

Address the issue of constantly hitting the k8s api to get the port associated with a function. We only need to retrieve this value once upon creating the consumer process.

TODOs:

  • Ready to review
  • Automated Tests
  • Docs

@andresmgot andresmgot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @dannyqiu, thank you for this PR!

I think we are overcomplicating the solution a little bit here. For me a better solution would be to directly remove any call to the K8s API (see vmware-archive/kubeless#826). In my opinion (and we have talked about this in the past) we should remove the possibility of specifying a custom port and use always the port 8080.

For this case I would just add an env var FUNC_PORT that if is set is used instead of calling utils.GetFunctionPort. That way we don't need any complex code nor the dependency you are adding. What do you think?

@dannyqiu

Copy link
Copy Markdown
Author

I agree that a simpler solution can be used. I like the idea of enforcing the port to be 8080, since this is already the default behavior if you don't use a custom deployment.

@wayne-thomson-cxa

Copy link
Copy Markdown

Hi there. I also seem to be experiencing the 5qps limitation reportd in kubeless/kubeless#826). Was this fix abandoned or replaced by something else?

@andresmgot

Copy link
Copy Markdown
Contributor

we never changed this but I don't think that a limitation of 5 qps is a limitation because of calls to the kubernetes API. See the discussion here: vmware-archive/kubeless#826 (but unfortunately no progress there)

@wayne-thomson-cxa

Copy link
Copy Markdown

we never changed this but I don't think that a limitation of 5 qps is a limitation because of calls to the kubernetes API. See the discussion here: kubeless/kubeless#826 (but unfortunately no progress there)

Thanks @andresmgot. I have read that. Do you have better throughput in clusters you are working with than 5 messages per second or do you experience the same behavior also? I thought from these two threads that wdamron and @dannyqiu identified the k8s API as the issue (hence this issue)?

Whether my topic has 1 or 10 partitions which my producer writes to the consumers seem be be 5/s per controller. As I increase the number of controllers I see a corresponding linear throughput. I just want to check that I am not doing something wrong.

@andresmgot

Copy link
Copy Markdown
Contributor

You are probably don't. I think this issue was never fixed but I doubt the bottle neck is the K8s API for resolving the port. If you have time to investigate it, you can modify the function getFunctionPort to simply return 8080:

https://github.com/kubeless/kafka-trigger/blob/68a3798a36e725fb15c2dac4d4dc56274d075c3b/pkg/utils/event_sender.go#L40

And check if that helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants