Sourcegraph Search Slow or Timing Out (Zoekt Crash Loop)
Quick answer
Slow or timed-out search on a self-hosted instance is usually undersized gitserver or indexed-search, or zoekt-webserver hitting vm.max_map_count.
Most likely fix: Narrow the cause
How to fix it
Try these in order — the most common fix is first.
1. Narrow the cause
- Try the query with index:only, timeout:60s and count:all
- Check the Grafana Git Server dashboard; a healthy node stays below 5ms on the echo test
Did this fix it?2. Fix zoekt-webserver CrashLoopBackOff
- Confirm pods are not simply OOMKilled (kubectl top pod)
- Check sudo sysctl -n vm.max_map_count; if below twice (repos / indexed-search replicas), raise it, for example sysctl -w vm.max_map_count=262144
- Persist it in /etc/sysctl.conf, or add replicas
Did this fix it?3. Add resources
- Raise indexed-search memory and CPU, or add shards on Kubernetes
- Follow the resource estimator
Did this fix it?
Symptoms
Search is slow, times out, or zoekt-webserver restarts with 'cannot allocate memory'.
Why it happens
- Overloaded gitserver
- Too little indexed-search memory or CPU
- vm.max_map_count too low for the repos per replica
- Zoekt watchdog restarts under sustained load
This guide also covers
- sourcegraph search slow
- sourcegraph zoekt crashloopbackoff
- sourcegraph search timeout
Still not working?
If Sourcegraph keeps failing, you're not alone. See every Sourcegraph problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All crashes, freezes & blank screens guides →
GitHub Copilot Chat Not Responding (GitHub Copilot)
Other Sourcegraph errors
- Sourcegraph Cody Free and Pro Discontinued: What Happened and What to Do
- Sourcegraph Cody Not Working in VS Code
- Sourcegraph Cody Sign-In Error: Authentication Failed or Signed Out on Restart
- Sourcegraph Cody Not Working in JetBrains (IntelliJ, Android Studio)
- Sourcegraph Cody Rate Limit or Usage Limit Reached
- Sourcegraph Search Not Finding Results
- Sourcegraph Repository Not Cloning or Not Updating
- Sourcegraph Upgrade Failed: Dirty Database Migration Error