Comments (5)
I'll look into adding some more official benchmarking tooling/guidelines.
But for now I'll outline the general approach below.
I started with a CCM 3-node 3.11.3 cluster.
I then created a keyspace with 1000 tables, using Java code similar to the following:
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;
public class LotsOTables {
public static void main(String[] args) {
final Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
final Session session = cluster.connect();
session.execute("CREATE KEYSPACE lotsotables WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}");
for (int i = 0; i < 1000; i++) {
session.execute(String.format("CREATE TABLE lotsotables.table%d (name text PRIMARY KEY);", i));
}
}
}
To benchmark your exporter I downloaded the latest release and used the example config.yml
file from the repository. I started it like so:
$ java -jar cassandra_exporter-2.0.2-all.jar config.yml
I then let it run for a period of time and observed its log output, which gives timing information. Since your exporter collects in a background thread and caches the results, I had to use the timing information from the logs rather than timing curl
as I did for the other benchmarks.
[main] INFO com.criteo.nosql.cassandra.exporter.Config - Loading yaml config from config.yml
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 27821ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 25786ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 25243ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 27656ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 25332ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 26222ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 26284ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 26075ms for the whole run
[main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 25511ms for the whole run
Note that all the benchmarks were run locally on my laptop which has a Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
CPU. And while I created a 3-node CCM cluster, I only collected metrics from one node.
from cassandra-exporter.
Hi,
Thanks for the quick reply :)
I will look into that later in the week and will keep you posted.
As a side note, while performance is nice, you should warn/advertise the downside of running the exporter as an agent, most notably:
- You have to restart your cluster if you want to upgrade the exporter plugin (may not be an issue if you are on kubernetes as you have to do it anyway to upgrade your pod)
- You are sharing the same jvm/heap than cassandra itself, so requesting too frequently the endpoint or during a bad time for cassandra may result in triggering GC that will cause to pause
Also if you want to improve further your performance, you can look to add gzip support for you http server, it make a big difference.
Example from the official prometheus java client
https://github.com/prometheus/client_java/blob/master/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java#L71
from cassandra-exporter.
Hi back,
So indeed my exporter was way slower with a lot of tables.
I made some change in the 2.0.3 in order to reduce the gap (you should expect a 2x improvement) but a gap will still remain. The dominant factor compared to other exporters, are my calls to mbean.getAttributes in order for the exporter to be able to not export them.
This is a design choice as letting the exporter filter on attributes let us scale more easily without increasing the size of our Prometheus.
I have updated the readme of the project in order to reflect the design decisions:
https://github.com/criteo/cassandra_exporter/blob/master/README.md#design-explanation
Thanks for having taking time to benchmarks
from cassandra-exporter.
Thanks for the suggestions of notes/warnings about running an exporter as an agent. I'll consider adding them to the README.
Also if you want to improve further your performance, you can look to add gzip support for you http server, it make a big difference.
GZip and Deflate is already supported -- Netty's HttpContentCompressor
is part of the pipeline.
For example, the following request returns GZip encoded content which is successfully decompressed with gunzip
:
curl -H "Accept-Encoding: gzip" localhost:9500/metrics | gunzip
... are my calls to mbean.getAttributes in order for the exporter to be able to not export them.
Yes, getAttributes
is one of the slowest JMX calls in my experience.
from cassandra-exporter.
Ok for gzip, I should have missed it :)
Good luck
from cassandra-exporter.
Related Issues (20)
- Export metric on https with ssl HOT 2
- Connection reset exceptions HOT 1
- Unable to compute when histogram overflowed
- Problems with IPv6 addresses
- JSON output is invalid HOT 1
- cassandra exporter (0.9.12) still do not export metrics of cassandra 4.0.5 HOT 7
- Generate a docker image for every release in DockerHub
- cassandra exporter (0.9.12) gives warning IllegalArgumentException: 'xxx.xxx.xxx.xxx_7001' is not an IP string literal message for cassandra 4.1 HOT 8
- cassandra-exporter agent 0.9.10 fails to start HOT 1
- does it work with datastax 6.8 HOT 3
- Release (0.9.11) not found HOT 1
- cannot compile the master branch
- Could it be force to be a generic bean/jmx exporter? HOT 3
- Export Raw Histogram Data If Possible HOT 3
- Exceptions with cassandra 3.11.7 HOT 1
- Feature: Export keyspace replication factor metrics
- Does not seem to work with Cassandra Version 3.11.7 HOT 1
- Broken pipe IOException every 5 minutes HOT 7
- Broken pipe IOException during compaction HOT 5
- Feature: support for plugglabe metrics suppliers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cassandra-exporter.