Using Bacula 13.0.2 on Fedora 37, with a mysql (mariadb) database backend.  My Bacula database was imported from a mysqldump of my install on Fedora36, and the update_mysql_tables_1022_to_1023, update_mysql_tables_1023_to_1024 scripts run to bring it up to date for the release.

Bacula operates fine, but restoring using bRestore in bat is very slow trying to restore a directory tree with ~700 files in it.

It runs a JOIN on the database that takes about 20 min to complete:
SELECT Path.Path, File.Filename FROM File JOIN Path USING (PathId) JOIN b2123 AS T ON (File.JobId = T.JobId AND File.FileIndex = T.FileIndex) WHERE File.Filename LIKE ':component_info_%' AND File.JobId IN (238)

Once it completes, the tape restore runs as expected and the files are restored.

The database appears to have the correct indexes:

MariaDB [bacula]> show index from Path;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | 
Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Path  |          0 | PRIMARY  |            1 | PathId      | A         |     
1647156 |     NULL | NULL   |      | BTREE      |         |               |
| Path  |          1 | Path     |            1 | Path        | A         |     
1647156 |      255 | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.000 sec)

MariaDB [bacula]> show index from File;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | 
Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| File  |          0 | PRIMARY  |            1 | FileId      | A         |    
13301284 |     NULL | NULL   |      | BTREE      |         |               |
| File  |          1 | JobId    |            1 | JobId       | A         |      
   108 |     NULL | NULL   |      | BTREE      |         |               |
| File  |          1 | JobId_2  |            1 | JobId       | A         |      
  4566 |     NULL | NULL   |      | BTREE      |         |               |
| File  |          1 | JobId_2  |            2 | PathId      | A         |     
3325321 |     NULL | NULL   |      | BTREE      |         |               |
| File  |          1 | JobId_2  |            3 | Filename    | A         |    
13301284 |      255 | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
5 rows in set (0.000 sec)

I've tried adding the following to the mariadb-server.cnf without effect:
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 256M
innodb_log_file_size = 1G
innodb_write_io_threads = 16
join_buffer_size = 1073741800
sort_buffer_size = 2097152

Anything else I can do to speed up the restore?

Thanks,
Brian

--
And yet less thanks have we than you.  Users scowl at us, and reporters
give us scornful names.  "Geek" I am to one fat man who lives a firewall
away from foes that would steal his identity or lay his little computer
in ruin, if it was not guarded ceaselessly.  Yet we would not have it
otherwise.
                                    ---Aragorn, sysadmin.


Brian danielsbitm...@pobox.com
      http://www.eviloverlord.net
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to