Optimization#
General#
In daily work Bacularis uses Bacula resources (catalog database, bconsole, config files) and its own resources in a various way. Each of these areas in some settings can have impact on performance of using the web interface. In this chapter you can find techniques to improve Bacularis performance by preparing small changes in the Bacula and Bacularis environment.
Database#
The properly configured and optimized database is one of the most important points that can improve working with Bacularis. The database server after installing usually is configured by default with generic options. To find options that make the database more efficient there can be used tuning tools.
PostgreSQL#
One of the tools to perform the PostgreSQL database tuning is PGTune.
It is online tool where users can provide the system characteristic
parameters and the PGTune proposes the PostgreSQL options to use
in the postgresql.conf
database configuration file.
This tool you can find here: PGTune.
MySQL/MariaDB#
In case MySQL/MariaDB the proposed tuning tool that can be used is MySQLTuner. It is a tuner written in Perl that analyzes the current database installation and suggests options to best optimize the databaes instance. It works the same well with MySQL and MariaDB.
This tool you can find here: MySQLTuner.
Web server#
Bacularis can transfer between the web interafce and the web browser long data structures.Typicaly it is not noticeable in local networks where Bacularis web interface and the host with web browser communicate in the same network. The web interface can slow down if the communication goes through the Internet or slow network. Because of that it might be good to enable in the web server the software compression for transfered data.
Apache#
For the Apache web server first we need to make sure that the compression
module is enabled in the configuration. In case described here, we
use deflate
compression where the Apache configuration line to enable it
looks like here:
LoadModule deflate_module modules/mod_deflate.so
Once the module is enabled, you can add the following lines to
the Bacularis virtual host configuration file bacularis.conf
to the <Directory>
section like here:
<Directory /usr/share/bacularis/htdocs>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
...
... other options
</Directory>
At the end please reload the web server configuration.
Nginx#
In Nginx we can enable the content compression adding the following
two lines to the existing server
section in the Nginx Bacularis
configuration file:
server {
gzip on;
gzip_types application/javascript application/json text/css text/html;
...
... other options
}
At the end please reload the web server configuration.
Lighttpd#
For the Lighttpd web server first please make sure that you have the
lighttpd-mod_deflate
module installed in the system packages. It is
available since Lighttpd 1.4.42
.
Below you can find sample of enabling the compression to the Lighttpd Bacularis configuration file:
server.modules = (
"mod_deflate",
...
... other modules
)
deflate.mimetypes = ("text/html", "text/css", "application/javascript", "application/json")
deflate.allowed-encodings = ("br", "gzip", "deflate")
...
... other options
At the end please reload the web server configuration.
Bacularis#
Job options#
If in the Bacula environment you have many jobs done (thousans or hundreds of thousans),
you should be aware two important options to limit jobs displayed
in the web interface. The options you can find in the Bacularis Web iterface
on the Application settings
page. It is on the top left side under the gear wheel icon.
There please go to the Display options
tab and find two options:
Max. number of jobs visible in tables
- it determines how many latest jobs Bacularis will load to the web interface tables maximum. For many jobs, usually not all of them are necessary to be accessible on the interface all the time. By default it loads15 000
jobs. If your web interface behaves slowly for this value you can decrease it to ay lower value. To be able list more jobs, this value can be increased.
Job age on the dashboard job graphs
- it has impact on loading the main dashboard page and it determines age for jobs loaded in the graphs on the dashboard. If you have this value set to big time range then the dashboard can load slower. In Bacularis versions up till2.7.0
the default value was zero which meant that taken into account are all jobs. In versions greater than2.7.0
it has been changed that if this value is not set, the default is set14 days
. Suggested is to adapt this value and at least to set it different than zero, for example7 days
.
Both the options you can see indicated by red arrows on the screenshot below:
Debug mode#
If in the past you enabled debug mode for Bacularis Web or Bacularis API (or both), after finishing debugging please make sure that this mode has been disabled. Debug mode is not advised to be enabled all the time. It can also have impact on the performance because all outputs from commands are continiously written to the text files.