%% Thanks to Ulf Wiger at Ericcson for these comments: %% %% This file is identified via the erl command line option -config File. %% Note that File should have no extension, e.g. %% erl -config .../sys (if this file is called sys.config) %% %% In this file, you can redefine application environment variables. %% This way, you don't have to modify the .app files of e.g. OTP applications. %% %% %% This is an example config file for an HTTP balancer (TCP port 80) %% instead of a distcc server balancer. %% The balancer app is expecting a list of "be" records. However, the %% Erlang record mechanism is kindof ugly and limited. So, we create %% tuples here that look like "be" records, but we must be careful so %% that each entry in the tuple matches an actual "be" record: %% %% 0. The atom 'be' %% 1. A string containing a hostname or IP address %% 2. The TCP port number %% 3. The status atom 'up' %% 4. The maximum number of simultaneous connections, >= 1. %% 5. The number of pending connections, 0. %% 6. The number of active connections, 0. %% 7. The last error term, 'no_error'. %% 8. The last error timestamp, 0. %% 9. Activity counter, 0. %% 10. Activity time counter, 0. %% 11. Activity list, []. %% As an example, here's a list of quite heterogenous back-end hosts: %% %% Server CPU Mhz %% bld1 2 x 932 %% bld2 2 x 932 %% bld3 2 x 846 %% bld4 1 x 1263 %% bld5 2 x 1263 %% bld6 4 x 2384 %% %% As far as distcc is concerned, CPU speed is the main concern, so %% the back-end list will contain the hosts in descending CPU speed. [{balance, [ %% New distcc (0.15 or later) uses port 3632, old distcc uses 4200 {local_tcp_port, 3632}, %% be_conn_timeout is the timeout value to connect to a back-end host %% Value is in milliseconds {be_conn_timeout, 1000}, %% be_inactivity_timeout is the timeout value for inactivity to a %% back-end host. Value is in milliseconds. {be_inactivity_timeout, 120000}, %% Initial back-end host list. See the comments at top of file. %% Faster hosts should appear at the beginning of the list. {initial_be_list, [ {be, "bld6", 3632, up, 4, 0, 0, no_error, 0, 0, 0, []}, {be, "bld4", 3632, up, 1, 0, 0, no_error, 0, 0, 0, []}, {be, "bld5", 3632, up, 2, 0, 0, no_error, 0, 0, 0, []}, {be, "bld1", 3632, up, 2, 0, 0, no_error, 0, 0, 0, []}, {be, "bld2", 3632, up, 2, 0, 0, no_error, 0, 0, 0, []}, {be, "bld3", 3632, up, 2, 0, 0, no_error, 0, 0, 0, []} % Do _not_ put a trailing comma after the last item in an Erlang list. ]} %% Any additional {key, value} tuples for the balancer app go here ]} ].