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    


Alpha Testing Poller.php Performance
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
TheWitness
Developer


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

PostPosted: Fri Sep 15, 2006 10:12 am    Post subject: Reply with quote

Ok, I would like you to see if the following has any "positive" impact. I am thinking that it should not, but if you can test, I would appreciate it:

Files:
lib/poller.php
lib/rrd.php

Regards,

Larry



rrd.zip
 Description:

Download
 Filename:  rrd.zip
 Filesize:  11.22 KB
 Downloaded:  174 Time(s)


poller.zip
 Description:

Download
 Filename:  poller.zip
 Filesize:  3.8 KB
 Downloaded:  192 Time(s)

Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Fri Sep 15, 2006 10:18 am    Post subject: Reply with quote

I'll test this on monday morning and let you know.
Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Sun Sep 17, 2006 6:04 pm    Post subject: Reply with quote

I gave this a try on my production FreeBSD 5.4 box running Cacti 0.8.6h.
This box is severly overloaded and it will be swapped out with a newer FreeBSD 6.1 server this Monday 9/18/2006.

Anyway, just for the heck of it I ran your test poller and rrd php files!

I am not sure if this will give you any insight into my heavily overloaded server:

09/17/2006 06:51:48 PM - SYSTEM STATS: Time:708.0388 Method:cactid Processes:8 Threads:128 Hosts:219 HostsPerProcess:28 DataSources:31303 RRDsProcessed:12050
09/17/2006 06:51:48 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
09/17/2006 06:50:20 PM - CACTID: Poller[0] FATAL: Cactid Fork process encountered a FATAL error and must exit
09/17/2006 06:50:20 PM - CACTID: Poller[0] MYSQL: Connection Failed: Too many connections
09/17/2006 06:50:20 PM - PHPSVR: Poller[0] ERROR: Input Expected, Script Server Terminating
09/17/2006 06:50:20 PM - CACTID: Poller[0] MYSQL: Connection Failed: Too many connections Warning: mysql_pcon...
09/17/2006 06:50:20 PM - CACTID: Poller[0] Host[83] DS[6904] WARNING: Result from SCRIPT not valid. Partial Result: Warning: mysql_pcon...
09/17/2006 06:50:19 PM - CACTID: Poller[0] FATAL: Cactid Fork process encountered a FATAL error and must exit
09/17/2006 06:50:19 PM - CACTID: Poller[0] MYSQL: Connection Failed: #08004Too many connections

Well, tomorrow brings a new day and a new server!
Back to top
TheWitness
Developer


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

PostPosted: Sun Sep 17, 2006 6:42 pm    Post subject: Reply with quote

N3NCY,

You are your own worst enemy:

Concurrent Processes = 8
Threads = 128
Script Server Processes = n
Pollers = 1

MySQL Connections Required = Pollers + (Concurrent Processes * (Scripts_Servers Processes + Threads))

In your case:

1 + (8 * (128 + n))

Assuming: Script Servers Processes = 1

1 + (8 * 129) aka (Way too many)

Regards,

Larry
Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Sun Sep 17, 2006 6:48 pm    Post subject: Reply with quote

What settings can you recommend that I try?
Please be specific since this box will be replaced in the AM.

I would love to put correct settings, but do not quite get your meaning with the formula.
Back to top
TheWitness
Developer


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

PostPosted: Sun Sep 17, 2006 6:49 pm    Post subject: Reply with quote

Ernie,

Run the following from a sql command shell:

select count(action), action from poller_items group by action order by action;

Also,

How many processors? How much memory?

Larry
Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Sun Sep 17, 2006 7:02 pm    Post subject: Reply with quote

mysql> use cacti
Database changed
mysql> select count(action), action from poller_item group by action order by action;
+---------------+--------+
| count(action) | action |
+---------------+--------+
| 31043 | 0 |
| 255 | 1 |
| 5 | 2 |
+---------------+--------+
3 rows in set (0.00 sec)

This box is FreeBSD 5.4 with 3.0Ghz P4 and 1GB RAM.
Back to top
TheWitness
Developer


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

PostPosted: Sun Sep 17, 2006 7:05 pm    Post subject: Reply with quote

1) What is your Max OID's Per Get Request set too? Increase it until you start to loose OID's. Most modern devices handle 50 ok, and not much more.
2) Upgrade to the Beta2 of Cactid
3) Concurrent Processes 2, Threads 30, Script Servers 1

TheWitness
Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Sun Sep 17, 2006 7:35 pm    Post subject: Reply with quote

My max OID is 60.

I am still having issues compiling cactid beta 2.

I did dos2unix on every file.

I did try to compile similar to the non-beta cactid which works for me:

aclocal19
autoheader259
cp CHANGELOG ChangeLog
automake19
autoconf259
LD_LIBRARY_PATH=/usr/local/lib:/opt/net-snmp/lib/:/opt/mysql/lib/mysql/
export LD_LIBRARY_PATH
./configure --prefix=/opt/apache/htdocs/cacti --with-mysql=/opt/mysql/ --with-snmp=/opt/net-snmp/


<snip>
checking for mysql_thread_init in -lmysqlclient... yes
checking if UCD-SNMP needs crypto support... no
checking if Net-SNMP needs crypto support... no
checking for snmp_timeout in -lnetsnmp... no
Cannot find NET-SNMP libraries(snmp)... checking UCD-SNMP
checking for snmp_timeout in -lsnmp... no
configure: error: Cannot find UCD-SNMP libraries(snmp)

I cant configure so cant compile.
Back to top
TheWitness
Developer


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

PostPosted: Sun Sep 17, 2006 7:37 pm    Post subject: Reply with quote

Try this:

./configure --prefix=/opt/apache/htdocs/cacti --with-mysql=/opt/mysql --with-snmp=/opt/net-snmp

Larry
Back to top
N3NCY
Cacti User


Joined: 22 Sep 2005
Posts: 242
Location: Landenberg, PA

PostPosted: Mon Sep 18, 2006 12:48 am    Post subject: Reply with quote

Hmm same deal awith the configure line you gave me (like mine but more correct without trailing slashes) I still get:
Cannot find NET-SNMP libraries(snmp)... checking UCD-SNMP
checking for snmp_timeout in -lsnmp... no
configure: error: Cannot find UCD-SNMP libraries(snmp)


I wish I could figure out what the configure script was looking for on net-snmp. Previous versions of cactid compile and find net-snmp no problem.
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Mon Sep 18, 2006 3:10 am    Post subject: Reply with quote

TheWitness wrote:
Ok, I would like you to see if the following has any "positive" impact. I am thinking that it should not, but if you can test, I would appreciate it:

Hi Larry

are these files supposed to be used with Cacti 0.8.6i-beta4 ?
Back to top
kwabbernoot
Cacti User


Joined: 13 Oct 2003
Posts: 99
Location: Zottegem, Belgium

PostPosted: Mon Sep 18, 2006 4:50 am    Post subject: Updated Poller Reply with quote

Hi,

I migrated the poller and rrd php scripts of my cacti-0.8.6i svn version (downloaded 18/09/2006) to the alpha versions.

Polling still works fine, but the performance increase is very limited. I added the stats of the cacti log file.

Code:

Before migration
----------------
09/18/2006 10:32:30 AM - SYSTEM STATS: Time:148.8493 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:37:29 AM - SYSTEM STATS: Time:148.0685 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:42:34 AM - SYSTEM STATS: Time:152.6236 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:47:30 AM - SYSTEM STATS: Time:148.6650 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:52:27 AM - SYSTEM STATS: Time:144.8003 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:57:30 AM - SYSTEM STATS: Time:148.6372 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 10:58:24 AM - EXPORT STATS: ExportDate:2006-09-18_10:58:24 ExportDuration:53.0338 TotalGraphsExported:345

After migration
---------------
09/18/2006 11:22:28 AM - SYSTEM STATS: Time:146.8643 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 11:27:26 AM - SYSTEM STATS: Time:144.7466 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 11:32:30 AM - SYSTEM STATS: Time:147.9879 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 11:33:23 AM - EXPORT STATS: ExportDate:2006-09-18_11:33:23 ExportDuration:53.1022 TotalGraphsExported:345
09/18/2006 11:37:27 AM - SYSTEM STATS: Time:145.4172 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82
09/18/2006 11:42:34 AM - SYSTEM STATS: Time:151.9469 Method:cactid Processes:1 Threads:10 Hosts:19 HostsPerProcess:19 DataSources:121 RRDsProcessed:82


Regards,
Kwabbernoot.
Back to top
TheWitness
Developer


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

PostPosted: Mon Sep 18, 2006 6:02 am    Post subject: Reply with quote

Yea, not enough to justify a change at this point. After reviewing the code in more detail, I noted that the rrdupdates would only "not" be optimal if you were running either cactid from quite a few releases ago or cmd.php.

If you are running the latest release of Cactid, which writes most, if not all data from Cactid to the poller_output at once, you would not see any performance gain. It is assumed that if you are running cmd.php, you don't care.

So, the net of this is that the performance gain opportunity does not substantiate the change.

TheWitness
Back to top
TheWitness
Developer


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

PostPosted: Mon Sep 18, 2006 6:03 am    Post subject: Reply with quote

Ernie,

Can you please ls your directory structure under /opt/net-snmp? Can you list it.

Larry
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group