-
Notifications
You must be signed in to change notification settings - Fork 407
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 blogpost on "monitoring FerretDB performance using Coroot" #4279
Conversation
Marketing blog posts should be reviewed by @ptrfarkas and @AlekSi. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4279 +/- ##
==========================================
- Coverage 74.30% 71.48% -2.82%
==========================================
Files 327 327
Lines 22674 22674
==========================================
- Hits 16847 16209 -638
- Misses 4600 5246 +646
+ Partials 1227 1219 -8 see 41 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
Effective real-time monitoring is a critical aspect of any infrastructure. | ||
[Coroot](https://coroot.com/) is an open source observability platform that can provide real-time monitoring and visibility into a [FerretDB](https://www.ferretdb.com/) setup. | ||
|
||
<!--truncate--> | ||
|
||
Effective real-time monitoring is a critical aspect of any infrastructure. | ||
[Coroot](https://coroot.com/) is an open source observability platform that can provide real-time monitoring and visibility into a [FerretDB](https://www.ferretdb.com/) setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one wasn't solved
## Setting up Coroot for FerretDB monitoring | ||
|
||
Since Coroot uses eBPF, you need the right environment before setting it up. | ||
The most recent versions of the Linux kernel (v 4.16 and above) should be compatible since they offer at least minimal eBPF support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most recent versions of the Linux kernel (v 4.16 and above) should be compatible since they offer at least minimal eBPF support. | |
The most recent versions of the Linux kernel (v4.16 and above) should be compatible since they offer at least minimal eBPF support. |
The Coroot dashboard provides the full details on all components. | ||
|
||
At first glance, we can see a memory leak on the `ferretdb` and `postgres` databases. | ||
That suggests that allocated memory is not being efficiently reused or deallocated, causing the total memory usage to grow progressively as the services operate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… so we want to publish a blog post that casually mentions that FerretDB and PostgreSQL have memory leaks just like that?
Using distributed tracing, Coroot provides a heat map showing operation requests, their status, durations, and details. | ||
|
||
![Latency](/img/blog/ferretdb-coroot/07-latency.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we write something that has nothing to do with FerretDB?
The above image shows how response time for the `ferretdb` increased progressively over time. | ||
It shows that the system takes a long time to handle queries. | ||
That should prompt us to take additional measures to improve performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build fails. Not much I could review.
You also get CPU, memory, storage, network, and log management metrics. | ||
|
||
To get started with FerretDB, [see our documentation](https://docs.ferretdb.io/). | ||
And if you want to contact the team for help or have any questions, [contact us on Slack](https://join.slack.com/t/ferretdb/shared_invite/zt-zqe9hj8g-ZcMG3~5Cs5u9uuOPnZB8~A). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked about many times before, we should not use that link because it may change. We should link to the community section in our docs or in README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use `kebab-case-with-dashes` instead of `snake_case_with_underscores` or spaces |
Alex, it is your responsibility to enforce that guide. And you are not even following it yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is a disconnect between images and words.
- It is not clear what part comes from eBPF.
|
||
Since Coroot is deployed locally, you can access it at http://localhost:8080/. | ||
|
||
Depending on your setup, you may need to modify the Docker compose `yaml` file and configure Prometheus to pick up FerretDB metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changes would be needed in the Docker compose (sic) yaml
file?
|
||
![memory usage](/img/blog/ferretdb-coroot/memory-metrics.png) | ||
|
||
Looking at the memory usage metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the memory usage metrics. | |
Looking at the memory usage metrics, |
But then, I'm not sure why we say that at all. It looks like we edited that part (that previously described a memory leak) without stopping and thinking if we need that part at all.
![CPU dashboard 1](/img/blog/ferretdb-coroot/cpu-metrics-1.png) | ||
|
||
![CPU dashboard 1](/img/blog/ferretdb-coroot/cpu-metrics-2.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those graphs show Prometheus requests to FerretDB to gather metrics, not FerretDB metrics
|
||
![CPU dashboard 1](/img/blog/ferretdb-coroot/cpu-metrics-2.png) | ||
|
||
In the images, the FerretDB instance indicates a peak Requests Per Second (RPS) of 0.07 with a consistent 2ms latency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And those requests are coming from?..
|
||
The image below shows a typical dashboard design using Grafana to display some of the metrics, including total client requests and responses, client connection durations, memory usage, CPU usage, and overall instance health. | ||
|
||
![Grafana dashboard for FerretDB Prometheus metrics 1](/img/blog/ferretdb-coroot/grafana-prometheus.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just quick comment, before going through the entire doc. These images are very small to tell what's going on. Is there a way to capture part of it with interesting metrics or allow zooming or something? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image for Grafana is just to show the dashboard setup rather than specific metrics. Others are more specific. But yes, this is something to look at actually. We may enable images to be clickable/zoomable via some plugin addition to Docusuaurus.
Description
Closes FerretDB/engineering#168.
Readiness checklist
task all
, and it passed.@FerretDB/core
), Milestone (Next
), Labels, Project and project's Sprint fields.