Skip to content

Boost can become unresponsive when large number of archive tables exist #4043

@kim-fitness

Description

@kim-fitness

Describe the bug

Review poller_boost.php function output_rrd_data

If there is more old arch tables, instead of processing directly to rrd files, it tries to copy everything to the latest arch table.
Considering customer has two 300G old poller_output_boost_arch_* tables, this would take for ever.

$more_arch_tables = db_fetch_assoc_prepared("SELECT table_name AS name
	FROM information_schema.tables
	WHERE table_schema = SCHEMA()
	AND table_name LIKE 'poller_output_boost_arch_%'
	AND table_name != ?
	AND table_rows > 0", array($archive_table));

if (cacti_count($more_arch_tables)) {
	foreach($more_arch_tables as $table) {
		$table_name = $table['name'];
		$rows = db_fetch_cell("SELECT count(local_data_id) FROM $table_name");
		if (is_numeric($rows) && intval($rows) > 0) {
			db_execute("INSERT INTO $archive_table SELECT * FROM $table_name");
			db_execute("TRUNCATE TABLE $table_name");
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions