Changes

Jump to navigation Jump to search
1,281 bytes added ,  04:32, 31 August 2016
Line 21: Line 21:  
[[Image:Memory_migration_with_page_server.png|thumb|500px|right|Memory migration with page server]]
 
[[Image:Memory_migration_with_page_server.png|thumb|500px|right|Memory migration with page server]]
 
When using page server, the memory is dumped not to disk, but directly to network, thus eliminating any disk reads/writes on the source. On the destination system, a page server runs, receiving the data from network and writing it to files on disk or tmpfs.
 
When using page server, the memory is dumped not to disk, but directly to network, thus eliminating any disk reads/writes on the source. On the destination system, a page server runs, receiving the data from network and writing it to files on disk or tmpfs.
 +
 +
Note that page server is only used to migrate user memory, i.e. ''pagemap.img'' and ''pages.img'' files (see [[memory dumps]] if you don't know what that means). Everything else, including, say, process mappings (''mm.img'') is dumped in a traditional manner and should be moved over when doing migration.
    
=== Pages deduplication ===
 
=== Pages deduplication ===
 +
 +
''Main article: [[Memory images deduplication]].''
    
When iterative memory dumping feature (<code>criu pre-dump</code>) is used, memory is sent to page server a few times. The page server can automatically deduplicate pages, by punching holes in parent images where the child image is replacing an existing page. This functionality is turned on by <code>--auto-dedup</code> option of <code>criu page-server</code> command.
 
When iterative memory dumping feature (<code>criu pre-dump</code>) is used, memory is sent to page server a few times. The page server can automatically deduplicate pages, by punching holes in parent images where the child image is replacing an existing page. This functionality is turned on by <code>--auto-dedup</code> option of <code>criu page-server</code> command.
Line 29: Line 33:  
== Usage ==
 
== Usage ==
   −
You would want to use page server feature when performing a [[live migration]]. In most cases, just use [[P.Haul]] which handles the details for you. Otherwise, read on.
+
The obvious use case for page server is [[live migration]]. In most cases, use [[P.Haul]] to hide the details from you. Otherwise, read on.
    
=== Running page server ===
 
=== Running page server ===
Line 35: Line 39:  
First, run a page server on a destination node:
 
First, run a page server on a destination node:
   −
  [dst]# criu page-server --images-dir $DIR --port $PORT [--auto-dedup]
+
  [dst]# criu page-server --images-dir $DIR --port $PORT [--auto-dedup] [...]
 +
 
 +
Note that <code>criu page-server</code> is "one shot" service, meaning you need to run it for every migration, and it exits as soon as all pages are transferred (or on an error). It also makes sense to check its exit code, to make sure there was no error.
    
The options are:
 
The options are:
   −
; --images-dir
+
; --images-dir $DIR
 
: A directory to write memory images to. To speed things up, you might want to use tmpfs (see [[disk-less migration]]).
 
: A directory to write memory images to. To speed things up, you might want to use tmpfs (see [[disk-less migration]]).
   −
; --port
+
; --port $PORT
 
: A port number to listen at.
 
: A port number to listen at.
    
; --auto-dedup
 
; --auto-dedup
 
: Perform auto deduplication of images. Useful with iterative memory dumps.
 
: Perform auto deduplication of images. Useful with iterative memory dumps.
 +
 +
Some other options might also be useful, such as:
 +
 +
; -o|--logfile $FILE
 +
: A file to write log to.
 +
 +
; -v$N|-vvv[..]
 +
: Set logging level (verbosity). For example, <code>-v4</code> (or <code>-vvvv</code>, which means the same) enables tons of debug info.
    
=== criu pre-dump/dump ===
 
=== criu pre-dump/dump ===
   −
With page-server, you need to specify additional arguments to <code>criu pre-dump</code> or <code>criu dump</code> commands. They are:
+
On the source system, run <code>criu pre-dump</code> or <code>criu dump</code> as usual (see [[live migration]], [[iterative migration]] etc.).
 +
To use page server, one need to specify a few additional arguments:
    
; --page-server
 
; --page-server
Line 64: Line 79:     
To view an example video of using a page server, please go to https://asciinema.org/a/15847.
 
To view an example video of using a page server, please go to https://asciinema.org/a/15847.
 +
 +
== Limitations ==
 +
 +
* Currently it only works via TCP
 +
* DNS names are not resolved for <code>--address</code> argument, only IP addresses are allowed
 +
* No encryption, no compression, data is passed over network as is
    
== See also ==
 
== See also ==
Line 69: Line 90:  
* [[P.Haul]]
 
* [[P.Haul]]
 
* [[Live migration]]
 
* [[Live migration]]
 +
* [[Disk-less migration]]
 +
* [[Iterative migration]]
 +
* [[Incremental dumps]]
 +
* [[Memory images deduplication]]
 
* [[Lazy migration]]
 
* [[Lazy migration]]
   Line 76: Line 101:     
[[Category: HOWTO]]
 
[[Category: HOWTO]]
[[Category: Development]]
+
[[Category: Live migration]]
 +
[[Category: API]]

Navigation menu