Jelajahi Sumber

HPCC-24961 Limit Performance Monitoring in container mode

- Removes perfmonintor in containerized mode
- Removes control:systemMonitor option

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexisrisk.com>
Rodrigo Pastrana 4 tahun lalu
induk
melakukan
ee6b6e7709

+ 6 - 0
dali/sasha/saserver.cpp

@@ -351,7 +351,9 @@ int main(int argc, const char* argv[])
                 coalesceDatastore(force);
             }
             else {
+#ifndef _CONTAINERIZED
                 startPerformanceMonitor(serverConfig->getPropInt("@perfReportDelay", DEFAULT_PERF_REPORT_DELAY)*1000);
+#endif
                 AddServers();
                 addAbortHandler(actionOnAbort);
 
@@ -397,7 +399,9 @@ int main(int argc, const char* argv[])
                 delete stopThread;
 
                 PROGLOG("SASERVER exiting");
+#ifndef _CONTAINERIZED
                 stopPerformanceMonitor();
+#endif
             }
             delete SashaServerStatus;
             SashaServerStatus = NULL;
@@ -405,7 +409,9 @@ int main(int argc, const char* argv[])
     }
     catch(IException *e){ 
         EXCLOG(e, "Sasha Server Exception: ");
+#ifndef _CONTAINERIZED
         stopPerformanceMonitor();
+#endif
         e->Release();
     }
     catch (const char *s) {

+ 9 - 0
dali/server/daserver.cpp

@@ -687,7 +687,10 @@ int main(int argc, const char* argv[])
             UseSysLogForOperatorMessages();
         AddServers(auditDir.str());
         addAbortHandler(actionOnAbort);
+
+#ifndef _CONTAINERIZED
         startPerformanceMonitor(serverConfig->getPropInt("Coven/@perfReportDelay", DEFAULT_PERF_REPORT_DELAY)*1000);
+#endif
         StringBuffer absPath;
         makeAbsolutePath(dataPath.str(), absPath);
         setPerformanceMonitorPrimaryFileSystem(absPath.str());
@@ -710,7 +713,9 @@ int main(int argc, const char* argv[])
         {
             EXCLOG(e, "Failed whilst starting servers");
             stopServer();
+#ifndef _CONTAINERIZED
             stopPerformanceMonitor();
+#endif
             throw;
         }
         try {
@@ -730,7 +735,9 @@ int main(int argc, const char* argv[])
         catch (IException *e) {
             EXCLOG(e, "LDAP initialization error");
             stopServer();
+#ifndef _CONTAINERIZED
             stopPerformanceMonitor();
+#endif
             throw;
         }
         PROGLOG("DASERVER[%d] starting - listening to port %d",myrank,queryMyNode()->endpoint().port);
@@ -755,7 +762,9 @@ int main(int argc, const char* argv[])
         }
         stopLogMsgListener();
         stopServer();
+#ifndef _CONTAINERIZED
         stopPerformanceMonitor();
+#endif
     }
     catch (IException *e) {
         EXCLOG(e, "Exception");

+ 5 - 0
ecl/eclccserver/eclccserver.cpp

@@ -907,9 +907,12 @@ int main(int argc, const char *argv[])
         }
         else
         {
+#ifndef _CONTAINERIZED
             unsigned optMonitorInterval = globals->getPropInt("@monitorInterval", 60);
             if (optMonitorInterval)
                 startPerformanceMonitor(optMonitorInterval*1000, PerfMonStandard, nullptr);
+#endif
+
 #ifdef _CONTAINERIZED
             bool filtered = false;
             std::unordered_map<std::string, bool> listenQueues;
@@ -967,7 +970,9 @@ int main(int argc, const char *argv[])
     {
         IERRLOG("Terminating unexpectedly");
     }
+#ifndef _CONTAINERIZED
     stopPerformanceMonitor();
+#endif
     globals.clear();
     UseSysLogForOperatorMessages(false);
     ::closedownClientProcess(); // dali client closedown

+ 2 - 1
esp/platform/espcfg.cpp

@@ -364,10 +364,11 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree*
         const unsigned dafilesrvConnectTimeout = m_cfg->getPropInt("@dafilesrvConnectTimeout", 10)*1000;
         const unsigned dafilesrvReadTimeout = m_cfg->getPropInt("@dafilesrvReadTimeout", 10)*1000;
         setRemoteFileTimeouts(dafilesrvConnectTimeout, dafilesrvReadTimeout);
-
+#ifndef _CONTAINERIZED
 #ifndef _DEBUG
         startPerformanceMonitor(m_cfg->getPropInt("@perfReportDelay", 60)*1000);
 #endif
+#endif
 
         IPropertyTreeIterator *pt_iter = NULL;
         StringBuffer xpath;

+ 7 - 0
fs/dafilesrv/dafilesrv.cpp

@@ -834,6 +834,7 @@ int main(int argc,char **argv)
     server->setThrottle(ThrottleStd, parallelRequestLimit, throttleDelayMs, throttleCPULimit);
     server->setThrottle(ThrottleSlow, parallelSlowRequestLimit, throttleSlowDelayMs, throttleSlowCPULimit);
 
+#ifndef _CONTAINERIZED
     class CPerfHook : public CSimpleInterfaceOf<IPerfMonHook>
     {
     public:
@@ -850,6 +851,8 @@ int main(int argc,char **argv)
         }
     } perfHook;
     startPerformanceMonitor(10*60*1000, PerfMonStandard, &perfHook);
+#endif
+
     writeSentinelFile(sentinelFile);
     try
     {
@@ -869,7 +872,11 @@ int main(int argc,char **argv)
             removeSentinelFile(sentinelFile); // so init does not keep trying to start it ...
         e->Release();
     }
+
+#ifndef _CONTAINERIZED
     stopPerformanceMonitor();
+#endif
+
     if (server)
         server->stop();
     server.clear();

+ 9 - 2
roxie/ccd/ccdmain.cpp

@@ -209,7 +209,9 @@ unsigned leafCacheMB = 50;
 unsigned blobCacheMB = 0;
 
 unsigned roxiePort = 0;
+#ifndef _CONTAINERIZED
 Owned<IPerfMonHook> perfMonHook;
+#endif
 
 MODULE_INIT(INIT_PRIORITY_STANDARD)
 {
@@ -1116,11 +1118,12 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
             mtu_size = 1400;    // upper limit on outbound buffer size - allow some header room too
             roxiemem::setDataAlignmentSize(0x400);
         }
-        unsigned pinterval = topology->getPropInt("@systemMonitorInterval",1000*60);
+#ifndef _CONTAINERIZED
         perfMonHook.setown(roxiemem::createRoxieMemStatsPerfMonHook());  // Note - we create even if pinterval is 0, as can be enabled via control message
+        unsigned pinterval = topology->getPropInt("@systemMonitorInterval",1000*60);
         if (pinterval)
             startPerformanceMonitor(pinterval, PerfMonStandard, perfMonHook);
-
+#endif
 
         topology->getProp("@pluginDirectory", pluginDirectory);
         StringBuffer packageDirectory;
@@ -1417,7 +1420,9 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
     }
 
     roxieMetrics.clear();
+#ifndef _CONTAINERIZED
     stopPerformanceMonitor();
+#endif
     ::Release(globalPackageSetManager);
     globalPackageSetManager = NULL;
     stopDelayedReleaser();
@@ -1428,7 +1433,9 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
     releaseRoxieStateCache();
     setDaliServixSocketCaching(false);  // make sure it cleans up or you get bogus memleak reports
     setNodeCaching(false); // ditto
+#ifndef _CONTAINERIZED
     perfMonHook.clear();
+#endif
     stopAeronDriver();
     stopTopoThread();
 

+ 4 - 0
roxie/ccd/ccdstate.cpp

@@ -2743,12 +2743,16 @@ private:
             }
             else if (stricmp(queryName, "control:systemMonitor")==0)
             {
+#ifndef _CONTAINERIZED
                 unsigned interval = control->getPropInt("@interval", 60000);
                 bool enable = control->getPropBool("@enable", true);
                 if (enable)
                     startPerformanceMonitor(interval, PerfMonStandard, perfMonHook);
                 else
                     stopPerformanceMonitor();
+#else
+                UNIMPLEMENTED; //better than ignoring 'control:systemMonitor' in containerized mode
+#endif
             }
             //MORE: control:stats??
             else

+ 4 - 1
thorlcr/master/thmastermain.cpp

@@ -1008,10 +1008,11 @@ int main( int argc, const char *argv[]  )
 
             writeSentinelFile(sentinelFile);
 
+#ifndef _CONTAINERIZED
             unsigned pinterval = globals->getPropInt("@system_monitor_interval",1000*60);
             if (pinterval)
                 startPerformanceMonitor(pinterval, PerfMonStandard, nullptr);
-
+#endif
             // NB: workunit/graphName only set in one-shot mode (if isCloud())
             thorMain(logHandler, workunit, graphName);
             LOG(MCauditInfo, ",Progress,Thor,Terminate,%s,%s,%s",thorname,nodeGroup.str(),queueName.str());
@@ -1044,7 +1045,9 @@ int main( int argc, const char *argv[]  )
     thorEndHandler->start(30);
 
     PROGLOG("Thor closing down 5");
+#ifndef _CONTAINERIZED
     stopPerformanceMonitor();
+#endif
     disconnectLogMsgManagerFromDali();
     closeThorServerStatus();
     PROGLOG("Thor closing down 4");

+ 4 - 0
thorlcr/slave/thslavemain.cpp

@@ -528,9 +528,11 @@ int main( int argc, const char *argv[]  )
                     multiThorMemoryThreshold = 0;
             }
 
+#ifndef _CONTAINERIZED
             unsigned pinterval = globals->getPropInt("@system_monitor_interval",1000*60);
             if (pinterval)
                 startPerformanceMonitor(pinterval, PerfMonStandard, nullptr);
+#endif
 
 #ifdef _CONTAINERIZED
             class CServerThread : public CSimpleInterfaceOf<IThreaded>
@@ -581,7 +583,9 @@ int main( int argc, const char *argv[]  )
             FLLOG(MCexception(e), thorJob, e,"ThorSlave");
         unregisterException.setown(e);
     }
+#ifndef _CONTAINERIZED
     stopPerformanceMonitor();
+#endif
     ClearTempDirs();
 
     if (multiThorMemoryThreshold)