OD OllamaDoctor
DIAGNOSTIC GUIDE · PERFORMANCE

Ollama Slow on Windows: Token Bottlenecks & Fixes

By Systems Engineering Team Updated: October 30, 2026 Inference Benchmarks Memory Bandwidth Flash Attention Read Time: 14 min

Slow responses in Ollama are almost never random. LLM inference follows strict mathematical laws dictated by two phases: the compute-bound Prompt Evaluation (Time-to-First-Token) phase and the memory-bandwidth-bound Token Generation (Decoding) phase. Here is how to benchmark your actual token rates and eliminate the bottlenecks.

Step 1: Benchmark Your Actual Tokens Per Second

Never rely on subjective perception. Ollama has a built-in benchmarking flag that outputs granular timing metrics for every query. Run your model with --verbose:

ollama run llama3.1:8b --verbose "Write a 300-word explanation of quantum computing."

At the bottom of the output, Ollama will print an execution summary:

total duration:       4.812s
load duration:        21.2ms
prompt eval count:    18 token(s)
prompt eval duration: 142.1ms
prompt eval rate:     126.67 tokens/s
eval count:           312 token(s)
eval duration:        4.648s
eval rate:            67.12 tokens/s

Interpreting the Two Speeds:

Baseline Expected Speeds Matrix (Windows 11)

Hardware Tier Model & Quant Typical Eval Speed Status / Bottleneck
NVIDIA RTX 4090 (24GB VRAM) Llama 3.1 8B Q4_K_M 110 – 135 tokens/s 100% VRAM (1,008 GB/s bandwidth)
NVIDIA RTX 4070 / 3060 (12GB) Llama 3.1 8B Q4_K_M 55 – 75 tokens/s 100% VRAM (504 GB/s bandwidth)
NVIDIA RTX 4060 (8GB VRAM) Llama 3.1 8B Q4_K_M 48 – 65 tokens/s 100% VRAM (272 GB/s bandwidth)
AMD RX 7900 XTX (24GB VRAM) Llama 3.1 8B Q4_K_M 90 – 120 tokens/s 100% VRAM (ROCm 6.x native)
Intel Core i7-13700K (CPU Only) Llama 3.1 8B Q4_K_M 8 – 14 tokens/s DDR5 Dual Channel (~70 GB/s)
Older Core i5 / DDR4 (CPU Only) Llama 3.1 8B Q4_K_M 3 – 6 tokens/s DDR4 Dual Channel (~35 GB/s)
Partial Offload (GPU + RAM Spill) Llama 3.1 8B Q4_K_M 4 – 9 tokens/s PCIe Bus Transfer Bottleneck

Root Cause 1: Memory Spilling Over PCIe (Partial Offloading)

The single most common cause of sudden speed drops is running a model that marginally exceeds your GPU's dedicated VRAM. If an 8B model fits 28 out of 33 layers on GPU and offloads 5 layers to CPU, the inference engine must transfer activation vectors across the PCIe slot for every generated token.

The Fix: Use our Ollama VRAM Calculator to calculate your exact headroom. Drop from an 8B Q8_0 model down to Q4_K_M or switch to an ultra-fast 3B model (e.g. llama3.2:3b), which runs at 120+ tokens/s on almost any modern graphics card.

Root Cause 2: Flash Attention Is Disabled

By default, older llama.cpp runtimes use standard multi-head self-attention, which exhibits quadratic memory growth and higher arithmetic overhead. Flash Attention re-orders the attention calculation into tiles, drastically accelerating prompt processing and conserving memory.

To permanently enable Flash Attention on Windows:

[Environment]::SetEnvironmentVariable('OLLAMA_FLASH_ATTENTION', '1', 'User')

Restart Ollama from the Windows taskbar system tray. (Requires NVIDIA Turing / RTX 2000 series or newer, or modern AMD RDNA).

Root Cause 3: CPU Thread Saturation & Hyperthreading Drag

If you are running Ollama on CPU (or partially on CPU), Ollama automatically detects available logical processors. However, modern Intel CPUs (12th, 13th, 14th Gen) feature Performance (P-cores) and Efficient (E-cores). If Ollama spawns worker threads across E-cores or hyperthreaded virtual cores, thread synchronization stalls inference.

For CPU inference, optimal performance is achieved by matching threads strictly to physical Performance cores (typically 6, 8, or 10):

# Set thread count equal to physical cores:
[Environment]::SetEnvironmentVariable('OLLAMA_NUM_THREADS', '8', 'User')

Root Cause 4: Bloated Context History in Chat Applications

If you are using Open WebUI, LibreChat, or Continue.dev, these clients send the entire conversation history with every single message. If your chat session has lasted 30 messages, Ollama must re-evaluate thousands of prompt tokens before outputting a single word.

Check the prompt eval count in your logs. If it is 4,000+ tokens, start a new chat thread to reset the context buffer.

Root Cause 5: Real-Time Antivirus File Scanning

During model loading, Windows Defender Antivirus inspects multi-gigabyte GGUF tensor files located in %USERPROFILE%\.ollama\models\blobs\. This causes cold-load times to jump from 1.5 seconds up to 45 seconds.

Add an antivirus exclusion for your Ollama folder in PowerShell (Run as Administrator):

Add-MpPreference -ExclusionPath "$env:USERPROFILE\.ollama"

Frequently Asked Questions

Why does the first response take 10 seconds, but subsequent responses are instant?

This is the cold-start overhead. Ollama needs to load the model file from SSD into VRAM and initialize CUDA tensor handles. Ollama keeps the model resident in VRAM for 5 minutes (configurable via OLLAMA_KEEP_ALIVE) so subsequent requests respond immediately.

Does faster system RAM (DDR5 6000 vs DDR4 3200) make GPU inference faster?

No, if the model fits 100% in GPU VRAM, system RAM speed has virtually zero impact because calculations occur entirely in GPU memory (GDDR6). System RAM speed only matters if you are running on CPU or experiencing partial offloading.

Can I increase speed by overclocking my GPU core clock?

Overclocking the GPU core frequency provides minimal gain (1–3%) because LLM generation is limited by memory bandwidth, not core compute. Overclocking GPU video memory (VRAM clock) in tools like MSI Afterburner yields a much more noticeable speed improvement.

← GPU Detection Guide Context Window & VRAM Scaling →
Advertisement