Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Reduce the number of DB requests made in ValidateServerCapabilities() #5212

@rawlinp

Description

@rawlinp

I'm submitting a ...

  • improvement request (usability, performance, tech debt, etc.)

Traffic Control components affected ...

  • Traffic Ops

Current behavior:

TO currently makes a DB request per server in the ValidateServerCapabilities() function:

sCaps, err = dbhelpers.GetServerCapabilitiesFromName(name, tx)
. When a delivery service is being assigned to a large number of servers, this slows down the total execution time unnecessarily.

New behavior:

Instead of making a DB request per server, the function should make a single DB request to get data for all the servers at once, then perform the validation. This will make it much faster to assign a delivery service to large numbers of servers at a time.

Minimal reproduction of the problem with instructions:

Assign a delivery service with required capabilities to a large number of servers with those capabilities at a time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Traffic Opsrelated to Traffic Opsgood first issuefirst-time committers will find this easy to resolveimprovementThe functionality exists but it could be improved in some way.performanceimpacts/improves/measures performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions