Skip to content

[performance] Speedup plugin retrieval #210

@ralbertazzi

Description

@ralbertazzi

terraform plan and terraform apply take a long time to refresh information when working on CloudAMQP projects. By inspecting with -parallelism=1 it looks like the resources that take an unusually long time to be fetched are the plugins.

I can experience the same through the API, where this call takes 3-4 seconds (tried on multiple instances). I suppose it's the same you are using in the provider:

curl -XGET -u :$API_KEY https://api.cloudamqp.com/api/plugins

The first performance optimization would be to simply make this API faster, although it goes outside the scope of this repo. I hope you can still provide this feedback to the people responsible for it.

The second performance optimization involves caching the API call result. I never developed a plugin so I don't know how feasible this is, but since - as far as I see - there is a single API that returns the status of all plugins, you could perform this call just once, cache the result in memory, and use that result to provide the state of subsequent calls. This would greatly increase the refresh time as it wouldn't increase linearly with the number of plugins that are tracked on Terraform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api or backendNeeds to be addressed in the API backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions