diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index e441cc8..5cb6a88 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -86,9 +86,9 @@ namespace OpenSim | |||
86 | if (logConfigFile != String.Empty) | 86 | if (logConfigFile != String.Empty) |
87 | { | 87 | { |
88 | XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile)); | 88 | XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile)); |
89 | m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", | 89 | m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", |
90 | logConfigFile); | 90 | logConfigFile); |
91 | } | 91 | } |
92 | else | 92 | else |
93 | { | 93 | { |
94 | XmlConfigurator.Configure(); | 94 | XmlConfigurator.Configure(); |
@@ -104,22 +104,22 @@ namespace OpenSim | |||
104 | "[OPENSIM MAIN]: Environment variable MONO_THREADS_PER_CPU is {0}", monoThreadsPerCpu ?? "unset"); | 104 | "[OPENSIM MAIN]: Environment variable MONO_THREADS_PER_CPU is {0}", monoThreadsPerCpu ?? "unset"); |
105 | 105 | ||
106 | // Verify the Threadpool allocates or uses enough worker and IO completion threads | 106 | // Verify the Threadpool allocates or uses enough worker and IO completion threads |
107 | // .NET 2.0, workerthreads default to 50 * numcores | 107 | // .NET 2.0, workerthreads default to 50 * numcores |
108 | // .NET 3.0, workerthreads defaults to 250 * numcores | 108 | // .NET 3.0, workerthreads defaults to 250 * numcores |
109 | // .NET 4.0, workerthreads are dynamic based on bitness and OS resources | 109 | // .NET 4.0, workerthreads are dynamic based on bitness and OS resources |
110 | // Max IO Completion threads are 1000 on all 3 CLRs | 110 | // Max IO Completion threads are 1000 on all 3 CLRs |
111 | // | 111 | // |
112 | // Mono 2.10.9 to at least Mono 3.1, workerthreads default to 100 * numcores, iocp threads to 4 * numcores | 112 | // Mono 2.10.9 to at least Mono 3.1, workerthreads default to 100 * numcores, iocp threads to 4 * numcores |
113 | int workerThreadsMin = 500; | 113 | int workerThreadsMin = 500; |
114 | int workerThreadsMax = 1000; // may need further adjustment to match other CLR | 114 | int workerThreadsMax = 1000; // may need further adjustment to match other CLR |
115 | int iocpThreadsMin = 1000; | 115 | int iocpThreadsMin = 1000; |
116 | int iocpThreadsMax = 2000; // may need further adjustment to match other CLR | 116 | int iocpThreadsMax = 2000; // may need further adjustment to match other CLR |
117 | 117 | ||
118 | { | 118 | { |
119 | int currentMinWorkerThreads, currentMinIocpThreads; | 119 | int currentMinWorkerThreads, currentMinIocpThreads; |
120 | System.Threading.ThreadPool.GetMinThreads(out currentMinWorkerThreads, out currentMinIocpThreads); | 120 | System.Threading.ThreadPool.GetMinThreads(out currentMinWorkerThreads, out currentMinIocpThreads); |
121 | m_log.InfoFormat( | 121 | m_log.InfoFormat( |
122 | "[OPENSIM MAIN]: Runtime gave us {0} min worker threads and {1} min IOCP threads", | 122 | "[OPENSIM MAIN]: Runtime gave us {0} min worker threads and {1} min IOCP threads", |
123 | currentMinWorkerThreads, currentMinIocpThreads); | 123 | currentMinWorkerThreads, currentMinIocpThreads); |
124 | } | 124 | } |
125 | 125 | ||
@@ -138,30 +138,30 @@ namespace OpenSim | |||
138 | m_log.InfoFormat("[OPENSIM MAIN]: Limiting max worker threads to {0}",workerThreads); | 138 | m_log.InfoFormat("[OPENSIM MAIN]: Limiting max worker threads to {0}",workerThreads); |
139 | } | 139 | } |
140 | 140 | ||
141 | // Increase the number of IOCP threads available. | 141 | // Increase the number of IOCP threads available. |
142 | // Mono defaults to a tragically low number (24 on 6-core / 8GB Fedora 17) | 142 | // Mono defaults to a tragically low number (24 on 6-core / 8GB Fedora 17) |
143 | if (iocpThreads < iocpThreadsMin) | 143 | if (iocpThreads < iocpThreadsMin) |
144 | { | 144 | { |
145 | iocpThreads = iocpThreadsMin; | 145 | iocpThreads = iocpThreadsMin; |
146 | m_log.InfoFormat("[OPENSIM MAIN]: Bumping up max IOCP threads to {0}",iocpThreads); | 146 | m_log.InfoFormat("[OPENSIM MAIN]: Bumping up max IOCP threads to {0}",iocpThreads); |
147 | } | 147 | } |
148 | // Make sure we don't overallocate IOCP threads and thrash system resources | 148 | // Make sure we don't overallocate IOCP threads and thrash system resources |
149 | if ( iocpThreads > iocpThreadsMax ) | 149 | if ( iocpThreads > iocpThreadsMax ) |
150 | { | 150 | { |
151 | iocpThreads = iocpThreadsMax; | 151 | iocpThreads = iocpThreadsMax; |
152 | m_log.InfoFormat("[OPENSIM MAIN]: Limiting max IOCP completion threads to {0}",iocpThreads); | 152 | m_log.InfoFormat("[OPENSIM MAIN]: Limiting max IOCP completion threads to {0}",iocpThreads); |
153 | } | 153 | } |
154 | // set the resulting worker and IO completion thread counts back to ThreadPool | 154 | // set the resulting worker and IO completion thread counts back to ThreadPool |
155 | if ( System.Threading.ThreadPool.SetMaxThreads(workerThreads, iocpThreads) ) | 155 | if ( System.Threading.ThreadPool.SetMaxThreads(workerThreads, iocpThreads) ) |
156 | { | 156 | { |
157 | m_log.InfoFormat( | 157 | m_log.InfoFormat( |
158 | "[OPENSIM MAIN]: Threadpool set to {0} max worker threads and {1} max IOCP threads", | 158 | "[OPENSIM MAIN]: Threadpool set to {0} max worker threads and {1} max IOCP threads", |
159 | workerThreads, iocpThreads); | 159 | workerThreads, iocpThreads); |
160 | } | 160 | } |
161 | else | 161 | else |
162 | { | 162 | { |
163 | m_log.Warn("[OPENSIM MAIN]: Threadpool reconfiguration failed, runtime defaults still in effect."); | 163 | m_log.Warn("[OPENSIM MAIN]: Threadpool reconfiguration failed, runtime defaults still in effect."); |
164 | } | 164 | } |
165 | 165 | ||
166 | // Check if the system is compatible with OpenSimulator. | 166 | // Check if the system is compatible with OpenSimulator. |
167 | // Ensures that the minimum system requirements are met | 167 | // Ensures that the minimum system requirements are met |
@@ -179,7 +179,7 @@ namespace OpenSim | |||
179 | Culture.SetCurrentCulture(); | 179 | Culture.SetCurrentCulture(); |
180 | 180 | ||
181 | // Validate that the user has the most basic configuration done | 181 | // Validate that the user has the most basic configuration done |
182 | // If not, offer to do the most basic configuration for them warning them along the way of the importance of | 182 | // If not, offer to do the most basic configuration for them warning them along the way of the importance of |
183 | // reading these files. | 183 | // reading these files. |
184 | /* | 184 | /* |
185 | m_log.Info("Checking for reguired configuration...\n"); | 185 | m_log.Info("Checking for reguired configuration...\n"); |
@@ -188,13 +188,13 @@ namespace OpenSim | |||
188 | || (File.Exists(Path.Combine(Util.configDir(), "opensim.ini"))) | 188 | || (File.Exists(Path.Combine(Util.configDir(), "opensim.ini"))) |
189 | || (File.Exists(Path.Combine(Util.configDir(), "openSim.ini"))) | 189 | || (File.Exists(Path.Combine(Util.configDir(), "openSim.ini"))) |
190 | || (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini"))); | 190 | || (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini"))); |
191 | 191 | ||
192 | bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini")); | 192 | bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini")); |
193 | bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini")); | 193 | bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini")); |
194 | bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini")); | 194 | bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini")); |
195 | bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini")); | 195 | bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini")); |
196 | 196 | ||
197 | if ((OpenSim_Ini) | 197 | if ((OpenSim_Ini) |
198 | && ( | 198 | && ( |
199 | (StanaloneCommon_ProperCased | 199 | (StanaloneCommon_ProperCased |
200 | || StanaloneCommon_lowercased | 200 | || StanaloneCommon_lowercased |
@@ -212,7 +212,7 @@ namespace OpenSim | |||
212 | "yes"); | 212 | "yes"); |
213 | if (resp == "yes") | 213 | if (resp == "yes") |
214 | { | 214 | { |
215 | 215 | ||
216 | if (!(OpenSim_Ini)) | 216 | if (!(OpenSim_Ini)) |
217 | { | 217 | { |
218 | try | 218 | try |
@@ -312,7 +312,7 @@ namespace OpenSim | |||
312 | m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); | 312 | m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); |
313 | 313 | ||
314 | // load Crash directory config | 314 | // load Crash directory config |
315 | m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); | 315 | m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); |
316 | 316 | ||
317 | if (background) | 317 | if (background) |
318 | { | 318 | { |
@@ -320,9 +320,9 @@ namespace OpenSim | |||
320 | m_sim.Startup(); | 320 | m_sim.Startup(); |
321 | } | 321 | } |
322 | else | 322 | else |
323 | { | 323 | { |
324 | m_sim = new OpenSim(configSource); | 324 | m_sim = new OpenSim(configSource); |
325 | 325 | ||
326 | m_sim.Startup(); | 326 | m_sim.Startup(); |
327 | 327 | ||
328 | while (true) | 328 | while (true) |