Please, read the article about Live migration before this one.
This page describes how to reduce the freeze time of an application by using the memory changes tracking ability.
The steps below look like those in regular live migration, but include one of more pre-dump stages.
Take tasks you're about to migrate and pre-dump them into some place. Tasks will remain running after pre-dump, unlike regular dump.
[src]# criu pre-dump --tree <pid> --images-dir <path-to-existing-directory-A>
The directory with images can be on a shared storage, or you can use disk-less migration to avoid the Copy step.
Now you can do regular dump of your processes.
[src]# criu dump --tree <pid> --images-dir <path-to-existing-directory-B> --prev-images-dir <path-to-directory-A-relative-to-B> --leave-stopped
- this dump would work faster, than it would if there were no the pre-dump stage, as this dump only takes the memory that has changed, since the pre-dump step.
--prev-images-dirshould contain path to the directory with pre-dump images relative to the directory where the dump images will be put
Copy images to destination node:
[src]# scp -r <path-to-images-dir> <dst>:/<path-to-images>
Go to the destination node and restore the apps from images on it:
[dst]# criu restore --tree <pid> --images-dir <path-to-images>
If everything went OK you can return on the source node and kill stopped tasks on it.
[src]# FIXME put command here