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

Allow disabling off-heap messages #1597

Merged
merged 1 commit into from Sep 6, 2018
Merged

Conversation

@nickva
Copy link
Contributor

@nickva nickva commented Sep 6, 2018

Description

Off-heap messages is an Erlang 19 feature:

http://erlang.org/doc/man/erlang.html#process_flag_message_queue_data

It is adviseable to use that setting for processes which expect to receive a
lot of messages. CouchDB sets it for couch_server, couch_log_server and bunch
of others as well.

In some cases the off-heap behavior could alter the timing of message receives
and expose subtle bugs that have been lurking in the code for years. Or could
slightly reduce performance, so a safety measure allow disabling it.

How to test

> erlang:process_info(whereis(couch_server), message_queue_data).
{message_queue_data,off_heap}


> config:set("off_heap_mqd","couch_server","false").
ok

> exit(whereis(couch_server), kill).
true

> erlang:process_info(whereis(couch_server), message_queue_data).
{message_queue_data,on_heap}

Related

#1392

Copy link
Member

@davisp davisp left a comment

If we're gonna make it configurable lets at least have it configurable per module. Something like set_mqd_off_heap(?MODULE) and then config:get_boolean("off_heap_mqd", atom_to_list(Module), true) maybe?

@nickva
Copy link
Contributor Author

@nickva nickva commented Sep 6, 2018

Good idea, @davisp

Off-heap messages is an Erlang 19 feature:

http://erlang.org/doc/man/erlang.html#process_flag_message_queue_data

It is adviseable to use that setting for processes which expect to receive a
lot of messages. CouchDB sets it for couch_server, couch_log_server and bunch
of others as well.

In some cases the off-heap behavior could alter the timing of message receives
and expose subtle bugs that have been lurking in the code for years. Or could
slightly reduce performance, so a safety measure allow disabling it.
@nickva nickva force-pushed the allow-disabling-off-heap-messages branch from 3acd37e to f29b09c Sep 6, 2018
@davisp
davisp approved these changes Sep 6, 2018
Copy link
Member

@davisp davisp left a comment

+1

@nickva nickva merged commit ee3c4b5 into master Sep 6, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nickva nickva deleted the allow-disabling-off-heap-messages branch Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants