Skip to main content

Maintenance

Regular maintenance ensures optimal performance and prevents storage issues. Establish routines for model cleanup, cache management, and performance optimization.

Routine Maintenance Tasks

Model Cleanup: Remove unused models to free disk space:

Bash

ollama listollama rm unused_model_name

Cache Management: Clear temporary files and caches:

Bash
sudo systemctl stop ollamasudo rm -rf /tmp/ollama*sudo systemctl start ollama

Log Rotation: Ensure log files don't consume excessive disk space:

Bash
sudo journalctl --vacuum-time=30d

Performance Optimization

Monitor and optimize model loading times by adjusting keep-alive settings:

Bash
export OLLAMA_KEEP_ALIVE=10m

Optimize memory usage for multiple concurrent requests by configuring appropriate model concurrency limits.

Storage Management

Monitor disk usage for model storage:

Bash
du -sh ~/.ollama/models/df -h /usr/share/ollama

Implement automated cleanup scripts for old model versions and temporary files.