Boost - delete operation in boost_process_poller_output

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
tuux1598g
Posts: 9
Joined: Fri Sep 05, 2008 4:15 am

Boost - delete operation in boost_process_poller_output

Post by tuux1598g »

I'm currently deploying a rather large installation on minimal hardware and have been making a number of changes to achieve the desired results. Whilst I understand the merits of the delete operation currently in use within boost, using a temporary rcaston_[random] table in memory, over the older method whereby each record was deleted individually by iterating through the $results array, I do see a simpler way that this might be done.

Whilst this may not be as effective a delete statement (it could take marginally longer to process), it does save precious memory - which means a lot when using boost in very large systems...

Basically we could use the $sql_where variable from the initial select statement, which is still available at this point, to selectively delete from the poller_output_boost table. This does away with the need of creating a temporary table and inserting all of the data into that table, freeing up that little more memory for the boost data itself:

Code: Select all

    /* remove the entries from the table */
    if ($ok_to_delete) {
        if (!$single_local_data_id) {
            /* delete the records in bulk */
            db_execute("DELETE FROM `poller_output_boost` $sql_where");
        } else {
            db_execute("DELETE FROM `poller_output_boost`
                WHERE local_data_id=$orig_local_data_id");
        }
    }

This should only delete those records that have been committed to RRD files within this boost_process_poller_output - thus effectively achieving the same result as deleting anything existing in $results (since $results is simply the result of a SELECT statement using this same $sql_where).

Any thoughts or comments appreciated.

[Edit]
Performance-wise this doesn't seem to affect too much in testing:

Using a direct DELETE (preserving memory):
02/17/2009 04:21:31 PM - SYSTEM BOOST STATS: Time:1807.6645 RRDUpdates:2808330

Using rcaston temporary table:
02/17/2009 02:16:14 PM - SYSTEM BOOST STATS: Time:1808.7236 RRDUpdates:2804983
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Make sure that you use a memory table. If your table is memory, the delete's are almost instantaneous. Also, make sure that the "output" column is not indexed on the poller_output_boost. Otherwise, I would say not enough disk I/O.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests