[RFC PATCH] REST: Add new setting for maximum API page size
stewart at linux.vnet.ibm.com
Thu Jul 26 14:37:08 AEST 2018
Andrew Donnellan <andrew.donnellan at au1.ibm.com> writes:
> On 24/07/18 15:10, Andrew Donnellan wrote:
>> In 41790caf59ad ("REST: Limit max page size") we limited the maximum page
>> size to the default page size in the settings.
>> This turns out to be rather restrictive, as we usually want to keep the
>> default page size low, but an administrator may want to allow API clients
>> to fetch more than that per request.
>> Add a new setting, MAX_REST_RESULTS_PER_PAGE, to set the maximum page size.
>> Closes: #202 ("Separate max API page size and default API page size into different settings")
>> Suggested-by: Stewart Smith <stewart at linux.ibm.com>
>> Suggested-by: Joel Stanley <joel at jms.id.au>
>> Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
> FWIW we now have this applied on patchwork.ozlabs.org and it appears to
> be working. Would like some more input as to what an appropriate default
> limit is.
>From a *consumer* of the API PoV, 500 at a time rather than 30 is at
least a 6x speedup of my use of it, so that was extremely welcome. I
haven't looked at the size of the responses I'm getting back so have no
idea if 500 is a good one or not (I suspect I'd have to start optimizing
my code around 700-1000 responses/call).
My *guess* is that a fresh SQL query is run for each page retrieved, so
maybe 500 is "good enough" while there isn't some way to just stream
everything and not run the query multiple times.
OPAL Architect, IBM.
More information about the Patchwork