This page covers configuration for Graphite deployments.
| File | Purpose |
|---|---|
/etc/carbon/carbon.conf |
Carbon daemon configuration |
/etc/carbon/storage-schemas.conf |
Data retention policies |
/etc/carbon/storage-aggregation.conf |
Aggregation rules |
/etc/graphite/local_settings.py |
Graphite-Web settings |
carbon.conf)[cache]
# Maximum metrics per second
MAX_UPDATES_PER_SECOND = 500
# Maximum creates per second
MAX_CREATES_PER_MINUTE = 500
# Line receiver mode: plaintext, pickle, or both
LINE_RECEIVER_INTERFACE = 0.0.0.0
LINE_RECEIVER_PORT = 2003
# Pickle receiver
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_PORT = 2004
# Enable UDP listener
ENABLE_UDP_LISTENER = True
UDP_RECEIVER_PORT = 2003
# Log updates
LOG_UPDATES = False
LOG_CACHE_HITS = False
storage-schemas.conf)Define data retention policies:
[carbon]
pattern = ^carbon\.
retentions = 10s:1h,1min:1d,5min:30d
[system]
pattern = ^system\.
retentions = 1min:7d,5min:30d,1h:365d
[app]
pattern = ^app\.
retentions = 10s:1d,1min:7d,15min:90d
[default]
pattern = .*
retentions = 1min:7d,5min:30d,1h:365d
storage-aggregation.conf)Define how data is aggregated:
[avg]
pattern = \.avg$
xFilesFactor = 0.5
aggregationMethod = average
[sum]
pattern = \.count$
xFilesFactor = 0.1
aggregationMethod = sum
[min]
pattern = \.min$
xFilesFactor = 0.1
aggregationMethod = min
[max]
pattern = \.max$
xFilesFactor = 0.1
aggregationMethod = max
local_settings.py)# Time zone
TIME_ZONE = 'UTC'
# Database
DATABASES = {
'default': {
'NAME': '/var/lib/graphite/graphite.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}
}
# Authentication
SECRET_KEY = 'your-secret-key-here'
# Allow all hosts (restrict in production!)
ALLOWED_HOSTS = ['*']
# Carbon links
CARBONLINK_HOSTS = [('127.0.0.1:7002:cache')]
# Cluster settings
CLUSTER_SERVERS = []
# Dashboard settings
DASHBOARD_CONF = '/etc/graphite/dashboard.conf'
GRAPHTEMPLATES_CONF = '/etc/graphite/graphTemplates.conf'
# Default dashboard behavior
DEFAULT_DASHBOARD_TEMPO = 15
[cache]
# Increase for high-volume environments
MAX_UPDATES_PER_SECOND = 2000
MAX_CREATES_PER_MINUTE = 1000
# Enable persistent cache
ENABLE_PERSISTENT_CACHE = True
# Batch writes
WRITE_BACK_FREQUENCY = 60
[whisper]
# Compression settings
FALLOCATE_CREATE = True
SPARSE_CREATE = False
# Restart Carbon
sudo systemctl restart carbon-cache
# Restart Graphite-Web (Apache)
sudo systemctl restart apache2
# Check status
sudo systemctl status carbon-cache
# Check Carbon logs
sudo journalctl -u carbon-cache -f
# Test metric submission
echo "test.metric $(date +%s) 1" | nc localhost 2003
# Query Graphite API
curl "http://localhost/render?target=test.metric&format=json"
If you have many unique metric names:
MAX_CREATES_PER_MINUTEMonitor Whisper file growth:
du -sh /var/lib/graphite/whisper/
find /var/lib/graphite/whisper/ -name "*.wsp" | wc -l