0% found this document useful (0 votes)
78 views

InfluxDB Grafana Performance Monitoring

This document discusses using K6.io, InfluxDB, and Grafana for performance monitoring and load testing. It provides instructions for installing and configuring each tool, running a sample load test against a server using K6, uploading the results to InfluxDB, and then visualizing the metrics from InfluxDB using prebuilt dashboards in Grafana. Key metrics like response times, request rates, and error rates are captured during the load test and can be analyzed visually.

Uploaded by

uniro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

InfluxDB Grafana Performance Monitoring

This document discusses using K6.io, InfluxDB, and Grafana for performance monitoring and load testing. It provides instructions for installing and configuring each tool, running a sample load test against a server using K6, uploading the results to InfluxDB, and then visualizing the metrics from InfluxDB using prebuilt dashboards in Grafana. Key metrics like response times, request rates, and error rates are captured during the load test and can be analyzed visually.

Uploaded by

uniro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

InfluxDB + Grafana

https://viblo.asia/p/kiem-tra-chiu-tai-cua-server-voi-k6io-phan-1-bWrZnVywZxw
https://viblo.asia/p/kiem-tra-chiu-tai-cua-server-voi-k6io-phan-2-influxdb-grafana-V3m5WJ8glO7

Performance server checking with K6.io



# Install K6.io
sudo yum -y install https://dl.k6.io/rpm/repo.rpm
sudo yum -y install k6

# Add InfluxDB repository


cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

# Install InfluxDB
sudo yum -y inst influxdb

# Configure InfluxDB
vi /etc/influxdb/influxdb.conf
bind-address = "0.0.0.0:8088"

# Start InfluxDB Service and enable


sudo systemctl start influxd
sudo systemctl enable --now influxd

# Create influxdb
influx -precision rfc3339
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show databases
name: databases
name
----
_internal
> CREATE DATABASE myinfluxdb
> show databases
name: databases
name
----
_internal
myinfluxdb
> exit

# Test and visualize metrics


vi k6/samples/blog.js

import http from 'k6/http';


import { sleep } from 'k6';

file:///D/_ThaoLe/shlv_user_guide/InfluxDB_Grafana_Performance_monitoring.txt[4/14/2023 10:09:47 PM]


export let options = {
stages: [
{ duration: '2m', target: 100 }, // below normal load
{ duration: '5m', target: 100 },
{ duration: '2m', target: 200 }, // normal load
{ duration: '5m', target: 200 },
{ duration: '2m', target: 300 }, // around the breaking point
{ duration: '5m', target: 300 },
{ duration: '2m', target: 400}, // beyond the breaking point
{ duration: '5m', target: 400},
{ duration: '10m', target: 0 }, // scale down. Recovery stage.
],
};

export default function () {


http.get('https://s2u-uat.shinhanlifevn.com.vn/il/LifeAsiaWeb/FirstServlet');
sleep(1);
}

# Run k6 test and upload result to InfluxDB


k6 run --out influxdb=http://localhost:8086/myinfluxdb k6/samples/blog.js

[integral@vnpasuatapv41 tools]$ k6 run --out influxdb=http://localhost:8086/myinfluxdb k6/samples/blog.js

/\ |‾‾| /‾‾/ /‾‾/


/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io

execution: local
script: k6/samples/blog.js
output: InfluxDBv1 (http://localhost:8086)

scenarios: (100.00%) 1 scenario, 400 max VUs, 38m30s max duration (incl. graceful stop):
* default: Up to 400 looping VUs for 38m0s over 9 stages (gracefulRampDown: 30s, gracefulStop:
30s)

running (38m00.2s), 000/400 VUs, 510918 complete and 0 interrupted iterations


default ↓ [======================================] 001/400 VUs 38m0s

data_received..................: 3.7 GB 1.6 MB/s


data_sent......................: 270 MB 119 kB/s
http_req_blocked...............: avg=5.99ms min=1.99ms med=2.69ms max=417.73ms p(90)=4.8ms
p(95)=9.15ms
http_req_connecting............: avg=181.39µs min=47.33µs med=107.12µs max=32.26ms
p(90)=191.74µs p(95)=319.12µs
http_req_duration..............: avg=3.9ms min=1.6ms med=2.54ms max=373.61ms p(90)=5.58ms
p(95)=8.55ms
{ expected_response:true }...: avg=3.9ms min=1.6ms med=2.54ms max=373.61ms
p(90)=5.58ms p(95)=8.55ms
http_req_failed................: 0.00% 0 510918
http_req_receiving.............: avg=84µs min=21.56µs med=64.07µs max=231.15ms p(90)=97.14µs
p(95)=115.72µs
http_req_sending...............: avg=45.45µs min=12.93µs med=30.15µs max=39.34ms p(90)=43.22µs
p(95)=51.03µs

file:///D/_ThaoLe/shlv_user_guide/InfluxDB_Grafana_Performance_monitoring.txt[4/14/2023 10:09:47 PM]


http_req_tls_handshaking.......: avg=5.76ms min=1.88ms med=2.5ms max=417.52ms
p(90)=4.46ms p(95)=8.32ms
http_req_waiting...............: avg=3.77ms min=1.49ms med=2.43ms max=373.49ms p(90)=5.4ms
p(95)=8.3ms
http_reqs......................: 510918 224.068493/s
iteration_duration.............: avg=1.01s min=1s med=1s max=1.44s p(90)=1.01s
p(95)=1.01s
iterations.....................: 510918 224.068493/s
vus............................: 1 min=1 max=400
vus_max........................: 400 min=400 max=400

[integral@vnpasuatapv41 tools]$

# Add data sources from InfluxDB to Grafana


Configuration -> Data sources -> Add data source
+ Chosse InfluxDB
+ HTTP:
- URL: http://localhost:8086
+ InfluxDB Details
- Database: myinfluxdb
+ Save & test

# Visualize metrics using Grafana dashboards


https://grafana.com/grafana/dashboards
search: k6 Load Testing Results
id: 10660 / 2587
Login to Grafana -> + Create Dashboard -> Import -> Import dashboard from Grafana.com ->
ID: 10660 -> Load
InfluxDB: InfluxDB
Import

file:///D/_ThaoLe/shlv_user_guide/InfluxDB_Grafana_Performance_monitoring.txt[4/14/2023 10:09:47 PM]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy