Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support rtree preheat #6781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hy05190134
Copy link

Issue

What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
we found a lot of requests timeout when osrm is starting, but after a while the rt decrease, so we want to resolve the problem, and we found the reason is the preheat of rtree, because the leaf node of rtree is stored in the .fileIndex file and
it use mmap so it will produce disk I/O for preheat

Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.

Tasklist

Requirements / Relations

Link any requirements here. Other pull requests this PR is based on?

@danpat
Copy link
Member

danpat commented Feb 2, 2024

Hmm. Why not run a simple cat map.fileIndex > /dev/null operation before launching osrm-routed? That would have the same effect of loading all the files pages into the page cache....

@hy05190134
Copy link
Author

hy05190134 commented Feb 4, 2024

Hmm. Why not run a simple cat map.fileIndex > /dev/null operation before launching osrm-routed? That would have the same effect of loading all the files pages into the page cache....

I don't think it will produce the same effect, cat file just preheat the cache of disk but will not preheat the mmap page cache and I just want others do not sense the process when they first use the osrm-routed and encounter the same problem when started

@hy05190134
Copy link
Author

@danpat another question, why the desinger of osrm just leave the .fileIndex using mmap

@hy05190134 hy05190134 closed this Feb 4, 2024
@hy05190134 hy05190134 reopened this Feb 4, 2024
Copy link
Collaborator

@DennisOSRM DennisOSRM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the preheat is just a linear scan through the data. Seems one can do that using cat in any production setup.

@fenwuyaoji
Copy link
Contributor

fenwuyaoji commented Jul 17, 2024

@hy05190134 Hi, thanks for your work. we use your preheat method in our osrm.
The osrm runs as a pod in k8s, and remote storage is used to save osrm data and mounted to the pod. we modified the osrm to make it can change map meta data while running. The storage and k8s cluster are in different regions, leading to high latency, often needing 10 mins until loading new data succeeds.

We notice that during this init stage, the CPU usage (20m) is low but iowait (8*25%) & load (2.5) is high. this affects the serving and makes several requests timeout. I think this is due to the preheat and mmap. I'm wondering wether there is a way can solve this problem. do you have any advice?

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants