Why is restore so slow?

William Roberts; liam at cs.qmw.ac.uk
Tue Jan 29 02:32:29 AEST 1991


In <50235 at olivea.atc.olivetti.com> jerry at olivey.olivetti.com (Jerry Aguirre) 
writes:

>Has anyone done any evaluations of why there is such an extreem
>difference in speed?  Granted that creating files involves more overhead
>than dumping them restore still seems very slow.  As restore operates on
>the mounted file system it has the advantage of accessing a buffered
>file system with write behind.

>My particular theory is that the disk buffering algorithms are precisely
>wrong for restore.  By this I mean they keep in the buffers the data
>that will never be needed again and flush the data that will.  I plan to
>do some experimentation and would appreciate hearing any ideas you might
>offer.

Restore suffers from the fact that files are stored in inode-number order: 
this is not the ideal order for createing files as it thrashes the namei-cache 
because the files are recreated randomly all over the place. We reorganised 
our machine once and used dump/restore to move our /usr/spool and /usr/mail 
partitions around: /usr/spool contains lots of tiny files called things like 
/usr/spool/news/comp/unix/internals/5342 and this took an incredibly long time 
to restore. /usr/mail contains several hundred files but no subdirectories and 
restored in about the same sort of time as it took to dump. 

Restore suffers the same accidents of history as a lot of other system 
utilities. It dates back to sub 1-megabyte memory machines (maybe 64k separate 
I/D space PDPs) and so it uses pathetically small buffers. If you want to 
speed up restore, steal maybe 2 Megabytes of memory as file buffers, fill that 
with file images to be restored and then write them to disk in something 
resembling a depth-first traversal of the directory tree. This costs a little 
bit of ingenuity but doesn't involve any kernel changes.
--

William Roberts                 ARPA: liam at cs.qmw.ac.uk
Queen Mary & Westfield College  UUCP: liam at qmw-cs.UUCP
Mile End Road                   AppleLink: UK0087
LONDON, E1 4NS, UK              Tel:  071-975 5250 (Fax: 081-980 6533)



More information about the Comp.unix.wizards mailing list