Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


How to improve Cacti server, it has a reall poor performance

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific
Author Message
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 10:51 am    Post subject: How to improve Cacti server, it has a reall poor performance Reply with quote

Hello All,

I will like to know if anyone has any advice on how to improve my server's performance, we are using an HP Proliant DL585, 5th generation with 20GB in RAM and 8 Intel Xeon CPU (E7330 @ 2.40GHz) with Centos5 x64, cacti 8.7b with boost 1.7

Here are my system stats:

07/22/2008 08:34:35 AM - SYSTEM STATS: Time:273.6458 Method:spine Processes:1 Threads:60 Hosts:1030 HostsPerProcess:1030 DataSources:9349 RRDsProcessed:0

I was having lots of issues as the poller was reaching the 298 secs limit and aborting, thus my graphs were having lots of gaps, I did some tunning on mysql database, mostly increasing the buffers size, but I think that the servers performance can still be improved.

The average processes are 285, CPU usage is arround 30%, Load average is arround 7 and RAM is below 6 GB (5GB cache, <1GB Memory buffers). As you can see there are less then 10,000 data sources; I have seen smaller servers with more load arrond the forums, any advise is welcome.

Regards,
Ocon



boost.JPG
 Description:
Boost statistics.
 Filesize:  50.89 KB
 Viewed:  1082 Time(s)

boost.JPG



poller.JPG
 Description:
This are my poller settings.
 Filesize:  78.86 KB
 Viewed:  1082 Time(s)

poller.JPG


Back to top
Linegod
Developer


Joined: 20 Feb 2003
Posts: 517
Location: Canada

PostPosted: Tue Jul 22, 2008 12:44 pm    Post subject: Reply with quote

Change Maximum Concurrent Poller Processes to '3'.

Run the following against your database and post the output:

Code:

SELECT ACTION , count( * ) AS count FROM `poller_item` GROUP BY `action`


This will give, in order the number of actions that are snmp, script, and script_server.
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 12:56 pm    Post subject: Reply with quote

I changed the value to 3 as adviced, I read on the documentation that it could be 1 or 2 per processor (http://docs.cacti.net/node/519) but it did not work, so I switched back to 1. I am now on 3, I will keep you posted.

Also, thank you for your query!

mysql> SELECT ACTION , count( * ) AS count FROM `poller_item` GROUP BY `action` ;
+--------+-------+
| ACTION | count |
+--------+-------+
| 0 | 1968 |
| 1 | 4097 |
| 2 | 3316 |
+--------+-------+
3 rows in set (0.00 sec)

I was just trying to get this numbers the hard way, thanks for the tip, I already new the server had a lot of scripts as DS, know I got a number.

Do you think that this might be the problem (I do know scripts are hell slower than SNMP).

Thank you again!
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 1:26 pm    Post subject: Reply with quote

As soon as I changed the MAXIMUM CONCURRENT POLLER PROCESSESS i got this on my log:

07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - SPINE: Poller[0] FATAL: Connection Failed: Too many connections (Spine thread)
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - SPINE: Poller[0] ERROR: SS[999] Script Server did not start properly return message was: 'FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php''
07/22/2008 11:20:03 AM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
07/22/2008 11:20:03 AM - SPINE: Poller[0] FATAL: Connection Failed: Too many connections (Spine thread)
07/22/2008 11:20:03 AM - SPINE: Poller[0] ERROR: SS[999] Script Server did not start properly return message was: 'FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php''

Many times... and of course, the gaps started to show...

Please advise
Ocon
Back to top
Linegod
Developer


Joined: 20 Feb 2003
Posts: 517
Location: Canada

PostPosted: Tue Jul 22, 2008 3:00 pm    Post subject: Reply with quote

ocon wrote:

I was just trying to get this numbers the hard way, thanks for the tip, I already new the server had a lot of scripts as DS, know I got a number.

Do you think that this might be the problem (I do know scripts are hell slower than SNMP).!


I would lean towards the plain script ones being a problem. For reference, here are the stats on one of our servers:
Code:

07/22/2008 01:50:54 PM - SYSTEM STATS: Time:53.6681 Method:spine Processes:3 Threads:8 Hosts:565 HostsPerProcess:189 DataSources:14759 RRDsProcessed:8311
+--------+-------+
| ACTION | count |
+--------+-------+
|      0 | 10709 |
|      1 |   230 |
|      2 |  3820 |
+--------+-------+


Removing or moving the plain script to script server scripts should increase your capability.

As for the MySQL error, I'm going to take a guess that increasing the poller max _did_ speed things up, but quite possibly conflicted with your max connection rate.

On you database, do the following and post:
Code:

 show variables like "%max_conn%";
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 3:14 pm    Post subject: Reply with quote

Thank you!

I was always suspecting that our low performance was due to the scripts, I will start migrating them ASAP, but I am somehow confused, I have been looking in the forums and in the documentation, but it is still not clear for me what "Script server" scripts are... if you could give me a hint on the road to take I will really appreciate it.


When I was tunning the database I rised the Max connections, but I belive that this number aint enought, I will read more on mysql tunning, set a higher value and set Max poller to 3 again and keep you posted, you have been very helpful, again, thanks!

mysql> show variables like "%max_conn%";
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 10 |
| max_connections | 100 |
+--------------------+-------+
2 rows in set (0.00 sec)


Regards,
Ocon
Back to top
Linegod
Developer


Joined: 20 Feb 2003
Posts: 517
Location: Canada

PostPosted: Tue Jul 22, 2008 3:58 pm    Post subject: Reply with quote

Really good guide for tuning: http://www.ibm.com/developerworks/linux/library/l-tune-lamp-3.html

Script Server Docs: http://docs.cacti.net/node/514
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 4:05 pm    Post subject: Reply with quote

Thanks!

Whenever you come to Mexico, you got a bottle of tequila waiting for you! After increasing mysql max cons and Max pollers I got:

07/22/2008 01:46:09 PM - SYSTEM STATS: Time:67.6868 Method:spine Processes:8 Threads:65 Hosts:1031 HostsPerProcess:129 DataSources:9300 RRDsProcessed:0

Now I will read about scripts servers and migrate when possible, but again, thanks for all your help.

Ocon
Back to top
Linegod
Developer


Joined: 20 Feb 2003
Posts: 517
Location: Canada

PostPosted: Tue Jul 22, 2008 4:15 pm    Post subject: Reply with quote

Cool

If it where me, I would lower the max pollers to 6, and threads down to 30, just to see if it still functions OK. 8 and 65 may be too much overhead with your current requirements. This will also let you know if you have room to grow.

But the transitioning of scripts to script server should help a lot.

Good luck....
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Jul 22, 2008 4:43 pm    Post subject: Reply with quote

I am actually running like this:

07/22/2008 02:36:29 PM - SYSTEM STATS: Time:88.3715 Method:spine Processes:4 Threads:50 Hosts:1031 HostsPerProcess:258 DataSources:9301 RRDsProcessed:0

As I saw some server overload when using Processes:8 as you mention, so I lower it to 4, now after this latest configuration everything is working smoothly, It will be great to know what gives better results:
More spine Processes with Less threads or;
Less spine Processes with higher threads.

If no one comes with a sugestion, I will leave it like it is now; wait for some time to populate performance graph and swith to higer Procs/lower threads and compare the graphs.

I will also try to migrate my DS to script servers, as soon as I get the best results, I will post them, posts are always helpful.

Ocon
Back to top
ocon



Joined: 16 May 2008
Posts: 10

PostPosted: Thu Jul 24, 2008 10:15 am    Post subject: Reply with quote

Now... this is odd,

I migrated my .sh scripts to comply with script server; now my polling cycle went up about 100 seconds. Wasn't supposed to be better now?

I will switch back to .sh I believe....

Ocon.
Back to top
Linegod
Developer


Joined: 20 Feb 2003
Posts: 517
Location: Canada

PostPosted: Thu Jul 24, 2008 10:20 am    Post subject: Reply with quote

Did you actually change the data input method to 'Get Script Server Data' vs 'Get Script Data' under Data Queries?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9691
Location: MI, USA

PostPosted: Thu Jul 24, 2008 11:08 pm    Post subject: Reply with quote

There's a good instructional in the docs on setting up the script server. I want some of that hard liquor too

TheWitness
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group