HOWTO Speed UP cmd.php ???
Moderators: Developers, Moderators
HOWTO Speed UP cmd.php ???
Hi, currently I have lot of monitors and the script cmd.php get too many time to do all the job, that at the crontab start a new process. The problem is that after a while, I have too many process and the server slow down until it crash.
I hear about alternatives to cmd.php that are faster, because are written in C/C++.
Any documentation in how to implement that?
BTW, CACTI is the best RRD fron end as I know, so thanks to Ian for his dedication in beneffit to all.
I hear about alternatives to cmd.php that are faster, because are written in C/C++.
Any documentation in how to implement that?
BTW, CACTI is the best RRD fron end as I know, so thanks to Ian for his dedication in beneffit to all.
-
- Posts: 5
- Joined: Tue Sep 07, 2004 5:20 am
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
We have addressed scalability issues with cmd.php in 0.8.6 due to be released in the next few days (and I mean it this time for others who have heard this before).
In 0.8.6 we have adopted a new poller architecture that allows from 1-n cmd.php processes to be run in paralell/concurrently.
In future releases we will also support separate polling servers. How bout' that?
TheWitness
In 0.8.6 we have adopted a new poller architecture that allows from 1-n cmd.php processes to be run in paralell/concurrently.
In future releases we will also support separate polling servers. How bout' that?
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Please elaborate; what does this actually do? Does that prevent the script from looking up the text values of the OIDs - I thought that was getting handled already through switches to the walk & get portions of the SNMP queries.kelp wrote:If you put this line:
MIBS=""
In the crontab you use to run poller.php you should see about a 4-6x performance increase.
Thanks,
Burke - MCP+I, MCSE, MCSD, CNE, CCA, CCNA, LPIC-1
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
If you use external snmp support each time snmpget is run it loads and parses default MIB files. It takes some time causing longer startup. If you set MIBS variable to empty string snmpget will not load any file therefore you save some time. cmd.php launching snmpget often can work faster this way. The same can be done by using -m '' option of snmpget.
- Piotr
- Piotr
thanks for the info
poller.php before : 57 s (using cmd.php)
after using the '-m "" ' option : 25s
how to :
edit the lib/snmp.php
line 72 and 74 :
poller.php before : 57 s (using cmd.php)
after using the '-m "" ' option : 25s
how to :
edit the lib/snmp.php
line 72 and 74 :
lines 123 and 125 :if (read_config_option("snmp_version") == "ucd-snmp") {
exec(read_config_option("path_snmpget") . " -m \"\" -O vt -v$version -t $timeout -r $retries $hostname:$port $snmp_auth $oid", $snmp_value);
}elseif (read_config_option("snmp_version") == "net-snmp") {
exec(read_config_option("path_snmpget") . " -m \"\" -O vt $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid", $snmp_value);
if (read_config_option("snmp_version") == "ucd-snmp") {
$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -m \"\" -v$version -t $timeout -r $retries $hostname:$port $snmp_auth $oid");
}elseif (read_config_option("snmp_version") == "net-snmp") {
$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -m \"\" $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid");
}
Last edited by Mikf on Wed Oct 20, 2004 1:12 pm, edited 4 times in total.
Thanks for the extra detail --- Is there a particular reason this cannot be included in the next release? Will it break anything? If it doesn't break anything, it seems like a great little add to the source.
Burke - MCP+I, MCSE, MCSD, CNE, CCA, CCNA, LPIC-1
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
Maybe I found a particular reason... This may not work on all systems.. Are you using UCD or NET snmp?
The system I'm on is using UCD and this didn't appear to do anything for mine. I'm still doing further tests, but so far, no improvements
Tried making the entry in crontab - that resulted in all results from CMD being not valid.
Tried the -m MIB -- didn't cause additional errors, but didn't improve performance for me
cacti 0.8.6b / Mandrake 9.0 / ucd-snmp-4.2.3-4mdk / apache 1.3.26-6.1mdk
Approx 535 Data Sources being updated. Current Time is 127.7581 s according to the SYSTEM STATS output.
The system I'm on is using UCD and this didn't appear to do anything for mine. I'm still doing further tests, but so far, no improvements
Tried making the entry in crontab - that resulted in all results from CMD being not valid.
Tried the -m MIB -- didn't cause additional errors, but didn't improve performance for me
cacti 0.8.6b / Mandrake 9.0 / ucd-snmp-4.2.3-4mdk / apache 1.3.26-6.1mdk
Approx 535 Data Sources being updated. Current Time is 127.7581 s according to the SYSTEM STATS output.
Burke - MCP+I, MCSE, MCSD, CNE, CCA, CCNA, LPIC-1
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
[url=http://www.technicalvalues.com]My Website[/url] ::[url=http://www.technicalvalues.net]Domain Registrations, SSL Certs, and Hosting[/url]
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Please post the code once changed and I will get into CVS for 0.8.7.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
This code is working with net-snmp and ucd-snmp
but i cannot test it for ucd-snmp
(-m "" option is working in command line for both)
edit the lib/snmp.php
line 72 and 74 :
but i cannot test it for ucd-snmp
(-m "" option is working in command line for both)
edit the lib/snmp.php
line 72 and 74 :
lines 123 and 125 :if (read_config_option("snmp_version") == "ucd-snmp") {
exec(read_config_option("path_snmpget") . " -m \"\" -O vt -v$version -t $timeout -r $retries $hostname:$port $snmp_auth $oid", $snmp_value);
}elseif (read_config_option("snmp_version") == "net-snmp") {
exec(read_config_option("path_snmpget") . " -m \"\" -O vt $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid", $snmp_value);
if (read_config_option("snmp_version") == "ucd-snmp") {
$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -m \"\" -v$version -t $timeout -r $retries $hostname:$port $snmp_auth $oid");
}elseif (read_config_option("snmp_version") == "net-snmp") {
$temp_array = exec_into_array(read_config_option("path_snmpwalk") . " -m \"\" $snmp_auth -v $version -t $timeout -r $retries $hostname:$port $oid");
}
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Mikf,
Unfortunately, this method of performing an SNMPGET or SNMPWALK will fail for some text strings and result in an assertion failure when you select "Verify All Fields" for the reindex type.
TheWitness
Unfortunately, this method of performing an SNMPGET or SNMPWALK will fail for some text strings and result in an assertion failure when you select "Verify All Fields" for the reindex type.
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Ok, this thing is getting real frustrating. It now turns out that the environment variable MIBS=ALL is causing the problem. It turns out that the RFC1213 mib is over writing the IF-MIB causing the text to be displayed as HEX.
Therefore, the fix is to remove the MIBS=ALL entirely. This will resolve the issue. As such, we should be able to add the speedup parameter.
TheWitness
Therefore, the fix is to remove the MIBS=ALL entirely. This will resolve the issue. As such, we should be able to add the speedup parameter.
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 0 guests