How to change the blockchain fetching batch size?
... 2022-7-7 Less than 1 minute
# How to change the blockchain fetching batch size?
# Video guida
# Introduction
The default batch size is 100, but this can be changed by using the extra command --batch-size=xx
.
You need to this to the command line as an extra flag or if you are using Docker, modify the docker-compose.yml with:
subquery-node:
image: onfinality/subql-node:latest
depends_on:
- "postgres"
restart: always
environment:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
volumes:
- ./:/app
command:
- -f=/app
- --local
- --batch-size=50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
This example sets the batch size to 50.
# Why change the batch size?
Using a smaller batch size can reduce memory usage and not leave users hanging for large queries. In otherwords, your application can be more responsive.