Laravel Scout + Meilisearch v1.11+ Production Docker Compose & Horizon Queue Tuning
MeiliSizer Blueprint Summary: Laravel Scout ships native Meilisearch & Typesense drivers out of the box. Learn how to configure Horizon queue chunking, Docker memory constraints, and index settings in CI/CD.
Preventing Synchronous Eloquent Saves From Flooding Meilisearch Tasks (MeiliSizer Guide)
Out of the box, saving 5,000 Eloquent models in a loop dispatches 5,000 tiny 1-document indexing tasks in Meilisearch, creating a massive task queue backlog. Enabling SCOUT_QUEUE=true on a dedicated Horizon supervisor and wrapping bulk updates in Model::withoutSyncingToSearch() + searchable() chunks collapses 5,000 tasks into 5 ultra-fast LMDB commits.
Production docker-compose.yml & config/scout.php Index Settings
# docker-compose.yml — Isolated Meilisearch v1.11 Service on 16GB KVM
services:
meilisearch:
image: getmeili/meilisearch:v1.11
restart: unless-stopped
environment:
MEILI_ENV: production
MEILI_MASTER_KEY: ${MEILISEARCH_KEY}
MEILI_MAX_INDEXING_MEMORY: 4Gb
MEILI_NO_ANALYTICS: "true"
volumes:
- meili_lmdb:/meili_data
ports:
- "127.0.0.1:7700:7700"
deploy:
resources:
limits:
memory: 10G
MeiliSizer RAM & NVMe Tier Matrix for LARAVEL-SCOUT-DOCKER
| Catalog Scale | Hot Working Set | Safe Peak RAM | Matched Spec Tier |
|---|---|---|---|
| SaaS MVP (250K Eloquent Rows) | 0.8 GB Index | 8 GB App + Search KVM | Hostinger KVM 2 ($5.99/mo) |
| Growth SaaS (1M Rows / 5M Queries) | 2.2 GB Index | 16 GB DDR5 KVM Node | Hostinger KVM 4 ($10.49/mo) |
| Multi-Region API (5M+ Rows) | 9.5 GB Index | 3.5GHz+ Dedicated Search VPC | Vultr High Frequency 16GB–32GB |
MeiliSizer Production Checklist: LARAVEL-SCOUT-DOCKER
- Run php artisan scout:sync-index-settings inside your deployment pipeline before running migrations or bulk imports.
- Set SCOUT_QUEUE=true and assign a dedicated Redis Horizon queue ("search-sync") with chunk sizes of 500–1,000 records.
- Define custom toSearchableArray() on every Eloquent model so sensitive columns and giant JSON blobs are never serialized.
- Bind port 7700 to 127.0.0.1 or a private VPC interface; expose public search only via Caddy/Nginx TLS with scoped keys.
Hostinger KVM DDR5 NVMe VPS (1-Click Docker / Meilisearch) — MeiliSizer Pick
Up to 67% OFF + Extra 20% Partner Discount • 8GB–32GB DDR5 RAM + PCIe Gen4 NVMe for LMDB Mmap
Vultr High Frequency 3.5GHz+ NVMe Cloud (SG / Tokyo / US / EU) — MeiliSizer Option
3.5GHz+ Turbo Clock Speeds • Fastest Roaring Bitmap & Prefix FST Intersections in 32 Global Regions
MeiliSizer Engineering FAQ: LARAVEL-SCOUT-DOCKER
- Should Laravel query Meilisearch server-side via Scout or client-side via InstantSearch?
-
Use server-side Model::search()->paginate() when you need complex Eloquent policy hydration or Inertia/Livewire rendering; use client-side InstantSearch with tenant tokens for sub-15ms keystroke autocomplete.
- What chunk size works best for php artisan scout:import?
-
For 1.5 KB JSON payloads, scout.chunk.searchable = 1000 to 2500 maximizes Meilisearch auto-batching throughput (~15,000 docs/sec on NVMe).