Skip to content

perf: remote_agent poll_for_data spawns script server per data source instead of per batch #7025

@somethingwithproof

Description

@somethingwithproof

Description

In remote_agent.php poll_for_data(), proc_open for the script server
is called inside the foreach($local_data_ids) loop, and proc_close
is called at the end of each iteration. Viewing a realtime graph with
20 script server metrics spawns and kills 20 PHP interpreter processes
in sequence.

Impact

CPU exhaustion on the polling server during realtime graph viewing.
Defeats the purpose of the persistent script server architecture.

Remediation

Move proc_open before the loop and proc_close after the loop. Feed all
queries to a single script server instance per batch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions