Cache the value of the function port from k8s api#11
Conversation
andresmgot
left a comment
There was a problem hiding this comment.
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?
|
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. |
|
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? |
|
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) |
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. |
|
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 And check if that helps. |
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: