Skip to content

Edge Agent crashes with OOM when reading device data too quickly #558

@KavanPrice

Description

@KavanPrice

This problem was found through a misconfiguration of an S7 device connection and seems to mainly be a problem on polled drivers. If the polling rate for the connection is too high, the edge agent accumulates values faster than it can handle the responses and send them upstream. Eventually either:

  • NodeJS runs out of its allocated memory and the Edge Agent container crashes
  • The pod runs out of its defined memory resource and the pod crashes

As far as I'm aware, there's no way of increasing Node memory once the process has started, and the Edge Agent image runs with the default limit:

FROM ${base_prefix}-js-run:${base_version}
USER root
RUN <<'SHELL'
    apk upgrade --update-cache --available
    apk add openssl
    rm -rf /var/cache/apk/*
SHELL
WORKDIR /usr/app
# This copy leaves the app files owned as root, i.e. read-only to the
# running application. This is a Good Thing.
COPY --from=util-build /usr/app ./
USER node
CMD [ "node", "--es-module-specifier-resolution=node", "app.js" ]

To stop the crash, this would require some buffer management within the Edge Agent to not run out of memory from polling the driver.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions