pcp
[Top] [All Lists]

Re: Oracle connection debugging (was Re: [pcp] Handling Oracle PMDA Late

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: Oracle connection debugging (was Re: [pcp] Handling Oracle PMDA Latencies)
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Thu, 26 May 2016 12:05:51 +0300
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <142091188.49924255.1464248230746.JavaMail.zimbra@xxxxxxxxxx>
Organization: Red Hat
References: <56F25541.9020602@xxxxxxxxxx> <57395F04.2090909@xxxxxxxxxx> <1695396289.47966126.1463381940778.JavaMail.zimbra@xxxxxxxxxx> <573D897A.5070804@xxxxxxxxxx> <626822210.48972762.1463726815586.JavaMail.zimbra@xxxxxxxxxx> <573EDF38.1020102@xxxxxxxxxx> <594283644.49214956.1463982724891.JavaMail.zimbra@xxxxxxxxxx> <5742C49E.4090208@xxxxxxxxxx> <142091188.49924255.1464248230746.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
Hi,

On 2016-05-26 10:37, Nathan Scott wrote:
> ----- Original Message -----
>> [...]
>> so I can't see how to improve this. Thus your suggestion to make these
>> two clusters opt-in is probably the most feasible solution at least in
>> the short-term. Here oracle.object_cache will be ignored but I can try
>> to see how things work after enabling oracle.file.
> 
> My main QA machine is in the late stages of dying unfortunately, so I've
> not finished QA on this change yet - but, here's a pmdaoracle.pl patch to
> try out in the meantime.  (see $disable_object_cache & $disable_filestat)

Thank you very much - now after disabling object cache in the configuration
file ./Install works as expected and "time pminfo -f oracle > /dev/null"
reports time between 2.7-3.6s under medium load.

Below is a trivial patch to keep connect.pl in sync (all the variables
need to be defined before eval) and tidy up reporting a bit.

With these two patches I think we're in decent shape here.

PS. I noticed this in QA 023, looks like a typo?

        -e '/cmd=\/usr\/pcp\/lib\/pmdaoracle7/d' \

---
 src/pmdas/oracle/connect.pl  | 10 +++++++---
 src/pmdas/oracle/sample.conf |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/pmdas/oracle/connect.pl b/src/pmdas/oracle/connect.pl
index 9d21f5b..a889407 100755
--- a/src/pmdas/oracle/connect.pl
+++ b/src/pmdas/oracle/connect.pl
@@ -24,6 +24,8 @@ my $password = 'manager';
 my $host = 'localhost';
 my $port = '1521';
 my @sids = ( 'master' );
+my $disable_filestat = 0;
+my $disable_object_cache = 0;
 
 # Configuration files for overriding the above settings
 for my $file ( '/etc/pcpdbi.conf',     # system defaults (lowest priority)
@@ -49,18 +51,20 @@ if (defined($ARGV[0]) && ($ARGV[0] eq '-c' || $ARGV[0] eq 
'--config')) {
     }
     chop($sidstr);
     print("sids=$sidstr\n");
+    print("disable_filestat=$disable_filestat\n");
+    print("disable_object_cache=$disable_object_cache\n");
     exit(0);
 }
 
 my $status = 0;
 foreach my $sid (@sids) {
     print("Attempting Oracle login SID=$sid ... ");
-    my $db = DBI->connect("dbi:Oracle:host=$host;port=$port;sid=$sid", 
$username, $password);
+    my $db = DBI->connect("dbi:Oracle:host=$host;port=$port;sid=$sid", 
$username, $password, { PrintError => 0});
     if (defined($db)) {
        $db->disconnect();
-       print("OK\n");
+       print("ok.\n");
     } else {
-       print("Failed\n%s", $DBI::errstr);
+       printf("failed!\n%s\n", $DBI::errstr);
        $status = 1;
     }
 }
diff --git a/src/pmdas/oracle/sample.conf b/src/pmdas/oracle/sample.conf
index 6502c8b..8e3a645 100644
--- a/src/pmdas/oracle/sample.conf
+++ b/src/pmdas/oracle/sample.conf
@@ -1,6 +1,7 @@
 $username = 'oastoltp';
 $password = 'oastoltp';
 @sids = ( 'oast1' );
+$disable_object_cache = 1;
 
 # this is to get LD_LIBRARY_PATH set at pmdaoracle start,
 # which is required to correctly resolve shared libraries

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>