Manage Configuration Database
Check Configuration Database integrity
Some organizations like to perform weekly database integrity checks. Additionally, if a sudden power loss is encountered a test may not have fully completed in updating all tables in the MariaDB database, and upon powering back up may detect an issue. In such a case the MariaDB database integrity would need to be checked and auto-corrected.
You can verify and repair the integrity of the MariaDB database by using the following command (ssh to Hawkeye server):
# mysqlcheck Hawkeye --user=hawkeye --password=hawkeye --auto-repair
A number of organizations using MariaDB for other products have a Linux cron job to schedule this command to be run once a week or month to protect the integrity of their data. We recommend you to run this command following a power outage as many activities such as, recording a test result involve updating several tables in the MariaDB database and a sudden shutdown due to loss of power would leave this updating in a partial state of completion.
Customize MariaDB configuration
When the Hawkeye Server virtual machine was created, a certain amount of RAM was allocated to it. All Hawkeye services and the MariaDB server share this RAM.
The MariaDB service is configured to use 1GB of RAM by default. This is considered insufficient for most Corporate environments.
The MariaDB database configuration parameters are located on the Hawkeye server in the file /etc/mysql/mariadb.conf.d/99_tuning.cnf directory and the user with privilege escalation can modify these.
Refer to the section Hawkeye Services for information on how to start and stop services safely to implement the changes mentioned below.
The most important parameter that needs to be adjusted is the parameter that sets the max amount of RAM to be used by MariaDB. The default Hawkeye server settings is to save all test results for 1 year, the amount of RAM required for processing this much data for multiple users may result in slow performance of the system. In addition to the work of saving and recycling of test results in MariaDB.
Parameter: innodb_buffer_pool_size=1G
The default is to limit the MariaDB to 1GB. For large systems, Keysight recommends setting this to 25% of available RAM on the Hawkeye server. For a Hawkeye Server with 16GB of allocated RAM, Keysight recommends setting this to innodb_buffer_pool_size=4G.
MariaDB transactions per hour
Default value for max_connections parameter for MariaDB database in /etc/mysql/mariadb.conf.d/99_tuning.cnf is 151. This defines the maximum number of concurrent connections opened against MariaDB. In the case of numerous endpoints/tests per hour (above 1000 per hour), Keysight recommends to increase this number to 1000.
Control Size of Configuration Diskspace
Available disk space was allocated to the Hawkeye server virtual machine during its creation. The MariaDB database can grow to a very large size. For large systems running a high number of tests per hour, if this goes unchecked all disk space could become used which will prevent the Hawkeye server from running tests. The size of the MariaDB database is a combination of how many endpoints/tests per day are executed and the number of days configured to retain MariaDB tests and metrics for report generation.
The default settings for Hawkeye Server will result in one year of tests results to be saved. The user is highly recommended to configure the number of days to store test results to keep the system manageable. There are two suggested ways to calculate how much disk space will be used by the system daily:
- A rough rule to calculate disk space required: An approximate estimate will be 1 test = 2 kilobytes (KB) of data. So, 1,000 tests per day will generate 2 MB of data and 1,000,000 tests will generate 2GB of data.
- Once system configured with all endpoints and scheduled tests, the daily use of disk space can be calculated. By using ssh to Hawkeye server, then running the command “df -h”, then 24 hours later run the same command and see what the daily growth of the MariaDB database is.
If the disk space is growing rapidly at 100 MB a day and the Hawkeye server virtual machine was created with a virtual disk space of 30 GB this means after 300 days the available disk space will be filled.
On the Hawkeye server under Administration > Preferences there are two parameters:
- Number of days for database retention: 365
- Number of days for database retention for detailed metrics: 180
These two parameters define the recycling and retention period for keeping test results and metrics. For the example above, Keysight recommends you to set the Number of days for database retention and Number of days for database retention for detailed metrics to 180 days (6 months) to allow for a large safety margin.
The Number of days for database retention for detailed metrics are disk intensive and the retention period should be less than the Number of days for database retention. For systems under heavy load (>100000 tests a day) it is recommended to change this metric to less than 30 days, if possible less than 10 days is highly recommended.
The parameter for Number of days for database retention of admin elements can be reduced to as low as 5 days as it is mostly used for log tracking.