Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
1371-erts-Increase-default-process-limit.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1371-erts-Increase-default-process-limit.patch of Package erlang
From cdb053d8fbb8fec0a5e55d408784404f51fa777f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= <lukasz@niemier.pl> Date: Thu, 6 Jul 2023 22:03:26 +0200 Subject: [PATCH] erts: Increase default process limit --- erts/doc/src/erl_cmd.xml | 2 +- erts/emulator/beam/erl_process.h | 2 +- erts/emulator/test/node_container_SUITE.erl | 55 ++++++++++++--------- system/doc/efficiency_guide/advanced.xml | 2 +- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/erts/doc/src/erl_cmd.xml b/erts/doc/src/erl_cmd.xml index f6a36ecffd..8a2337c5cd 100644 --- a/erts/doc/src/erl_cmd.xml +++ b/erts/doc/src/erl_cmd.xml @@ -1131,7 +1131,7 @@ $ <input>erl \ however, be changed in the future. The actual value chosen can be checked by calling <seeerl marker="erlang#system_info_process_limit">erlang:system_info(process_limit)</seeerl>.</p> - <p>The default value is <c>262144</c></p> + <p>The default value is <c>1048576</c></p> </item> <tag><marker id="+Q"/><marker id="max_ports"/><c><![CDATA[+Q Number]]></c></tag> <item> diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index a0fe781bb1..a587dde4dd 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -78,7 +78,7 @@ typedef struct process Process; #define ERTS_MAX_NO_OF_DIRTY_CPU_SCHEDULERS ERTS_MAX_NO_OF_SCHEDULERS #define ERTS_MAX_NO_OF_DIRTY_IO_SCHEDULERS ERTS_MAX_NO_OF_SCHEDULERS -#define ERTS_DEFAULT_MAX_PROCESSES (1 << 18) +#define ERTS_DEFAULT_MAX_PROCESSES (1 << 20) #define ERTS_HEAP_ALLOC(Type, Size) \ erts_alloc((Type), (Size)) diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index 13d111a1ad..67936a51a2 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -28,6 +28,7 @@ -module(node_container_SUITE). -author('rickard.green@uab.ericsson.se'). +-include_lib("stdlib/include/assert.hrl"). -include_lib("common_test/include/ct.hrl"). -export([all/0, suite/0, init_per_suite/1, end_per_suite/1, @@ -904,21 +905,29 @@ mkpidlist(N, Ps) -> mkpidlist(N-1, [spawn(fun () -> ok end)|Ps]). iter_max_procs(Config) when is_list(Config) -> - NoMoreTests = make_ref(), - erlang:send_after(10000, self(), NoMoreTests), - %% Disable logging to avoid "Too many processes" log which can %% cause ct_logs to crash when trying to spawn "async print job". - #{level := LoggerLevel} = logger:get_primary_config(), - ok = logger:set_primary_config(level, none), - Res = try - R = chk_max_proc_line(), - R = chk_max_proc_line(), - done = chk_max_proc_line_until(NoMoreTests, R), - R - after - logger:set_primary_config(level, LoggerLevel) + {ok, Peer, Node} = ?CT_PEER(["+P", "2048", "-kernel", "logger_level", "none"]), + NoMoreTests = make_ref(), + + Self = self(), + NcData = make_ref(), + + %% Sleep to give all `peer` processes time to go down. + ct:sleep(500), + + RPid = spawn_link(Node, fun () -> + erlang:send_after(10000, self(), NoMoreTests), + R = chk_max_proc_line(), + R = chk_max_proc_line(), + done = chk_max_proc_line_until(NoMoreTests, R), + Self ! {NcData, R} + end), + Res = receive + {NcData, R} -> R end, + unlink(RPid), + stop_node(Peer, Node), Cmt = io_lib:format("max processes = ~p; " "process line length = ~p", [element(2, Res), element(1, Res)]), @@ -959,7 +968,7 @@ chk_max_proc_line_until(NoMoreTests, Res) -> NoMoreTests -> done after 0 -> - Res = chk_max_proc_line(), + ?assertEqual(Res, chk_max_proc_line()), chk_max_proc_line_until(NoMoreTests, Res) end. @@ -972,20 +981,20 @@ magic_ref(Config) when is_list(Config) -> MRef0 = MRef1, Me = self(), {Pid, Mon} = spawn_opt(fun () -> - receive - {Me, MRef} -> - Me ! {self(), erts_debug:get_internal_state({magic_ref,MRef})} - end - end, - [link, monitor]), + receive + {Me, MRef} -> + Me ! {self(), erts_debug:get_internal_state({magic_ref,MRef})} + end + end, + [link, monitor]), Pid ! {self(), MRef0}, receive - {Pid, Info} -> - {Addr0, 3, true} = Info + {Pid, Info} -> + {Addr0, 3, true} = Info end, receive - {'DOWN', Mon, process, Pid, _} -> - ok + {'DOWN', Mon, process, Pid, _} -> + ok end, MaxTime = erlang:monotonic_time(millisecond) + 1000, %% The DOWN signal is sent before heap is cleaned up, diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml index 7fdb154412..33d66b195e 100644 --- a/system/doc/efficiency_guide/advanced.xml +++ b/system/doc/efficiency_guide/advanced.xml @@ -155,7 +155,7 @@ <row> <cell>Processes</cell> <cell>The maximum number of simultaneously alive Erlang processes - is by default 262,144. This limit can be configured at startup. + is by default 1,048,576. This limit can be configured at startup. For more information, see the <seecom marker="erts:erl#max_processes"><c>+P</c></seecom> command-line flag in the -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor