Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to control the maximum size of JSON output #2393

Closed
LionelCons opened this issue Jul 27, 2020 · 36 comments
Closed

Add an option to control the maximum size of JSON output #2393

LionelCons opened this issue Jul 27, 2020 · 36 comments
Assignees

Comments

@LionelCons
Copy link
Contributor

When using an output plugin like http to send JSON data, one can mainly choose between the json_lines and json formats.

With json_lines, every log entry triggers a POST request, which implies a significant overhead, both on the network and on the receiving end.

With json, a single POST request can group multiple log entries. This is good. However, if there are many entries to send, this can result in sending a huge POST request that the receiver might struggle to handle.

It would be useful to be able to control the maximum size of the JSON output. It could be a maximum number of log entries or a maximum number of bytes.

@edsiper
Copy link
Member

edsiper commented Nov 24, 2020

@LionelCons

On every flush call (applicable for all output plugins), they receive a Chunk which contains N records. In the case of the HTTP output plugin, the json_lines format just compose the payload in a different way than json, adding a breaking \n between each record. Note: there is a single HTTP POST to the remote end-point containing all the records together, not one per record.

@edsiper edsiper self-assigned this Nov 24, 2020
@LionelCons
Copy link
Contributor Author

@edsiper, you write "they receive a Chunk which contains N records".

Is it possible to set a maximum value for N?

@edsiper
Copy link
Member

edsiper commented Nov 24, 2020

it's not possible, our chunks are near 2MB, all records in the chunk are under the same tag

@LionelCons
Copy link
Contributor Author

Then, is it possible to reduce the chunk size?

I found the Mem_Buf_Limit option but that seems to be at input level.

@LionelCons
Copy link
Contributor Author

LionelCons commented Nov 25, 2020

FWIW, I have made some tests with a big log file.

I saw an average size of 3.5 MB for the POST requests. This of course depends on formatting options (like Json_Date_Format).

This does not seem much but in an infrastructure with many fluent-bit instances sending their data in parallel this can be hard to swallow. We use Flume and the JSON input has to be parsed and enriched so it requires much more memory than its sheer size.

@LionelCons
Copy link
Contributor Author

FWIW, this is very similar to #1938.

If we can control the max chunk size (per output plugin) then we can indirectly control the size of the JSON payload.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label May 25, 2021
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label May 27, 2021
@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jun 28, 2021
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Jul 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Jan 4, 2022
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Jan 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Apr 6, 2022
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Apr 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Jul 6, 2022
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Jul 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Oct 6, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Apr 11, 2023
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Apr 12, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Jul 11, 2023
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Jul 12, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Oct 11, 2023
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Oct 12, 2023
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Jan 11, 2024
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Jan 13, 2024
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Apr 14, 2024
@LionelCons
Copy link
Contributor Author

This issue is still creating problems in some of our workflows.

@github-actions github-actions bot removed the Stale label Apr 16, 2024
@teeohhem
Copy link

Running into this issue as well. Here's my vote

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Jul 19, 2024
@mrueg
Copy link
Contributor

mrueg commented Jul 19, 2024

Not stale

@github-actions github-actions bot removed the Stale label Jul 21, 2024
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Oct 19, 2024
Copy link
Contributor

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
@mrueg
Copy link
Contributor

mrueg commented Oct 24, 2024

Not stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants