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

fireHooks lock system and became very lag.(open too many file) #1193

Closed
Detail0805 opened this issue Oct 29, 2020 · 3 comments
Closed

fireHooks lock system and became very lag.(open too many file) #1193

Detail0805 opened this issue Oct 29, 2020 · 3 comments

Comments

@Detail0805
Copy link

Detail0805 commented Oct 29, 2020

abcd

I am using ELK and make a tcp connection to my logstash.

Today my ELK is crash down and I found my server will slowly by this code.

When logrus try to do this:

           fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)

My linux file is open too much.

I know I can rewrite fire and levels function make it return nil.

I just 4-5 log / second.

@dgsb
Copy link
Collaborator

dgsb commented Nov 6, 2020

We need more context to understand what your problem is.
Which hooks are you using, a code sample, etc ...

@Detail0805
Copy link
Author

We need more context to understand what your problem is.
Which hooks are you using, a code sample, etc ...

The code is in the entry.go 259 line (version tag v1.7.0).

My scenario is when elk is disconnected, this code will cause my operating system to open the file repeatedly.

Because ELK log is very huge. The file will open to many and let server crash down.

I think no one thought that the log server would be disconnected.

My suggestion is to use rate limit algorithm to solve.

@Detail0805 Detail0805 changed the title fireHooks lock system and became very lag. fireHooks lock system and became very lag.(open too many file) Nov 11, 2020
@dgsb
Copy link
Collaborator

dgsb commented Mar 11, 2021

We have changed the locking system in v1.8.1

@dgsb dgsb closed this as completed Mar 11, 2021
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

2 participants