My first post on stackoverflow; here goes!
I just discovered IBM Code Engine and am excited to try it out! I tried deploying a docker image of mine this weekend, though I'm having some issues with scaling. Before getting to the scaling issues I have some questions about IBM Cloud Code Engine in general, with my interactive application in mind:
- Stateful Applications: The application I'd like to deploy is stateful. Does IBM Cloud Code Engine support stateful apps out of the box?
- Sticky Sessions: Since my application is stateful, the goal is to have a user and all their associated actions stay within the same container. E.g., if a user is in
container 1
and clicks a button that executes server-side code I would not want that code executed incontainer 2
; it should be incontainer 1
. Does IBM Cloud Code Engine support this out of the box? - Ephemeral Storage: I see in the documentation that ephemeral storage (i.e., disk space) can be set, though I do not see the ability to modify this in the console. Am I missing something? Alternatively, does more vCPU & memory imply more disk? I personally prefer the CLI for the container registry, and the console for code engine itself.
Note that I have these questions whether concurrency per instance is 1 or more users.
Notes on scaling: I successfully deployed my application and it looked as expected. However, as the only user I saw multiple instances running rather than one (2, sometimes 3 instances). When I opened another browser and logged in as another user the same thing happened. Double or triple the instances needed were running. Can someone advise? Going back to my questions above, my hope is that interacting with the app does not trigger additional instances.
I can provide a simple Dockerfile and app code if helpful.
ibmcloud ce app create --ephemeral-storage
as a paramRuntime settings
section you can specify a concurrency value. That determines the value how many threads/requests one instance will process in parallel. If the value is set to 1, and you have three browser tabs open sending requests, Code engine will scale up to (at least) three instances (e.g. when the scale target is 70% of compute capacity, we’d spin up to 4). If the value is set to 100, one instance will handle 100 parallel requests and the scale out will only occur if you get 101 requests. It is independent of how many users send these requests.