Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
⚙️ Tweak API client settings to reduce pressure on the node
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Apr 4, 2024
1 parent 5a0af31 commit 9fb7369
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

# GENESIS_BLOCK_URL='https://downloads.lisk.com/lisk/mainnet/genesis_block.json.tar.gz'
# CLIENT_POOL_SIZE=10
# WS_SERVER_PING_INTERVAL=3000
# WS_SERVER_PING_INTERVAL=6000
# WS_SERVER_PING_INTERVAL_BUFFER=1000
# ENDPOINT_INVOKE_MAX_RETRIES=3
# ENDPOINT_INVOKE_RETRY_DELAY=50
# ENDPOINT_INVOKE_RETRY_DELAY=1000
# CONNECTOR_EXIT_DELAY_IN_HOURS=0

# Moleculer jobs configuration
Expand Down
8 changes: 4 additions & 4 deletions docs/antora/modules/ROOT/pages/configuration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ By default, it is set to `10`.
| number
| Interval (in milliseconds) at which the WS server checks for liveliness of all the connected clients.
This should not be modified unless explicitly recommended by the development team.
By default, it is set to `3000`.
| 3000
By default, it is set to `6000`.
| 6000

| `WS_SERVER_PING_INTERVAL_BUFFER`
| number
Expand All @@ -442,8 +442,8 @@ By default, it is set to `3`.
| `ENDPOINT_INVOKE_RETRY_DELAY`
| number
| Delay (in milliseconds) between each endpoint invocation request retry.
By default, it is set to `50`.
| 50
By default, it is set to `1000`.
| 1000

| `CONNECTOR_EXIT_DELAY_IN_HOURS`
| number
Expand Down
4 changes: 2 additions & 2 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ module.exports = {
// DOCKER_HOST: 'local',
// GENESIS_BLOCK_URL: 'https://downloads.lisk.com/lisk/mainnet/genesis_block.json.tar.gz',
// CLIENT_POOL_SIZE: 10,
// WS_SERVER_PING_INTERVAL=3000,
// WS_SERVER_PING_INTERVAL=6000,
// WS_SERVER_PING_INTERVAL_BUFFER=1000,
// ENDPOINT_INVOKE_MAX_RETRIES: 3,
// ENDPOINT_INVOKE_RETRY_DELAY: 50,
// ENDPOINT_INVOKE_RETRY_DELAY: 1000,
// CONNECTOR_EXIT_DELAY_IN_HOURS: 0,
// JOB_INTERVAL_CACHE_CLEANUP: 0,
// JOB_SCHEDULE_CACHE_CLEANUP: '0 */12 * * *',
Expand Down
4 changes: 2 additions & 2 deletions services/blockchain-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ A list of the most commonly used environment variables is presented below:
- `ENABLE_BLOCK_CACHING`: Boolean flag to enable the block caching. Enabled by default. To disable, set it to `false`.
- `EXPIRY_IN_HOURS`: Expiry time (in hours) for block cache. By default, it is set to `12`.
- `CLIENT_POOL_SIZE`: Number of active API clients to be maintained in the pool. Only applicable when using the IPC or WS clients to connect with the Lisk node. By default, it is set to `10`.
- `WS_SERVER_PING_INTERVAL`: Interval (in milliseconds) at which the WS server checks for liveliness of all the connected clients. This should not be modified unless explicitly recommended by the development team. By default, it is set to `3000`.
- `WS_SERVER_PING_INTERVAL`: Interval (in milliseconds) at which the WS server checks for liveliness of all the connected clients. This should not be modified unless explicitly recommended by the development team. By default, it is set to `6000`.
- `WS_SERVER_PING_INTERVAL_BUFFER`: A conservative assumption of the latency (in milliseconds) for WS server pings to arrive at the client. By default, it is set to `1000`.
- `ENDPOINT_INVOKE_MAX_RETRIES`: Maximum number of endpoint invocation request retries to the node. By default, it is set to `3`.
- `ENDPOINT_INVOKE_RETRY_DELAY`: Delay (in milliseconds) between each endpoint invocation request retry. By default, it is set to `50`.
- `ENDPOINT_INVOKE_RETRY_DELAY`: Delay (in milliseconds) between each endpoint invocation request retry. By default, it is set to `1000`.
- `CONNECTOR_EXIT_DELAY_IN_HOURS`: Delay (in hours) after which the blockchain-connector microservice exits. The service should restart automatically if deployed using Docker or PM2. To be removed eventually. To enable it, set it higher than `0`. By default, it is set to `0`.
- `JOB_INTERVAL_CACHE_CLEANUP`: Job run interval to cleanup block cache. By default, it is set to `0`.
- `JOB_SCHEDULE_CACHE_CLEANUP`: Job run cron schedule to cleanup block cache. By default, it is set to run every 12 hours (`0 */12 * * *`).
Expand Down
4 changes: 2 additions & 2 deletions services/blockchain-connector/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ config.job = {

config.apiClient = {
poolSize: Number(process.env.CLIENT_POOL_SIZE) || 10,
wsServerPingInterval: Number(process.env.WS_SERVER_PING_INTERVAL) || 3 * 1000, // in millisecs
wsServerPingInterval: Number(process.env.WS_SERVER_PING_INTERVAL) || 6 * 1000, // in millisecs
pingIntervalBuffer: Number(process.env.WS_SERVER_PING_INTERVAL_BUFFER) || 1000, // in millisecs
request: {
maxRetries: Number(process.env.ENDPOINT_INVOKE_MAX_RETRIES) || 3,
retryDelay: Number(process.env.ENDPOINT_INVOKE_RETRY_DELAY) || 50, // in millisecs
retryDelay: Number(process.env.ENDPOINT_INVOKE_RETRY_DELAY) || 1000, // in millisecs
},
};

Expand Down

0 comments on commit 9fb7369

Please sign in to comment.