%% 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, []. [{balance, [ %% local_tcp_port is the TCP port that the proxy listens to %% New distcc (0.15 or later) uses port 3632, old distcc uses 4200 {local_tcp_port, 2525}, %% be_conn_timeout is the timeout value to connect to a back-end host %% Value is in milliseconds {be_conn_timeout, 10000}, %% 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, "mx1.mail.yahoo.com", 25, up, 2, 0, 0, no_error, 0, 0, 0, []}, {be, "bogus-demo", 25, up, 2, 0, 0, no_error, 0, 0, 0, []}, {be, "mx1.hotmail.com", 25, up, 1, 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 ]} ].