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

Scale fission function pods per function call #2944

Open
LyKos4 opened this issue May 17, 2024 · 7 comments
Open

Scale fission function pods per function call #2944

LyKos4 opened this issue May 17, 2024 · 7 comments

Comments

@LyKos4
Copy link

LyKos4 commented May 17, 2024

What I need?
I need to scale up fission function pods when same function is called multiple times.

What happens now?
If a do eg. 3 requests of the same fission function, on pod will be up to run all those 3 which causes a delay.
I can see that by running fission function pods --fnNamespace=(namespace) --name=(function_name)

What I have tried?
I tried to set --concurrency 1 or --yolo true. Both indeed create new pods each time a fission function is called but then for the same piece of code new pods are created. So multiple pods are created for same call of a fission function which at the end doesn't seem to get the expected results.

Is there a way to create only on new fission-function pod each time a fission functionis supposed to run?

@soharab-ic
Copy link
Contributor

@LyKos4 Have you tried increasing the concurrency?

  • If you set the --concurrency=5 and sent 3 requests then 3 pods will be created to handle each request.
  • If you again sent 5 request then already created pods will handle the requests or some additional pods are created to handle the requests, max upto 5 pods.

@LyKos4
Copy link
Author

LyKos4 commented May 20, 2024

Yes, I have tried changing concurrency, yolo and rpp.
What I want to achieve is to have 1 pod to handle each function run.
If I want to run 5 times a function to have 5 pods each running once the function

@soharab-ic
Copy link
Contributor

In that case --yolo should work.

fission function create --name hello-go --env go --src hello.go --entrypoint Handler --yolo
  • A new specialized pod will be created for each function run and the pod will serve only one request in its lifetime. It will be cleaned up after two minutes.

Did you see a different behaviour with yolo or did i misunderstood your requirement?

@LyKos4
Copy link
Author

LyKos4 commented May 20, 2024

With yolo true there were more that one pods created for a function run.
So I start a function run one pod is created, but then this one is closed and another one is opened for same function and this happens multiple times, also at the end I don't get the results of my function . I want one pod per function run.

@soharab-ic
Copy link
Contributor

This should not happen. Only one pod per function call is created with yolo.
Are you sure that you are not mistaking envionment pods with specialized/function pods?

@LyKos4
Copy link
Author

LyKos4 commented May 20, 2024

I am talking for the fission function pods and I am checking which run a specific function with the command fission function pods --fnNamespace=(namespace) --name=(function-name)
So for same function for which I had done one request for running it, I saw one pod closing and then another coming up

@soharab-ic
Copy link
Contributor

Please try below steps and post the results if you see different results. I am using default namespace.

  1. Create an environment
fission env create --name go --image fission/go-env-1.16 --builder fission/go-builder-1.16

Check for env pods

$ kubectl get po
NAME                                         READY   STATUS    RESTARTS   AGE
go-566077-67589cbc99-vrgtj                   2/2     Running   0          100s
poolmgr-go-default-566077-576d64cd9b-brm9h   2/2     Running   0          100s
poolmgr-go-default-566077-576d64cd9b-lwn8x   2/2     Running   0          100s
poolmgr-go-default-566077-576d64cd9b-x2dgz   2/2     Running   0          100s
  1. Create function with yolo set to true
fission function create --name hello-go --env go --src hello.go --entrypoint Handler --yolo

Verify that no function pods exist at the moment.

$ fission fn pods --name hello-go
NAME  NAMESPACE  READY  STATUS  IP  EXECUTORTYPE  MANAGED
  1. Test the function and verify one function function pod is created.
$ fission fn test --name hello-go
Go, world!
$ fission fn pods --name hello-go
NAME                                        NAMESPACE  READY  STATUS   IP            EXECUTORTYPE  MANAGED  
poolmgr-go-default-566077-576d64cd9b-brm9h  default    2/2    Running  10.244.1.155  poolmgr       false
  1. Run the test again and verify that now there are two function pods.
$ fission fn test --name hello-go
Go, world!
$ fission fn pods --name hello-go
NAME                                        NAMESPACE  READY  STATUS   IP            EXECUTORTYPE  MANAGED  
poolmgr-go-default-566077-576d64cd9b-brm9h  default    2/2    Running  10.244.1.155  poolmgr       false    
poolmgr-go-default-566077-576d64cd9b-lwn8x  default    2/2    Running  10.244.1.154  poolmgr       false

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

No branches or pull requests

2 participants