Multi-threading is designed to improve restore performance on compressed backup files. Restore operations on non-compressed backup files may also benefit from multi-threading.

Use the -thread parameter with the PROREST utility to enable multi-threading, as in the following syntax:

prorest db-name device-name -thread <n> -threadnum <n> -rbf <n> -wbf <n>

In the following example, -thread 0 disables multi-threaded restore:

proutil prorest newb testdb.bk -thread 0

In the following example, -thread 1 enables multi-threaded restore. Because -threadnum is unspecified, the maximum number of threads defaults to the number of CPUs on the system. The read buffer and write buffer factors, which control the amount of memory used to read and write data to buffers, both default to 1024.

proutil prorest newb testdb.bk -thread 1
...
Start of extending target DB to needed size... (9432)
It will require a minimum of 1082 blocks to restore. (6763)
Number of threads not specified. The default number of threads used is 4. (20669)
Start of restoring the target DB... (9433)
Restore the backup file with 4 worker threads. (20649)
Read buffer factor (-rbf): 1024 (20707)
Write buffer factor (-wbf): 2048 (20786)
Restore has spawned 4 worker threads. (20648)This is a full backup of /.../testdb.db. (6759)
This backup was taken Tue Oct 14 11:28:04 2022. (6760)
This backup was compressed using ZSTD compression. (20281)
The compression level used in the backup is 3. (20282)
The blocksize is 4096. (6994)
Start of extending target DB to needed size... (9432)
It will require a minimum of 1082 blocks to restore. (6763)
Start of restoring the target DB... (9433)
Restore the backup file with 4 worker threads. (20649)
Read buffer factor (-rbf): 1024 (20707)
Write buffer factor (-wbf): 1024 (20786)
Restore has spawned 4 worker threads (20648)
Read 1076 db blocks in 00:00:02

The following multi-threaded restore example occurs on a system with four CPUs. Because the user sets -numthreads to more than twice the number of CPUs on the system, the utility resets the maximum number of threads to eight, twice the number of CPUs:

proutil prorest newb testdb.bk -thread 1 -threadnum 10
...
Start of extending target DB to needed size... (9432)
It will require a minimum of 1082 blocks to restore. (6763)
Threads number specified exceeds 2 times CPU. Maximum number of threads running is 8. (14775)
Restore has spawned 8 worker threads.

For more information on PROREST syntax and usage, see PROREST utility.