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

Prevents backlog when writing to Elasticsearch #1765

Merged
merged 2 commits into from
Oct 10, 2017
Merged

Conversation

codefromthecrypt
Copy link
Member

In the past, delayed or otherwise unhealthy elasticsearch clusters could
create a backlog leading to a OOM arising from the http dispatcher ready
queue. This chooses to prevent a ready queue instead. This means we drop
spans when the backend isn't responding instead of crashing the server.

Fixes #1760

In the past, delayed or otherwise unhealthy elasticsearch clusters could
create a backlog leading to a OOM arising from the http dispatcher ready
queue. This chooses to prevent a ready queue instead. This means we drop
spans when the backend isn't responding instead of crashing the server.

Fixes #1760
@codefromthecrypt
Copy link
Member Author

cc @openzipkin/elasticsearch

@codefromthecrypt
Copy link
Member Author

actually I was able to crash the server even with this when setting ES_MAX_REQUESTS=2 and 5 concurrent senders of 10 spans. Took about 5m to kill the server.

zipkin                      | 2017-10-10 12:42:26.056  INFO 5 --- [nio-9411-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 138 ms
zipkin                      | OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000f8f2f000, 107704320, 0) failed; error='Cannot allocate memory' (errno=12)
zipkin                      | #
zipkin                      | # There is insufficient memory for the Java Runtime Environment to continue.
zipkin                      | # Native memory allocation (mmap) failed to map 107704320 bytes for committing reserved memory.
zipkin                      | # An error report file with more information is saved as:
zipkin                      | # /zipkin/hs_err_pid5.log
zipkin exited with code 1

@codefromthecrypt
Copy link
Member Author

ran with less logging per #1766
I simulated a surge, and definitely dropped spans works.

I watched things recover via prometheus openzipkin-attic/docker-zipkin#135 and a grafana dashboard https://grafana.com/dashboards/1598/

@Logic-32 I'm going to merge this and cut 2.2.0 (which has the prometheus setup I used). Please setup a dashboard and alerts.. also you probably want to add the elasticsearch queue length to whatever that is. There are probably many places to improve, but I hope this gets things better.

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.

1 participant