Cron Job Review

I am looking into high CPU usage on our setup and the cron job I setup years ago might be the problem. I don’t really know if this setup is what should be done now and if anything should be removed. It was years ago I set this up and the documentation seems to have changed a lot. We have 1400 devices and are aiming for 1-5min polling.

# Using this cron file requires an additional user on your system, please see install docs.

33   */6  * * *   librenms    /opt/librenms/cronic /opt/librenms/ 2
*/5  *    * * *   librenms    /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/cronic /opt/librenms/ 32
*    *    * * *   librenms    /opt/librenms/alerts.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/poll-billing.php >> /dev/null 2>&1
01   *    * * *   librenms    /opt/librenms/billing-calculate.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/check-services.php >> /dev/null 2>&1

# Daily maintenance script. DO NOT DISABLE!
# If you want to modify updates:
#  Switch to monthly stable release:
#  Disable updates:
15   0    * * *   librenms    /opt/librenms/ >> /dev/null 2>&1


Component Version
LibreNMS 24.2.0 (2024-02-27T11:54:10-07:00)
DB Schema 2024_02_07_151845_custom_map_additions (290)
PHP 8.1.2-1ubuntu2.14
Python 3.10.12
Database MariaDB 10.6.16-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1

[OK] Composer Version: 2.7.1
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

How many processors are you running on your server? Physical or Virtual?

8 cores on a VM.

I’m running 5-minute polling with 10 vCPU, 16gb with close to 1100 devices being monitored. I’m averaging around 50% cpu. The only thing i see different is that I’m running 16 threads instead of 32 threads on my poller-wrapper line in cron.

If you lower it to 16, would you see gaps in your graphs?

I went on an adventure and moved to the dispatcher service, seems like the CPU is much more reasonable now.