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    


[INFO] Speed Boost for CMD.PHP / Increase MySQL Performance

 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
TheWitness
Developer


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

PostPosted: Thu Sep 16, 2004 4:26 am    Post subject: [INFO] Speed Boost for CMD.PHP / Increase MySQL Performance Reply with quote

Speed Boost in CMD.PHP and MySQL:

Based upon two user suggestions, the following configuration changes should enhance Cacti performance.

First, if you are using CMD.PHP:

Remove your MIBS environment variable, if it is on the system. According to the user, it spead up polling significantly.

Second, if you are using MySQL 4.x, you should change your my.cnf or my.ini to include the following directives. You will need to restart MySQL to implement. This will reduce MySQL load drastically.

set-variable=key_buffer=32M
query_cache_size=64M

Also, MySQL Administrator is a great realtime tool for viewing load while polling and viewing cache and key buffer hit rates.

TheWitness


Last edited by TheWitness on Thu Nov 25, 2004 9:12 am; edited 1 time in total
Back to top
JoeNetwork



Joined: 16 Feb 2004
Posts: 38
Location: Westland, MI

PostPosted: Fri Sep 17, 2004 12:34 am    Post subject: Reply with quote

What about if we have MySQL 3.x?

Is it worth upgrading to 4.x, or is there a different variable we can tweak?
Back to top
TheWitness
Developer


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

PostPosted: Fri Sep 17, 2004 7:02 am    Post subject: Reply with quote

Not applicable to 3.x. Sorry. I suggest a meaningfull and well thought out upgrade. It significantly reduced my Disk IO and CPU (120 Devices, ~2000 Data Sources).

TheWitness
Back to top
karlkatzke



Joined: 03 Apr 2005
Posts: 10
Location: Tigard, OR

PostPosted: Sun Apr 03, 2005 5:03 pm    Post subject: Reply with quote

I'd beware of setting the values that high if you're running on a machine with limited memory. For instance, the box I have cacti running on only has 256MB of Ram... using that much of it just for queryspace on MySQL might hurt it. Only way to tell is to do it, though... and report your results back here.
Back to top
roddie
Cacti User


Joined: 10 Feb 2004
Posts: 90
Location: Frisco, TX

PostPosted: Thu Jul 28, 2005 11:05 am    Post subject: Reply with quote

Larry,

Quote:
Also, MySQL Administrator is a great realtime tool for viewing load while polling and viewing cache and key buffer hit rates.


Is this a Windows tool? I just upgraded to MySQL 4.1 on my Solaris cacti server and had to do a bit of InnoDB tuning to make it actually perform the way 3.23.58 did.

So far, so good, but I'm still up around 120 seconds with my setup.

Code:
07/28/2005 12:02:02 PM - SYSTEM STATS: Time: 120.8754 s, Method: cactid, Processes: 1, Threads: 3, Hosts: 196, Hosts/Process: 196, Data Sources 5164, RRDs Processed 2901
Back to top
gandolfi



Joined: 28 Jul 2005
Posts: 2

PostPosted: Thu Jul 28, 2005 5:55 pm    Post subject: Just Newbie... Reply with quote

TheWitness wrote:
Not applicable to 3.x. Sorry. I suggest a meaningfull and well thought out upgrade. It significantly reduced my Disk IO and CPU (120 Devices, ~2000 Data Sources).

TheWitness


I'm starting to use cacti, and I was planning to install it in a win2k server, but I have 1187 Devices (most of them routers) but but no more than 3000 data sources...

I have php5 and mysql 4. What CPU should I use to get it working fine (and how many RAM) ? (It's a P4 2.0 with 512 enough?)

I was thinking that a linux box maybe better...

Another question... Should I put the poller to run every 10 minutes instead of 5 ? (just to give it time to finish)

Thanks in advance...

Ariel
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12206
Location: Muenster, Germany

PostPosted: Sun Jul 31, 2005 6:23 am    Post subject: Reply with quote

Ariel,

have a look at the metrics posted at http://forums.cacti.net/viewtopic.php?t=6206. Your timing will depend on the data gathering method, e.g. better if you use SNMP, slower if you use lots of scripts. Use cactid as a data gatherer.

happy "cacti"ing
Reinhard
Back to top
dgerow



Joined: 07 Aug 2006
Posts: 6

PostPosted: Thu Aug 10, 2006 5:30 am    Post subject: Reply with quote

(Hopefully people don't mind me dredging up an old thread.)

I've been playing around with our cacti installation, using cmd.php, as cactid segfaults as soon as it reads the maximum SNMP OIDs per request, and I've not had the time to figure out why yet. I just re-compiled PHP to include php-snmp, instead of snmpget. Our polling time dropped from well over two minutes to less than thirty seconds, and the system load dropped from ~10 to >0.5 while polling.

Additionally, I'm finding that a /smaller/ number of concurrent poller processes is actually better. When using 50 processes, the total runtime was reliably around 47 seconds. Now that I've dropped it to 10 processes, we're looking at a runtime of 10 seconds. This is with 80 hosts and 1800 data sources.

Combining these two, the system load has dropped to >0.1, and CPU utilization has dropped from 100% to a maximum spike of ~25%, all while doing polling. This is on a quad 3.6GHz Xeon (yeah, a touch overkill) with 4GB RAM, running MySQL 4.1.19.
Back to top
Suicidal



Joined: 23 Jan 2006
Posts: 6

PostPosted: Thu Nov 02, 2006 4:29 pm    Post subject: Reply with quote

I found the absolute best improvement is to use the devices actual ip address vs. fqdn:


11/02/2006 12:34:22 PM - SYSTEM STATS: Time:59.8656 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:153
11/02/2006 12:35:30 PM - SYSTEM STATS: Time:60.0798 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:113
11/02/2006 12:37:25 PM - SYSTEM STATS: Time:62.7944 Method:cactid Processes:2 Threads:4 Hosts:6 HostsPerProcess:3 DataSources:238 RRDsProcessed:113
11/02/2006 12:38:59 PM - SYSTEM STATS: Time:56.7890 Method:cactid Processes:8 Threads:4 Hosts:6 HostsPerProcess:1 DataSources:238 RRDsProcessed:113
11/02/2006 12:40:14 PM - SYSTEM STATS: Time:62.0994 Method:cactid Processes:1 Threads:4 Hosts:6 HostsPerProcess:6 DataSources:238 RRDsProcessed:113
11/02/2006 12:42:01 PM - SYSTEM STATS: Time:55.6983 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:113
11/02/2006 12:43:15 PM - SYSTEM STATS: Time:54.7663 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:113
11/02/2006 12:45:49 PM - SYSTEM STATS: Time:55.7001 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:90
<---- changed to ip addressing here ---->
11/02/2006 12:48:03 PM - SYSTEM STATS: Time:6.2655 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:113
11/02/2006 12:53:18 PM - SYSTEM STATS: Time:7.2820 Method:cactid Processes:4 Threads:8 Hosts:6 HostsPerProcess:2 DataSources:238 RRDsProcessed:113
11/02/2006 12:54:32 PM - SYSTEM STATS: Time:3.2186 Method:cactid Processes:2 Threads:4 Hosts:6 HostsPerProcess:3 DataSources:238 RRDsProcessed:113
11/02/2006 12:54:45 PM - SYSTEM STATS: Time:2.1760 Method:cactid Processes:1 Threads:4 Hosts:6 HostsPerProcess:6 DataSources:238 RRDsProcessed:113
11/02/2006 12:55:02 PM - SYSTEM STATS: Time:2.2006 Method:cactid Processes:1 Threads:6 Hosts:6 HostsPerProcess:6 DataSources:238 RRDsProcessed:113
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 6769
Location: WA, USA

PostPosted: Thu Nov 02, 2006 5:48 pm    Post subject: Reply with quote

Suicidal wrote:
I found the absolute best improvement is to use the devices actual ip address vs. fqdn:


Wow. You sure thats just not a DNS problem on your side?
Back to top
SyxPak



Joined: 24 Mar 2006
Posts: 9
Location: Ireland

PostPosted: Thu Nov 23, 2006 5:26 am    Post subject: Reply with quote

Maybe try using a local dns caching proxy perhaps, or nscd?

That said, I use IP only too. Our hostnames here are too long to type
Back to top
_Dmitry_



Joined: 18 Sep 2007
Posts: 26
Location: DE

PostPosted: Wed Oct 17, 2007 8:48 am    Post subject: Reply with quote

Small Tip to increase your CACTI Performance.

If your Poller Statistic looks like this one in attachment (always slowly increasing, without any new Data sources). Check your poller_output table !!!

And if there are any old values then delete from poller_output And after that fix Data source which is spamming this table.

Gives a lot of Performance boost



cacti_pooler.png
 Description:
 Filesize:  50.45 KB
 Viewed:  14708 Time(s)

cacti_pooler.png


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12206
Location: Muenster, Germany

PostPosted: Thu Oct 18, 2007 2:39 pm    Post subject: Reply with quote

Please increase php memory settings in this case as given in the second link of my signature
Reinhard
Back to top
_Dmitry_



Joined: 18 Sep 2007
Posts: 26
Location: DE

PostPosted: Fri Oct 19, 2007 1:56 am    Post subject: Reply with quote

gandalf wrote:
Please increase php memory settings in this case as given in the second link of my signature
Reinhard


That's was not the problem. I have memory_limit = 128M.
That was buggy Script, and after few week I've had in this table ~50000-80000 rows.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group