Advanced Configuration & Monitoring
This guide covers advanced configuration options and comprehensive monitoring setups for ENI nodes. We will explore performance tuning, monitoring infrastructure, and alerting systems.
Performance Tuning
Memory Management
The following settings optimize memory usage and disk I/O patterns. Add these to /etc/sysctl.conf
:
# Minimize swapping
vm.swappiness = 1
# Control disk write behavior
vm.dirty_background_ratio = 3
vm.dirty_ratio = 10
vm.dirty_expire_centisecs = 300
vm.dirty_writeback_centisecs = 100
Apply the changes:
sudo sysctl -p
Network Stack Optimization
These settings improve network performance. Add to /etc/sysctl.conf
:
# Increase connection handling capacity
net.core.somaxconn = 32768
net.core.netdev_max_backlog = 32768
net.ipv4.tcp_max_syn_backlog = 16384
# Optimize buffer sizes
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 87380 16777216
Storage Configuration
For NVMe drives, optimize I/O scheduling:
Storage Optimization Commands
# Set IO scheduler
echo "none" > /sys/block/nvme0n1/queue/scheduler
# Set read-ahead buffer
blockdev --setra 4096 /dev/nvme0n1
# Set IO priority in systemd service
sudo tee -a /etc/systemd/system/enid.service << EOF
[Service]
IOSchedulingClass=realtime
IOSchedulingPriority=2
EOF
# Configure disk mount options
sudo tee -a /etc/fstab << EOF
/dev/nvme0n1p1 /data ext4 defaults,noatime,nosuid,nodev,noexec,commit=60 0 0
EOF
Monitoring Setup
Prometheus Configuration
First, install Prometheus:
wget https://github.com/prometheus/prometheus/releases/download/v2.42.0/prometheus-2.42.0.linux-amd64.tar.gz
tar xvf prometheus-2.42.0.linux-amd64.tar.gz
Create a Prometheus configuration:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'eni_node'
static_configs:
- targets: ['localhost:26660']
metrics_path: /metrics
Grafana Dashboard Setup
Install and configure Grafana:
sudo apt-get install -y apt-transport-https software-properties-common
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
sudo apt-get update && sudo apt-get install grafana
Alert Configuration
Set up alerting with Alertmanager:
wget https://github.com/prometheus/alertmanager/releases/download/v0.25.0/alertmanager-0.25.0.linux-amd64.tar.gz
tar xvf alertmanager-0.25.0.linux-amd64.tar.gz
Create alerting rules:
groups:
- name: eni_alerts
rules:
- alert: NodeDown
expr: up == 0
for: 5m
labels:
severity: critical
annotations:
summary: 'Node {{ $labels.instance }} down'
- alert: BlockProductionSlow
expr: rate(tendermint_consensus_height[5m]) < 0.1
for: 5m
labels:
severity: warning
annotations:
summary: 'Block production is slow on {{ $labels.instance }}'
Log Management
Loki Setup
Install and configure Loki for log aggregation:
wget https://github.com/grafana/loki/releases/download/v2.8.0/loki-linux-amd64.zip
unzip loki-linux-amd64.zip
Configure Promtail to send logs:
server:
http_listen_port: 9080
positions:
filename: /tmp/positions.yaml
clients:
- url: http://localhost:3100/loki/api/v1/push
scrape_configs:
- job_name: eni_logs
static_configs:
- targets:
- localhost
labels:
job: enid_logs
__path__: /var/log/enid/*.log
Log Rotation
Configure logrotate to manage log files:
sudo tee /etc/logrotate.d/eni << EOF
/var/log/eni/*.log {
daily
rotate 14
compress
delaycompress
notifempty
create 0640 eni eni
sharedscripts
postrotate
systemctl reload enid
endscript
}
EOF
Advanced Security Configuration
Network Security
Configure UFW firewall rules:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 26656/tcp comment 'ENI P2P'
sudo ufw allow 26657/tcp comment 'ENI RPC'
sudo ufw allow 9090/tcp comment 'ENI gRPC'
sudo ufw enable
Rate Limiting
Configure nginx as a reverse proxy with rate limiting:
http {
limit_req_zone $binary_remote_addr zone=eni_rpc:10m rate=10r/s;
server {
listen 26657;
location / {
limit_req zone=eni_rpc burst=20 nodelay;
proxy_pass http://localhost:26657;
}
}
}
Backup and Recovery
Automated Backup Script
Create a comprehensive backup script:
Performance Monitoring
Resource Usage Tracking
Install and configure node_exporter:
wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz
tar xvf node_exporter-1.5.0.linux-amd64.tar.gz
Add to Prometheus configuration:
scrape_configs:
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
Performance Benchmarking
Create a benchmarking script to test node performance:
Benchmarking Script
#!/bin/bash
# Test RPC endpoint response time
curl -s -w "\nResponse time: %{time_total}s\n" -o /dev/null http://localhost:26657/status
# Test P2P connectivity
enid net_info | jq '.result.n_peers'
# Test transaction processing
enid tx bank send \
$(enid keys show -a test1) \
$(enid keys show -a test2) \
1000000ueni \
--chain-id $CHAIN_ID \
--fees 5000ueni \
-y
This guide provides advanced configuration options and monitoring setup instructions. For specific customizations or additional metrics, consult the ENI technical community.
Last updated