Back

Adding Support for More Executors

  • 0
  • Self Hosted
  • Functions
futurmaster
28 Nov, 2023, 18:13

There is a proxy in front of the executor

TL;DR
The user is discussing the need to add more support for executors to handle multiple requests efficiently. They mention the Knative concept as a good model to study and suggest having a single parent executor with multiple child executors to handle requests. The user also highlights the importance of understanding Linux PID and how Docker containers function in this context. There are discussions about scaling and load balancing solutions, such as increasing the number of function workers and instances of the executor. The user is currently working on a Kubernetes adapter but hasn't found a successful solution yet.
Drake
28 Nov, 2023, 18:14

*runtime container

futurmaster
28 Nov, 2023, 18:14

Oh yes I'm a bit confused about the naming πŸ˜„

ZachHandley
28 Nov, 2023, 18:15

Okay so

TypeScript
1. Increase the number of Function Workers
2. Increase the number of instances of the executor and figure out a good load balancing solution
futurmaster
28 Nov, 2023, 18:15

As I saw you can't increase the number of function workers

Drake
28 Nov, 2023, 18:16

I would increase the number of function workers first since that's easier

Drake
28 Nov, 2023, 18:16

If you're using swarm, you can increase the number of replicas.

If you just have a docker-compose.yml file, you can try duplicating the service in the compose file

futurmaster
28 Nov, 2023, 18:17

Anyway I'm working on the Kubernetes adapter to can use open-runtime in Kubernetes environment and tried to find a better solution how can scale it more efficiently but until now without any success

ZachHandley
28 Nov, 2023, 18:17

hm interesting

ZachHandley
28 Nov, 2023, 18:17

What have you tried if you don't mind me asking?

futurmaster
28 Nov, 2023, 18:23

As I mentioned the main problem is the design concept. The executor manages their own runtime containers. Start them up and keep running and send them the necessary commands. The only solution that I found is to increase the number of executors, so every executor can manage their own containers, but we have to pay attention to the proxy too because the proxy always try to redirect the function invocation request to that executor which has the right container but doesn't deal with it if that container is still working on the previous task or not

futurmaster
28 Nov, 2023, 18:24

The best concept would be near the same as Knative built up and working

Drake
28 Nov, 2023, 18:25

Executor can handle multiple requests. Runtime containers can handle multiple requests. Where is the problem? 🧐

futurmaster
28 Nov, 2023, 18:29

Yeah you're right executor can start the same script multiple times, so can run it concurrently in the same container but that's another topic how efficient is this

ZachHandley
28 Nov, 2023, 18:29

Well I'm gonna be working it out

futurmaster
28 Nov, 2023, 18:34

https://docs.docker.com/config/containers/multi-service_container It's ok to have multiple processes, but to get the most benefit out of Docker, avoid one container being responsible for multiple aspects of your overall application.

futurmaster
28 Nov, 2023, 18:37

It's a very advanced topic because at this point the Linux PID also comes into the picture. What is the PID, how does it work, and why is it important, how does Docker containers running on the host system etc.

ZachHandley
28 Nov, 2023, 18:37

Why is it a bad idea to just have a round robin for any existing executors?

futurmaster
28 Nov, 2023, 18:39

Because if the executor get a request to run a function and doesn't have a running container with that function, then first he must initialize it and just after that will be able to execute

ZachHandley
28 Nov, 2023, 18:40

Could you not just have one parent executor or parent instance that can then signal to the children that are actually running them to run?

futurmaster
28 Nov, 2023, 18:41

This is the case if you run a single executor

futurmaster
28 Nov, 2023, 18:43

As I mentioned the best and most efficient way would be to study how Knative working and to go in that direction

futurmaster
28 Nov, 2023, 18:45

Google started Knative and it's working nearly the same as GCP executes serverless

futurmaster
28 Nov, 2023, 18:46

So maybe they know better how to properly serve tons of requests in time

futurmaster
28 Nov, 2023, 18:51

For me, it's also fine, that we're reinventing the wheel, but it will absolutely take a lot of time to get there, where others are already. But this is the same topic in which I can't fully agree with the stakeholders. Maybe I have more experience 🀣

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more