Skip to content

[BUG] Disk index first query after restart takes minutes on NFS: MADV_RANDOM makes the load fault page by page #61

Open

Description

@chishui

What is the bug?

Since #55, map_index_file maps disk indexes with MADV_RANDOM. load_mapped_payload then walks the summaries and directory front to back, one synchronous 4 KiB fault per page. On NFS, the first query after a restart takes minutes.

How can one reproduce the bug?

1M docs, 12 per_block segments (16.1 GiB), EFS, 5.8 GiB host. Fresh reboot per arm:

default NSPARSE_MMAP_ADVISE=normal
first query 157.8 s 5.65 s
NFS READs 302k × 4.3 KB 2.4k × 1 MB
warm query 0.74 ms ~6.2 s (thrash)

5M docs (54 segments): ~23 min.

What is the expected behavior?

Fast load and fast warm queries; a whole-file flag gives only one.

Do you have any additional context?

Fix: sequential/WILLNEED advice (or pread) on the load-time sections, MADV_RANDOM on inline blocks only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions