flyersa / MuninMX-Frontend

Frontend for MuninMX
5 stars 1 forks source link

Slow performance queies in mongodb #4

Closed npolite closed 8 years ago

npolite commented 9 years ago

Hi All,

I have around 29 nodes currently installed. They have been collecting data for about 6 months now and I find that they take a long time to graph the results. I noticed that the CPU is single threaded for the queries to the mongodb. Is there any way to speed this up? I have this running on two Intel(R) Xeon(R) CPU X5675 @ 3.07GHz (12 core 24 HT) server with 24GB of memory and running on SAS drives.

Any help would be appreciated.

flyersa commented 9 years ago

Hi,

that sounds to me like indexing is not activated. Guess thats no default and missing in the installer.

Usually there is a cronjob as example:

/55 * * * * cd /var/www/html/cron; php createIndexes.php > /tmp/index.log /30 * * * * cd /var/www/html/cron; php update_uptime.php > /tmp/uptime.log

can you try to crun createIndexes.php manually first? It can take a long time if you have no indexes since 6 months, but its utilizing tokumx background indexing, so its not locked. However during indexing performance might be degraded.

npolite commented 9 years ago

Hi Flyersa,

That did the trick. Thanks for your help!

I do have one last question. I would like to use the API key so that our customers can see their groups without having to log in. How do I go about adding the API key to the URL?

Thanks, Nick

npolite commented 9 years ago

I also see some graphs are not updating properly. Looking at the logs I see the following:

2015-11-06 09:36:26,493 ERROR Error loading plugins on hldbp01.site04.mavenwire.com (9) : String index out of range: -44

2015-11-06 09:36:26,503 ERROR Error in dbUpdatePlugin: Column 'linemode' not found. 2015-11-06 09:36:26,507 ERROR Error in dbUpdatePlugin: Column 'linemode' not found.

2015-11-06 09:36:26,540 ERROR Error in dbUpdatePlugin: Column 'linemode' not found.

Is there a way I can troubleshoot what -44 means?

Edit: I think I found the issue with this. It seems to be an issue with the plugin I was using on the node-server. It works ok with regular munin but seems that may be the issue. I'll update it once I have some data gather to be certain that is the issue.

flyersa commented 9 years ago

Hi,

please add the following field to the database on table "node_plugins".

ALTER TABLE node_plugins ADD linemode VARCHAR(10) NOT NULL DEFAULT 'default' ;

that will get rid of the linemode error.

For autologin its

http://muninmx/autologin.php?username=$USERNAME&key=$APIKEY

npolite commented 9 years ago

Thanks for your help. Everything is now working great.

Nick