Libre NMS VM 100% CPU Usage

Hello

We have a problem with our LibreNMS VM.
The CPU is 100% busy, If I reboot the VM it is ok for a couple of hours, and then the CPU stays at 100%

image

SHOW PROCESSLIST shows a lot of connections, over 100
Almost every processes is for the same 2 device_id’s

https://p.libren.ms/view/8f265108

1 Like

Did you disabled daily.sh from cron file?

Looks like your syslog table is very huge.

When you visit a page with syslog on it, it seems to peg the mysql server because you have too many syslog entries for that device.

Step one: ./validate.php
Step two: make sure you are running ./daily.sh in your cron job to clean up old syslog entries.
Step three: if you don’t care about history and don’t want to wait for daily.sh to cleanup, you can truncate the entire syslog table to fix the issue for now.

I tried to run daily.sh, but it seems to hang when cleaning up the DB. After a while mysql crashed and I had a really hard time restarting the VM. It took 15min for Vcenter to reset it.

uma@libre-nms:/opt/librenms$ sudo ./validate.php
PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 163

Component Version
LibreNMS 1.37
DB Schema ?
PHP 7.0.32-0ubuntu0.16.04.1
MySQL ?
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[FAIL] No composer available, please install composer [FIX] https://getcomposer.org/

Can I clear the syslog table from the GUI, or do I have to do it from mysql?

If you dont care about history in syslog table

TRUNCATE TABLE syslog;

From mysql prompt (console).

Then, enable again ./daily.sh in cron but disable updates if you dont want them

https://docs.librenms.org/General/Updating/

1 Like

Ok, the table has a large number of rows
SELECT COUNT() FROM syslog;
±----------+
| COUNT(
) |
±----------+
| 168159080 |
±----------+
1 row in set (9 min 29.95 sec)

Thats what we told you. daily.sh does more than update.

For that there is a config option to disable updates. Disabling daily.sh will break your install over time.

ok, If I would like to save like the last 30 days in the syslog table, what would the sql command be for that?

I truncated the whole table and everything looks good now, Thanks for the help!

The problem was that our firewalls were sending a lot of syslog messages to Libre, we have changed that now and the syslog table does not grow as much, Earlier it grew with 1000’s of entries every minute

Is this solution stil valid?

If you have the same issue, then this solution is perfectly valid :slight_smile: If you don’t have exactly the same issue, better to open a new post…

1 Like