What is the use of page-size parameter in AWS CLI under describe-stream

3.2k Views Asked by At

I need to understand what is the use of page-size parameter used with describe-stream AWS CLI command?

AWS documentation just says - The size of each page

Source: Kinesis describe-stream @ docs.aws.amazon.com

4

There are 4 best solutions below

2
On

Updated

The page-size parameter is used to control the pagination of results between the AWSCLI and the service. The AWSCLI normally handles pagination for you. It will request pages of responses from the service and then return the complete list to you. By default, it uses a page-size of 1000 but, in some situations this can be too large and may cause the service to timeout in generating a response. In this rare case, you can use the --page-size option to tell AWSCLI to use a smaller page size when communicating with the service. Note that this will not affect the actual results returned by AWSCLI since it will still request the pages as needed and return the data to you as if they were continuous.

1
On

When we move to any services in AWS cloud the data is mostly in bulk , also the metadata .Each object has its own space as well its metadata. AWS CLI has a cool way of paginating the response data into partitions ( lay man language) .

Each response has a key to fetch the next partition and hence this is how bulk data is retrieved till there is not key available in the last in the response and that would be the last partition or the End of data.

So in AWS CLI we can set the --page-size n as it indicates the partition of the available data to be made so that we get response with less latency and it allows smooth processing of data with no data loss in transit. And hence we have a key that is called starting token which is appended in each response.

0
On

I think the simple answer is that --page-size limits the number of items returned per service call, but this does not control what's displayed in your CLI output. To set the number of items displayed, you can use the parameter --max-items.

So, --page-size really helps you avoid timeout issues by retrieving fewer than 1,000 items per API call, and --max-items limits the number of items displayed in your output as part of pagination. So, visually you can see the result of using --max-items, while --page-size is something that happens in the background.

0
On

--page-size: specify that AWS CLI retrieves the full list of items but with a larger number of API calls instead of one API call (default: 1000 items).This helps you avoid timeout issues by retrieving fewer than 1,000 items per API call.

use --max-items for pagination