alerta / alerta-webui

Alerta Web UI 7.0
https://try.alerta.io
Apache License 2.0
112 stars 56 forks source link

memory leak #476

Open wimfabri opened 3 years ago

wimfabri commented 3 years ago

When you leave the alerts page open in the browser (tested with both chrome and firefox) the memory usage of the browser process keeps growing. version: docker image alerta-web:latest digest: 7f9be380bf07f2bf4a0d49de1ac1a0538054c1bbff0473489a15e0472e598f76 alerta.conf:

AUTH_REQUIRED = True
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxx
CUSTOMER_VIEWS = True
ADMIN_USERS = [ 'wfabri@xenit' ]
SIGNUP_ENABLED = False

AUTH_PROVIDER = 'ldap'

LDAP_URL="ldaps://ldap1.local.xenit.eu"

LDAP_BIND_USERNAME = 'xxxxxxxxxxxxxxxxxxxxx'
LDAP_BIND_PASSWORD = 'xxxxxxxxxxxxxxxxxxxxx'

LDAP_DOMAINS = {
    'xenit': 'uid=%s,ou=People,dc=xenit,dc=eu',
    'alerta': 'uid=%s,ou=Alerta,dc=xenit,dc=eu'
}
LDAP_DOMAINS_GROUP = {
    'xenit': '(&(memberUid={username})(objectClass=posixGroup))',
    'alerta': '(&(memberUid={username})(objectClass=posixGroup))'
}
LDAP_DOMAINS_BASEDN = {
    'xenit': 'ou=Alerta,dc=xenit,dc=eu',
    'alerta': 'ou=Alerta,dc=xenit,dc=eu'
}
LDAP_GROUP_NAME_ATTR = 'memberUid'

LDAP_GROUP_BASEDN = 'ou=Alerta,dc=xenit,dc=eu'
LDAP_GROUP_FILTER = '(&(memberUid={username})(objectClass=groupOfMembers))'
LDAP_GROUP_NAME_ATTR = 'cn'

ALLOWED_EMAIL_DOMAINS = ['xenit', 'alerta']

LDAP_CONFIG = {
    'OPT_REFERRALS': 0,
    'OPT_PROTOCOL_VERSION': 3,
#    'OPT_DEBUG_LEVEL': -1
}

DEBUG = False

PLUGINS = ['blackout']

AUTO_REFRESH_INTERVAL = 20000

SEVERITY_MAP = {
      'security': 0,
      'critical': 1,
      'error': 2,
      'major':2,
      'warning': 5,
      'acc_critical': 3,
      'acc_error': 4,
      'acc_warning': 6,
      'dev_critical': 7,
      'dev_error': 8,
      'dev_warning': 9,
      'tst_critical': 7,
      'tst_error': 8,
      'tst_warning': 9,
      'ok': 10,
      'normal': 10,
      'indeterminate': 11
}
DEFAULT_NORMAL_SEVERITY = 'ok'
DEFAULT_PREVIOUS_SEVERITY = 'indeterminate'
COLOR_MAP = {
      'severity': {
        'critical'    : '#ffaab4',
        'error'       : '#ffc8c8',
        'major'       : '#ffc8c8',
        'warning'     : '#ffe1d7',
        'acc_critical': '#aac8ff',
        'acc_error'   : '#bedcff',
        'acc_warning' : '#d2f0ff',
        'dev_critical': '#cdcfce',
        'tst_critical': '#cdcfce',
        'dev_error'   : '#ebede6',
        'tst_error'   : '#ebede6',
        'dev_warning' : '#ffffff',
        'tst_warning' : '#ffffff',
        'indeterminate': '#888888',
      },
}
SORT_LIST_BY = 'createTime'
COLUMNS = ['severity', 'status', 'createTime', 'environment', 'service', 'resource', 'event', 'value', 'text', 'note']

CORS_ORIGINS = ['.*']
satterly commented 3 years ago

You're going to have to provide more info than that if you want me to be able to reproduce the issue. How many alerts are in the database? How many do you have displayed in the web UI per page? How many environments do you have? How many alerts per environment? Does it happen immediately after logging in without you doing anything or does it only start after you click around for a while? For example, clicking on the environment tabs?

How long have you observed the memory leak for? Minutes, hours, days? And the memory never returns to a lower level? It keeps growing indefinitely? Which memory? JS Heap, documents, nodes, listeners? Please include a screenshot of the Performance console that demonstrates the "memory leak". Thanks.

satterly commented 3 years ago

This issue is blocked waiting on more information. The description or subsequent comments do not provide enough information to triage, investigate or resolve the issue. Please review the description against the issue template and ensure all relevant information is included. If you do not know what is expected you can ask on Slack.

satterly commented 3 years ago

Closing due to inactivity. If you believe this issue has been closed prematurely please provide more information to help progress the issue. If you do not know what is expected you can ask on Slack.

wimfabri commented 3 years ago

Issue Summary When you leave the alerts page open in the browser (tested with both chrome and firefox) the memory usage of the browser process keeps growing.

Environment

To Reproduce Steps to reproduce the behavior:

  1. open Alerta main page
  2. wait

For web app issues, include any web browser JavaScript console errors: none

Expected behavior memory usage should not keep growing

Screenshots just opened: image after 2 hours: image

Additional context Add any other context about the problem here. nr of alerts: 512 customers: 4 environments: 12

NOTE: Please provide as much information about your issue as possible. Failure to provide basic details about your specific environment make it impossible to know if an issue has already been fixed, can delay a response and may result in your issue being closed without a resolution.

Samgarr commented 3 years ago

I'm also seeing high memory and CPU usage in Firefox after cca hour: alerta_memory

number of alerts: 160 (some of them with thousand of duplicates) customers: 3 environments: 3

Alerta UI: 8.4 Alerta API: 8.3.3 Firefox: 90.0.2

I will be happy provide more information for debugging, let me know.