Skip to content

mlock support#9

Closed
evanbattaglia wants to merge 7 commits into
jehiah:masterfrom
seomoz:evan/mlock-nobugfix
Closed

mlock support#9
evanbattaglia wants to merge 7 commits into
jehiah:masterfrom
seomoz:evan/mlock-nobugfix

Conversation

@evanbattaglia

Copy link
Copy Markdown

The C version of sortdb supported a call to mlock to lock the DB file in memory:
https://github.com/bitly/simplehttp/blob/master/sortdb/sortdb.c#L363

This adds this option back in. I'm not sure how much use it will be to others, but it's been useful in ensuring our large DB file is completely loaded in memory before serving and while serving, making sure requests are fast from the start and stay fast.

Note that when using with Docker (at least with large files), the option --cap-add IPC_LOCK must be used (Marathon config: parameters: [ { "key": "cap-add", "value": "IPC_LOCK" } ]).

The following branch has this and my previous bugfix:
master...seomoz:evan/mlock

CC @noam-c @tony-bye @erinren

@mreiferson

Copy link
Copy Markdown

It makes me smile that someone else is using SortDB 👍

Comment thread sorted_db/db.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment repeats what Fatalf tells us, so you can probably remove it.

@jehiah jehiah mentioned this pull request Aug 5, 2016
@jehiah jehiah closed this in #10 Aug 5, 2016
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.

3 participants