File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cm4all-beng-proxy (21.32) unstable; urgency=low
22
3+ * bp: discard an exponential number of processes on memory pressure
34 * prometheus: add "beng_proxy_stock_total_create_duration"
45 * spawn: eliminate epoll_wait() roundtrip
56
Original file line number Diff line number Diff line change @@ -349,9 +349,11 @@ BpInstance::ReloadState() noexcept
349349void
350350BpInstance::OnCgroupPressure (unsigned repeat) noexcept
351351{
352- constexpr std::size_t discard_request = 64 ;
353-
354- (void )repeat; // TODO use this
352+ /* the number of processes we discard in each call grows
353+ exponentially (but no more than 512 at a time), just in
354+ case we're spawning new processes faster than this method
355+ shuts them down */
356+ const std::size_t discard_request = std::size_t {32 } << std::min (repeat, 4U );
355357
356358 std::size_t n = 0 ;
357359
You can’t perform that action at this time.
0 commit comments