how to transfer session to another compute node with python?

8/1/2018

How to transfer session to another compute node with python in the following case?

case 1: If using kubernete,

case 2: Or using autoscale,

case 3: if using Amazon,

How to transfer session to another compute node with python? So that program can run forever

-- marolamaea marolamaea
amazon
kubernetes
python

1 Answer

8/1/2018

Nope, none of those things can transfer a process with all of its in-memory and on-disk state across hosts.

If you’re looking at Kubernetes already, I’d encourage you to design your application so that it doesn’t have any local state. Everything it knows about lives in a database that’s maintained separately (if you’re into AWS, it could be an RDS hosted database or something else). Then you can easily run multiple copies of it (maybe multiple replicas in a Kubernetes ReplicaSet or Deployment) and easily kill one off to restart it somewhere else.

One of the high-end virtualization solutions might be able to do what you’re asking, but keeping a program running forever forever is pretty hard, particularly in a scripting language like Python. (How do you update the program? How do you update the underlying OS, when it needs to reboot to take a kernel update?)

-- David Maze
Source: StackOverflow