<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>THE BIGPANDA SELF-MONITORING ALARM SYSTEM FOR ATLAS</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>A. Alekseev</string-name>
          <email>aleksandr.alekseev@cern.ch</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>T. Korchuganova</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>S. Padolski</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>on behalf of ATLAS Collaboration</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>86</fpage>
      <lpage>90</lpage>
      <abstract>
        <p>The BigPanDA monitoring system is a Web application created to deliver the real-time analytics, covering many aspects of the ATLAS experiment's distributed computing. The system serves about 35000 requests daily and provides critical information used as input for various decisions: from distribution of the payload among available resources to issue tracking related to any of 350 000 jobs running simultaneously. It evolves intensively; in particular, in 2017, the system received 933 commits, delivering new features and expanding the scope of the presented data. The experience of operating BigPanDA in 24/7 mode led to development of a multilevel selfmonitoring alarm system. This ELK-stack based solution covers all critical components of the BigPanDA: from user authentication to management of the number of connections to its database backend. The developed solution provides an intelligent error analysis, delivering to the operators only those notifications that need human intervention. We describe the architecture, principal features, and operation experience of self-monitoring, as well as its adaptation possibilities.</p>
      </abstract>
      <kwd-group>
        <kwd>BigPanDA monitoring system</kwd>
        <kwd>self-monitoring alarm system</kwd>
        <kwd>ELK-stack</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Tomsk Polytechnic University</title>
    </sec>
    <sec id="sec-2">
      <title>2 Brookhaven National Laboratory</title>
      <sec id="sec-2-1">
        <title>1. Introduction</title>
        <p>
          The BigPanDA monitoring is a multicomponent Web application developed for the ATLAS
experiment [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] at the Large Hadron Collider. It provides a comprehensive and coherent view of the
jobs executed by the PanDA workload management system [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], from high level summaries to detailed
drill-down job diagnostics [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. The BigPanDA monitoring processes over 40000 requests daily,
including about 25000 API calls from external consumers, such as Hammercloud service [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] or AES
monitoring [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. The core of the application is deployed on 9 backend server nodes behind a load
balancer and operates in the 24/7 mode. There are 5 principal components that define the system
architecture: Web-server (Apache), load-balancer (Nginx), DB backend (Oracle), distributed cache
storage (Redis) and external authentication providers (CERN, Google, GitHub). A failure of any of
them will lead to the whole BigPanDA unavailability and, consequently, loss of one of the most
important sources of information about massive calculations performed by ATLAS on GRID and
another computing resources [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Therefore it was crucial to create an advanced self-monitoring alarm
system for the BigPanDA monitoring, which would analyze its state in the real time mode and
immediately notify developers when an error happens. The self-alarm system design should reflect the
following:
● Execution time of complex data aggregation algorithms must be an observable metric.
●
        </p>
        <p>The self-alarm system should have a capability to monitor dependencies, such as libraries,
modules and external components.</p>
        <p>
          To satisfy the described needs, an ElasticSearch, Logstash and Kibana (ELK) [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] based
solution was proposed and implemented. This paper presents a state of the art overview, the
architecture and results of implementation of the self-monitoring alarm system which currently serves
as a driver for the process of improving the BigPanDA reliability.
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2. Classification of the BigPanDA system errors</title>
        <p>The BigPanDA monitoring related errors could be grouped into three main categories
depending on the layer where these errors occur and degree of their impact on a performance and the
system stability:
● Internal BigPanDA system errors. These errors occur at the Django application layer and
include the following types:</p>
        <p>View errors. This is a critical type of errors originating in the Python code when unit
tests failed to cover a particular case, and they lead to unavailability of some views to
users. An unhandled exception of a wrong variable type or none values, in particular,
leads to errors in this category.</p>
        <p>Request errors. This is a non-critical type of errors coming from a combination of
user’s query parameters and system state due to a lack of its support in the processing
algorithms. A malformed URL request is an example.
●</p>
        <p>External systems errors. Errors of this category are caused by external components and
system modules failures. They include the following types:</p>
        <p>Database errors. These are a critical type of errors which happen when the system
unsuccessfully attempts to retrieve data from the PanDA database. Such errors could
be caused, for example, by exceeding the number of simultaneous sessions to the
Oracle backend.</p>
        <p>Dependency libraries errors are non-critical and raised in Python modules which are
used by the BigPanDA monitoring system. One of the most frequently observed
example is a “missing user session state” error in the social-auth library.</p>
        <p>Cache errors is a critical type of errors which are related to the Redis distributed cache
storage.
●</p>
        <p>Superfluous requests. This category of events that also needs to be handled is associated with
users requests and their frequency when they create a negative impact on the system stability.</p>
        <p>The DoS-attack or irresponsible user behavior are examples of such events.</p>
      </sec>
      <sec id="sec-2-3">
        <title>3. State of the art approaches for self-monitoring</title>
        <p>
          The self-monitoring is a process of collecting, processing, aggregating, and displaying
information about the current state of server nodes, components and modules in the real-time mode.
There are two main approaches that can be used both separately and jointly to provide the
selfmonitoring functionality. The Simple Network Management Protocol (SNMP) is widely used for
collecting information from network devices and servers. Solutions built on SNMP consist of four
main components: an agent which collects various metrics values, SNMP-managed devices and
resources, SNMP-manager and the management information base (MIB) [8]. The following
selfmonitoring software implements this approach:
 SolarWinds Server and Application Monitor (SAM). It provides easy installation and
setup, great visualization capabilities, but there are some limits implied by commercial
licencing and this software to the best of our knowledge, supports only Microsoft
Windows platform [
          <xref ref-type="bibr" rid="ref8">9</xref>
          ].
 Zabbix is a very powerful open-source software which provides rich functionality for
Django applications monitoring but requires installation of special agents and
customization efforts [
          <xref ref-type="bibr" rid="ref9">10</xref>
          ].
 Nagios is an open-source software which provides rich opportunities for servers and
software health monitoring network infrastructure but needs a special configuration for
the BigPanDA what may require considerable time for customization [
          <xref ref-type="bibr" rid="ref10">11</xref>
          ].
        </p>
        <p>
          Another approach is based on the event logs analysis. Aggregation of the logs content allows
to detect hidden system errors, track user activity, collect other system statistics [
          <xref ref-type="bibr" rid="ref11">12</xref>
          ]. The following
solutions can be used for analyzing and processing logs:
 Graylog is an open-source log monitoring solution which provides rich opportunities for
data processing and visualization. However, it requires a special infrastructure to be
deployed, including ElasticSearch as a logs storage and MongoDB as a configuration data
storage [
          <xref ref-type="bibr" rid="ref12">13</xref>
          ].

        </p>
        <p>
          ELK-stack is a collection of the open-source products which could be used for logs
processing at data center scales. In this stack, the ElasticSearch, Logstash and Kibana are
responsible for storing, processing and visualizing logs messages correspondingly. When
the project has started, the ATLAS experiment had the ELK infrastructure already
deployed, but a component dedicated to logs collecting was missing [
          <xref ref-type="bibr" rid="ref12">13</xref>
          ]. Additionally, it
was required to develop a custom log messages processing scheme.
        </p>
        <p>
          As it was pointed out, both SNMP and Event logs based analysis approaches require specific
deployment procedures. Since ATLAS had an already existing ELK based infrastructure for the
PanDA system logs processing [
          <xref ref-type="bibr" rid="ref13">14</xref>
          ] in operation and centrally supported, it was decided to develop
the self-monitoring alarm system for the BigPanDA using this approach.
        </p>
      </sec>
      <sec id="sec-2-4">
        <title>4. The BigPanDA self-monitoring alarm system</title>
        <p>
          Filebeat [
          <xref ref-type="bibr" rid="ref14">15</xref>
          ] was installed on all BigPanDA server nodes in order to collect asynchronously
all logs generated by the system. That data is streamed to the Logstash servers in the real time mode.
Logstash aggregates all data flows from the Filebeat nodes, parses event logs messages and forwards
the processed data to ElasticSearch. When an issue happens, the self-monitoring alarm system sends a
notification message containing an error description to the developers. Architecture of the BigPanDA
self-monitoring alarm system is shown in Figure 1.
        </p>
        <p>The BigPanDA monitoring system produces two types of log files. The first one is a Django
application log containing comprehensive information about the system activity. The second one is a
Web-server log where all user requests are collected. An error description consists of information from
both log types merged into a single message. The critical errors filtered by “Internal Server Error”
condition can be caused by issues described in section 2 of this paper. The non-critical errors related to
the infrastructure components are catched from Apache logs and filtered by the messages signature.
This approach of BigPanDA logs processing allows to get only information from a large array of data
which require an urgent developer intervention. The system sends error notifications both to
BigPanDA developers and to a ADC Central Services operations member managing the BigPanDA
infrastructure.</p>
      </sec>
      <sec id="sec-2-5">
        <title>5. Results</title>
        <p>The self-monitoring alarm system for the BigPanDA monitoring is in production since May
2017 and processes around 1 million log messages daily. The ELK-stack is used as core of the system
for message filtering and sending error notifications to BigPanDA developers. Generally about 4000
notification candidates are generated daily by BigPanDA monitoring system and 99.5% of them are
from broken client connections that can occur when a human user or script interrupts a session before
the system deliver results. The self-monitoring system delivers only 0.5% of errors which explicitly
require BigPanDA developers attention. Rest of them does not provide impact on the user experience
and not needs to be fixed. Based on the information received from the developed solution, patches for
Nginx load balancer, WSGI garbage collector and DDoS protection mechanism were developed and
implemented. Development and implementation of the self-monitoring alarm system allowed to
increase stability of the BigPanDA monitoring system and reduce the total number of errors.</p>
      </sec>
      <sec id="sec-2-6">
        <title>Acknowledgments</title>
        <p>This work was funded by the Russian Science Foundation under contract No 16-11-10280.
Available</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>The</surname>
            <given-names>ATLAS Collaboration</given-names>
          </string-name>
          ,
          <source>2008 The ATLAS experiment at the CERN Large Hadron Collider Journal of Instrumentation</source>
          vol
          <volume>3</volume>
          S08003
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Maeno</surname>
            <given-names>T.</given-names>
          </string-name>
          et al
          <year>2008</year>
          <article-title>PanDA: distributed production and distributed analysis system for atlas</article-title>
          <source>Journal of Physics: Conference Series</source>
          vol
          <volume>119</volume>
          no 6
          <issue>P 062036</issue>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Schovancova</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimentov</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Love</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Potekhin</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wenaus</surname>
            <given-names>T. 2014</given-names>
          </string-name>
          <article-title>The next generation of ATLAS PanDA Monitoring</article-title>
          .
          <source>The International Symposium on Grids and Clouds (ISGC) 2014 March 23-28</source>
          , 2014 Academia Sinica, Taipei, Taiwan
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Daniel C van der Ster</surname>
          </string-name>
          , Johannes Elmsheuser,
          <article-title>Mario Úbeda García1 and Massimo Paladin 2011 HammerCloud: A Stress Testing System for Distributed Analysis J</article-title>
          .
          <source>Phys.: Conf. Ser. 331 072036</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>AES</given-names>
            <surname>Monitoring</surname>
          </string-name>
          . Available at: https://atlante.cern.ch/dashboard/db/event-service-sites?
          <source>orgId=1 (accessed on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>De</surname>
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimentov</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maeno</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nilsson</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oleynik</surname>
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Panitkin</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Petrosyan</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schovancova</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vaniachine</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wenaus</surname>
            <given-names>T.</given-names>
          </string-name>
          <article-title>on behalf of the ATLAS Collaboration 2015 The future of PanDA in ATLAS distributed computing J</article-title>
          .
          <source>Phys.: Conf. Ser. 664 062035</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <article-title>[7] Welcome to the ELK Stack: Elasticsearch, Logstash,</article-title>
          and
          <source>KibanaPosted by John Vanderzyden July 17</source>
          ,
          <year>2015</year>
          https://qbox.io/blog/welcome
          <article-title>-to-the-elk-stack-elasticsearch-logstash-kibana (</article-title>
          <source>accessed on 15.10</source>
          .
          <year>2018</year>
          ) [8]
          <string-name>
            <given-names>SimpleNetworkManagement</given-names>
            <surname>Protocol (SNMP) Documentation</surname>
          </string-name>
          . https://searchnetworking.techtarget.com/definition/SNMP (accessed
          <source>on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Server</given-names>
            <surname>&amp; Application Monitor Guide</surname>
          </string-name>
          . Available at: https://www.solarwinds.com/- /media/solarwinds/swdcv2/licensed-products/server-application-monitor/resources/productguides/sam_evaluators_guide.
          <source>ashx?la=es (accessed on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [10]
          <issue>Zabbix Documentation 4</issue>
          .0. Available at: https://www.zabbix.
          <source>com/documentation/4</source>
          .0/manual (accessed
          <source>on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Nagios</surname>
            <given-names>Core</given-names>
          </string-name>
          <string-name>
            <surname>Documentation</surname>
          </string-name>
          . Available at: https://assets.nagios.com/downloads/nagioscore/docs/ nagioscore/4/en/toc.
          <source>html (accessed on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Techopedia. Log</given-names>
            <surname>Analysis</surname>
          </string-name>
          . Available at: https://www.techopedia.com/definition/31756/loganalysis (accessed
          <source>on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>Log</given-names>
            <surname>Monitoring</surname>
          </string-name>
          and
          <string-name>
            <surname>Analysis: Comparing</surname>
            <given-names>ELK</given-names>
          </string-name>
          , Splunk and Graylog. Available at: https://devops.com
          <article-title>/log-monitoring-and-analysis-comparing-elk-splunk-and-graylog/</article-title>
          <source>(accessed on 15.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Saiz</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwickerath</surname>
            <given-names>U.</given-names>
          </string-name>
          2017
          <source>Centralising elasticsearch Technical report (Geneva</source>
          , CERN)
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Filebeat</surname>
          </string-name>
          overview Available at: https://www.elastic.co/guide/en/beats/filebeat/current/filebeatoverview.
          <source>html (accessed on 29.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>