On Thu, 29 Aug 2024 at 15:30, Stefan G. Weichinger <li...@xunil.at> wrote:

>
> today I had to restore 2 files from a job with ~800GB and 785318 files in
> it
>
> this is bacula-15.0.2 and bacularis-3.2.1 on debian-12.6
>
> When I tried the restore in bacularis and chose the needed Job-ID for
> selection of the files, the postgresql-DB went to 100% (on one core) and
> the webserver timed out with 504 ...
>

Hello Stefan,

Bvfs cache is a great function in Bacula that has many advantages.
Unfortunately it also has some disadvantages. Before this cache is created
it takes some time and resources to create it. Once it is created, then
things in the restore process go quicker and better, but if it isn't
created, then it can happen that for many records and not tuned database it
can finish with a timeout.

There are two good news for this creating cache issue:

1) This is an incremental process. It means that the cache is not
re-created for jobs and paths that already exist there. Added are only new
ones. Because of that for newly configured backup jobs this cache can take
longer than for others.

2) This process can be triggered asynchronously to the restore process.
There is possible to update this cache not in a moment when the files from
restore are urgently needed, but in a moment when the backup job finishes
work. This way when you go to the restore wizard, the cache is ready. It
can be done in the Job Runscript directives like these:

Runscript {
    Runs When = After
    Runs On Client = no
    Console = ".bvfs_update jobid=%i"
}

In older Director versions there was a bug in running the .bvfs_update
command in the Runscript Console directive:

https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/issues/2419

but I think in newer Bacula versions it should be fixed already. For older
Director versions it can be done by using script and putting the
.bvfs_update command inside it, like this:

Runscript {
    Runs When = After
    Runs On Client = no
    Command = "/path/to/script/script.sh %i"
}

For your question about increasing the web server timeout it can help that
the timeout will not occur but it is a bit more like a treating effect, not
treating the cause. In my opinion the runscript way can give more profits
here.

For database tuning, sure, it is always a good move. I know this tool for
that:

https://pgtune.leopard.in.ua/

For the working restore in Bconsole, the Bvfs restore and Bconsole restore
are two different topics. They share some code, but they are not comparable
in this aspect. The Bconsole restore does not create the Bvfs cache.

Good luck with your tries with Bvfs. Please note that in the Bvfs restore
process there is one more key moment in the last wizard step but for 2
files to restore and with PostgreSQL database I am sure that you will not
experience it :-)

Best regards,
Marcin Haba (gani)
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to