Subject Re: Nbackup, Default I/O ON or OFF
Author Dmitry Yemanov
21.12.2013 01:32, Dmitry Kuzmenko wrote:

> I decided to refresh my memory, because started to forgot things I new
> before :-)
>
> So, several facts:
>
> -d ON - turns ON direct I/O, i.e. turns off operating system cache.
> on Windows it uses FILE_FLAG_NO_BUFFERING option (see comments below)
>
> -d OFF - turns OFF direct I/O, i.e. turns ON operating system cache.
> it can show bad performance when database size is bigger than RAM,
> at least for Windows. Turning -d ON does not "spoil" OS cache, so,
> performance left for the hard drive subsystem. So, it need to be
> tested wich one to use - ON or OFF.

Correct so far.

> Also, as I see in nbak.cpp, -d option affects only diff file (delta),
> not database file. You can check functions
> BackupManager::openDelta
> BackupManager::setForcedWrites

Wrong. The -D switch has nothing to do with the BackupManager, so it
cannot affect delta at all.

You should be looking at nbackup.cpp (the utility, not the engine) and
see that it affects how the database file is being read by nbackup after
it has been locked.

> And, it inherits Forced Writes state from the database for delta.
> If it's ON for database, it will be ON for delta (wich is seems
> logical).

True, but it's about ForcedWrites, not the -D switch.

> What I coudn't find (sorry, I don't understand C++ and not so friendly
> with Firebird sources) is defaults for -d option.

The default is ON on Windows and OFF on POSIX.


Dmitry