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

added document link about how to install and use Valgrind for Fluent-bit #454

Closed
wants to merge 1 commit into from

Conversation

Claych
Copy link
Contributor

@Claych Claych commented Nov 3, 2022

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Claych Claych requested a review from a team as a code owner November 3, 2022 19:02
@@ -298,7 +298,7 @@ Check out the FireLens example for preventing/reducing out of memory exceptions:

#### Testing for real memory leaks using Valgrind

If you do think the cause of your high memory usage is a bug in the code, you can optionally help us out by attempting to profile Fluent Bit for the source of the leak. To do this, use the [Valgrind](https://valgrind.org/) tool.
If you do think the cause of your high memory usage is a bug in the code, you can optionally help us out by attempting to profile Fluent Bit for the source of the leak. To do this, use the [Valgrind](https://valgrind.org/) tool. Here is the [tutorial](tutorials/valgrind/README.md) about how to install and use Valgrind to detect Fluent-bit memory leaks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's organize this valgrind section more and make the tutorial link more clear. Right now it's easy to miss. I want customers to see it and use it.

Here we have content in the tutorial for using valgrind, and in the guide here for creating valgrind image builds. How about we split this into clear sections that are linked in the table of contents like- "Building a Container Image with Valgrind" and "Tutorial: Using Valgrind with Fluent Bit" the latter which can be the link to your tutorial

@@ -0,0 +1,118 @@
# Tutorial: Fluent Bit Test in AWS EC2 Instance with Valgrind for Memory Leak
Copy link
Contributor

@PettitWesley PettitWesley Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language nit: "Testing for memory leaks in Fluent Bit on an AWS EC2 Instance"

Also is the AWS EC2 necessary? Wouldn't this work on any linux machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because, this doc was before combined with debugging Fluent-bit on AWS EC2 Instance. I will change it to all linux machine


### Preparation

Install your fluent-bit in AWS EC2 Linux 2 instance, that is, in a linux environment, which also meets the conditions for using valgrind.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the required conditions? Does the user just need to use linux? Does it have to be an EC2 instance?


Install your fluent-bit in AWS EC2 Linux 2 instance, that is, in a linux environment, which also meets the conditions for using valgrind.

### Step for Using Valgrind
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that Fluent Bit has support for valgrind that makes it easier for valgrind to track the stack when Fluent bit switches from one coroutine to another.

You must compile it with cmake -DFLB_VALGRIND=On to get this support. Please ntoe this.

valgrind ./bin/fluent-bit {args for fluent bit}
```

Valgrind will generate a large number of output logs when it is running, so in order to browse all output logs conveniently, it is recommended to store them in a file instead of viewing them directly in the terminal, otherwise it is inconvenient and inconvenient to find, and at the same time It will also cause the loss of many output logs. Use CLI `flag —log-file=“file-name”` will save the output logs to a file named “file-name”.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also suggest using --leak-check=full --error-limit=no

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

Successfully merging this pull request may close these issues.

3 participants