<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FEnvironment_Variables</id>
		<title>User:Allen Kerensky/Environment Variables - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FEnvironment_Variables"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Environment_Variables&amp;action=history"/>
		<updated>2026-05-16T08:28:02Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Environment_Variables&amp;diff=31831&amp;oldid=prev</id>
		<title>Allen Kerensky at 04:15, 9 February 2013</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Environment_Variables&amp;diff=31831&amp;oldid=prev"/>
				<updated>2013-02-09T04:15:10Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 04:15, 9 February 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Others have recommended numbers as high as 2048.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Others have recommended numbers as high as 2048.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This article &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/del&gt;[http://www.mono-project.com/Article:ThreadPool_Deadlocks&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/del&gt;Threadpool Deadlocks&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;] may help.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This article &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on &lt;/ins&gt;[http://www.mono-project.com/Article:ThreadPool_Deadlocks Threadpool Deadlocks] may help.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Using shell environment variables in OpenSim configuration ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Using shell environment variables in OpenSim configuration ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Environment_Variables&amp;diff=31830&amp;oldid=prev</id>
		<title>Allen Kerensky: created from Test Page</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Environment_Variables&amp;diff=31830&amp;oldid=prev"/>
				<updated>2013-02-09T04:08:26Z</updated>
		
		<summary type="html">&lt;p&gt;created from Test Page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Environment Variables =&lt;br /&gt;
Archived here from [Test Page] to prevent disappearance.&lt;br /&gt;
&lt;br /&gt;
== MONO_THREADS_PER_CPU ==&lt;br /&gt;
By default, OpenSimulator only recognizes one shell environment variable: MONO_THREADS_PER_CPU&lt;br /&gt;
&lt;br /&gt;
If this variable is set in your shell before starting OpenSimulator, it will allow you to control the number of threads Mono will host per CPU.&lt;br /&gt;
&lt;br /&gt;
The proper setting for this variable somewhat subject to religious interpretation.&lt;br /&gt;
&lt;br /&gt;
Common recommendations including bumping it up to around 100 on many OpenSim installations.&lt;br /&gt;
&lt;br /&gt;
Others have recommended numbers as high as 2048.&lt;br /&gt;
&lt;br /&gt;
This article [[http://www.mono-project.com/Article:ThreadPool_Deadlocks|Threadpool Deadlocks]] may help.&lt;br /&gt;
&lt;br /&gt;
== Using shell environment variables in OpenSim configuration ==&lt;br /&gt;
&lt;br /&gt;
We will need to use two new things in our configurations: a section [Environment] to tell us what variables we need to look at in the shell and we will need to use the Nini key expansion. Nini, can have keys that look like ${SECTION|VARIABLE} and can expand those to the variables we assign.&lt;br /&gt;
&lt;br /&gt;
In your shell you will export your values and check the ones you want to use that are predefined by your system ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export RT_ZONE=Zone_00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# You can see your HOSTNAME (It will be set by the system)...&lt;br /&gt;
echo $HOSTNAME&lt;br /&gt;
OSERV_00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the ini you will include an [Environment] section...&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Environment]  ; Our Environment section that defines the shell variables we are interested in&lt;br /&gt;
RT_ZONE=&amp;quot;&amp;quot;     ; We might use a zone to setup an instance of OpenSim on a server  &lt;br /&gt;
HOSTNAME=&amp;quot;&amp;quot; ; We might be interested in obtaining the host's name &lt;br /&gt;
&lt;br /&gt;
[Startup]&lt;br /&gt;
regionload_regionsdir=/home/opensim/etc/Regions/${Environment|RT_ZONE}/   ; We set our regionload_regionsdir using the variables&lt;br /&gt;
ConsolePrompt = &amp;quot;${Environment|HOSTNAME}:${Environment|RT_ZONE} &amp;quot;&lt;br /&gt;
&lt;br /&gt;
[DatabaseService]&lt;br /&gt;
ConnectionString = &amp;quot;Data Source=localhost;Database=${Environment|RT_ZONE};User ID=username;Password=userpass;&amp;quot; ; Here too&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When OpenSim picks up the variables in your shell and processes all the configurations, the variable keys will be filled in with the variables picked up from the shell ...&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Environment]  ; Our Environment section that defines the shell variables we are interested in&lt;br /&gt;
RT_ZONE=&amp;quot;&amp;quot;     ; We might use a zone to setup an instance of OpenSim on a server  &lt;br /&gt;
HOSTNAME=&amp;quot;&amp;quot; ; We might be interested in obtaining the host's name &lt;br /&gt;
&lt;br /&gt;
[Startup]&lt;br /&gt;
regionload_regionsdir=/home/opensim/etc/Regions/Zone_00/   ; We set our regionload_regionsdir using the variables&lt;br /&gt;
ConsolePrompt = &amp;quot;OSERV_00:Zone_09 &amp;quot;&lt;br /&gt;
&lt;br /&gt;
[DatabaseService]&lt;br /&gt;
ConnectionString = &amp;quot;Data Source=localhost;Database=Zone_00;User ID=username;Password=userpass;&amp;quot; ; Here too&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a pretty good start. I think there will be a couple of places we might be able to use this to help us setup really flexible configuration systems for OpenSim. &lt;br /&gt;
&lt;br /&gt;
Have Fun!&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>