Skip to content
Browse files

bp:MB-5307: hibernate menelaus_web:handle_streaming processes

This is backport of part of 6b85276

Erlang is not very eager on GC-ing those processes that just sit there
and wait config updates. We know that consuming config via
ns_config:get instantly eats lots of ram, so hibernating really helps
a lot.

Change-Id: Ifcf49af061d82bf68b97c02c306e7233170c0102
Reviewed-on: http://review.couchbase.org/24783
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
1 parent a06f339 commit eb0c5af7b0b2e2c6471e7e9dbd6d23a96ecf513a Aliaksey Kandratsenka committed with Farshid Ghods Feb 21, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/menelaus_web.erl
View
3 src/menelaus_web.erl
@@ -712,6 +712,9 @@ handle_streaming(F, Req, HTTPRes, LastRes) ->
HTTPRes:write_chunk(""),
exit(normal)
end,
+ erlang:hibernate(erlang, apply, [fun handle_streaming_wakeup/4, [F, Req, HTTPRes, Res]]).
+
+handle_streaming_wakeup(F, Req, HTTPRes, Res) ->
receive
{notify_watcher, _} ->
timer:sleep(50),

0 comments on commit eb0c5af

Please sign in to comment.
Something went wrong with that request. Please try again.