From 69e01c0f5d332d34b95575203ae9d7829b9a45fa Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Tue, 20 Aug 2013 21:09:47 -0400 Subject: add erl option to set schedulers by percentages For applications where measurements show enhanced performance from the use of a non-default number of emulator scheduler threads, having to accurately set the right number of scheduler threads across multiple hosts each with different numbers of logical processors is difficult because the erl +S option requires absolute numbers of scheduler threads and scheduler threads online to be specified. To address this issue, add a +SP option to erl, similar to the existing +S option but allowing the number of scheduler threads and scheduler threads online to be set as percentages of logical processors configured and logical processors available, respectively. For example, "+SP 50:25" sets the number of scheduler threads to 50% of the logical processors configured, and the number of scheduler threads online to 25% of the logical processors available. The +SP option also interacts with any settings specified with the +S option, such that the combination of options "+S 4:4 +SP 50:50" (in either order) results in 2 scheduler threads and 2 scheduler threads online. Add documentation for the +SP option. Add tests for the +SP option to scheduler_SUITE. Add tests and documentation for two existing features of the +S option: +S 0:0 resets the scheduler thread count and scheduler threads online count to their defaults, and specifying negative numbers for +S results in those values being subtracted from the default values for the host. --- erts/doc/src/erl.xml | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'erts/doc/src/erl.xml') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 70569b1c6c..c16b45856d 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -748,19 +748,47 @@ -

Sets the amount of scheduler threads to create and scheduler - threads to set online when SMP support has been enabled. - Valid range for both values are 1-1024. If the - Erlang runtime system is able to determine the amount - of logical processors configured and logical processors available, - Schedulers will default to logical processors configured, - and SchedulersOnline will default to logical processors - available; otherwise, the default values will be 1. Schedulers - may be omitted if :SchedulerOnline is not and vice versa. The - amount of schedulers online can be changed at run time via +

Sets the number of scheduler threads to create and scheduler + threads to set online when SMP support has been enabled. The maximum for + both values is 1024. If the Erlang runtime system is able to determine the + amount of logical processors configured and logical processors available, + Schedulers will default to logical processors configured, and + SchedulersOnline will default to logical processors available; + otherwise, the default values will be 1. Schedulers may be omitted + if :SchedulerOnline is not and vice versa. The number of schedulers + online can be changed at run time via erlang:system_flag(schedulers_online, SchedulersOnline).

-

This flag will be ignored if the emulator doesn't have +

If Schedulers or SchedulersOnline is specified as a + negative number, the value is subtracted from the default number of + logical processors configured or logical processors available, respectively. +

+

Specifying the value 0 for Schedulers or SchedulersOnline + resets the number of scheduler threads or scheduler threads online respectively + to its default value. +

+

This option is ignored if the emulator doesn't have + SMP support enabled (see the -smp + flag).

+
+ + +

Similar to +S but uses percentages to set the + number of scheduler threads to create, based on logical processors configured, + and scheduler threads to set online, based on logical processors available, when + SMP support has been enabled. Specified values must be greater than 0. For example, + +SP 50:25 sets the number of scheduler threads to 50% of the logical processors + configured and the number of scheduler threads online to 25% of the logical processors available. + SchedulersPercentage may be omitted if :SchedulersOnlinePercentage is + not and vice versa. The number of schedulers online can be changed at run time via + erlang:system_flag(schedulers_online, SchedulersOnline). +

+

This option interacts with +S settings. + For example, on a system with 8 logical cores configured and 8 logical cores + available, the combination of the options +S 4:4 +SP 50:25 (in either order) + results in 2 scheduler threads (50% of 4) and 1 scheduler thread online (25% of 4). +

+

This option is ignored if the emulator doesn't have SMP support enabled (see the -smp flag).

-- cgit v1.2.3