Skip to main content

Monitoring

Effective monitoring ensures optimal performance and helps identify resource bottlenecks. Ollama provides built-in metrics and supports integration with external monitoring systems.

Built-in Monitoring

1.Monitor Ollama service status:


Bash

sudo systemctl status ollama
ollama ps

2.Check resource usage and active models:


Bash

ollama show llama2
curl http://localhost:11434/api/ps

Log Management

3.Ollama logs are available through systemd journal:


Bash


sudo journalctl -u ollama -f

4.For Ubuntu systems, configure centralized logging:

Bash
sudo mkdir -p /var/log/ollama
sudo chown ollama:ollama /var/log/ollama

Performance Monitoring

5.Monitor GPU utilization when using CUDA:

Bash

`` nvidia-smi -l 1

6.Track memory usage:

Bash

free -h ps aux | grep ollama

7.External Monitoring Integration
## Integrate with Prometheus for metrics collection:

Bash

curl http://localhost:11434/metrics

Set up Grafana dashboards to visualize model performance, response times, and resource utilization patterns.