What is a deployment unit? #51
Replies: 3 comments 13 replies
-
Resourcewise, one issue AS has is, that they advise to deploy each service separately, where each such service maps 1:1 to a gRPC Service: https://developer.lightbend.com/docs/akka-serverless/designing/programming-model.html#_what_is_an_akka_serverless_service There are alternatives to that model.
In general, the k8s pods scheduling model probably does not fit well when it comes to have user-functions implemented in languages that bring a heavy environment with them. Having the sidecar being multiple hundreds of MBytes even doesn't help here and so we have to have an eye on that for out BEAM based proxy. |
Beta Was this translation helpful? Give feedback.
-
Very good discussion. |
Beta Was this translation helpful? Give feedback.
-
I've thought of a proxy model for multiple pods before and I think this would bring certain difficulties. Today the proxy is co-located with the user function this lessens the network footprint and also security concerns, just to remember our proxy creates user services at runtime and this is not a security concern as we know it does in the scope of localhost, if we had to handle this via real network we would have a medium/severe security hole in our proxy that we would have to resolve. What I've seen in the past of LB's proxy is that it suffered from a problem any GraalVM application will suffer from, which is memory deallocation, GraalVM takes a long time to return used memory to the system (obviously because allocating and deallocating memory blocks costs a lot) and that along with the fact that object-oriented applications consume more memory causes the effect you mentioned. A related point I've been thinking about (startup time) about implementing is caching the compiled services of a user function, since a proxy would compile a version of a service it wouldn't be necessary to do the work of compiling the same version of a service in another instance. So if you scale a service from 1 to N the compilation cost would be paid on the first service. |
Beta Was this translation helpful? Give feedback.
-
If an image is deployed on k8s, and I deploy 10 of them, resource wise what is the footprint of such a deployment? There is copy on write in linux, right? How much of a image is duplicated at runtime? especially of the parts that are not writeable or never written to.
I'm asking because I see how much of resources a small 7 service deployment at Akkaserverless (AS) is taking, and I think we have to anticipate for that in our implementation too.
On AS: 7 services => 10GB memory used, ~20-25%CPU burning
AS is advocating 1 Service to be 1 deployment unit; and therefore 1 image deployed in a pod.
context:
https://discuss.lightbend.com/t/resource-usage-costs-7-services-10gb-memory-used-20-25-cpu-burning/8370
Beta Was this translation helpful? Give feedback.
All reactions