Long Running API Requests#
To optimise memory utilization and performance, the system has been configured so that the API server will manage workers with the following defaults:
after receiving a restart signal, workers have 100 minutes to finish serving requests
a random restart interval of between 0 and 600 requests per worker (4 workers per node, 4 nodes in a cluster)
API best practices is to schedule and then poll transactions, since long running requests can affect recycling. In other words, preferably short requests and then poll.
Polling Example#
To retrieve the status of a given transaction:
GET /api/tool/Transaction/[pkid]/poll/?format=json
The response contains essential status of the transaction, for example:
{
[pkid]: {
status: "Success",
href: "/api/tool/Transaction/[pkid]",
description: "Name:RDP-auser1857 Description:RD for auser1857"
}
}
Refer to the topics Poll Transactions and Example of an Asynchronous Mutator Transaction with nowait=true in the API Guide.