Skip to main content

Configuring the maximum hapi payload size

Applies to Informer 5.3.3 and higher.

Informer is built on the hapi.js Node.js framework, which handles payload traffic across the system. The default maximum payload hapi.js accepts is 1 MB, which is enough for most cases. Some use cases need a larger maximum, which you set in the Informer config.json.

Stop the Informer service, then edit config.json and add a defaultRouteSettings section:

"defaultRouteSettings": {
"payload": {
"maxBytes": 1048576
}
}

The maxBytes value must be in bytes; shorthand like MB is not allowed. For example, to double the maximum from 1048576 to 2097152 bytes:

{
"name": "Informer5",
"tokenSecret": "DefaultTokenSecretThisShouldChange",
"http": 8533,
"db": {
"database": "informer533",
"host": "localhost",
"user": "postgres",
"password": "password",
"port": 5432
},
"elastic": {
"host": "localhost",
"port": 9200
},
"redis": {
"host": "localhost",
"port": 6379
},
"defaultRouteSettings": {
"payload": {
"maxBytes": 2097152
}
},
"loadBalancer": {},
"host": "localhost",
"NODE_ENV": "production"
}

Restart Informer to apply the change.