aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-05 23:44:48 +0100
committerJustin Clark-Casey (justincc)2013-08-05 23:44:48 +0100
commit9bcf07279513294d58c3076e7d8a6eb5ee64c759 (patch)
tree97a5a1c77382461d840315c9f016008d0e13817c
parentFor LLImageManagerTests, make tests execute under synchronous fire and forget... (diff)
downloadopensim-SC_OLD-9bcf07279513294d58c3076e7d8a6eb5ee64c759.zip
opensim-SC_OLD-9bcf07279513294d58c3076e7d8a6eb5ee64c759.tar.gz
opensim-SC_OLD-9bcf07279513294d58c3076e7d8a6eb5ee64c759.tar.bz2
opensim-SC_OLD-9bcf07279513294d58c3076e7d8a6eb5ee64c759.tar.xz
Make it possible to switch whether we serialize osd requests per endpoint or not, either via config (SerializeOSDRequests in [Network]) or via the "debug comms set" console command.
For debug purposes to assess what impact this has on network response in a heavy test environment.
-rw-r--r--OpenSim/Framework/Console/ConsoleUtil.cs22
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs37
-rw-r--r--OpenSim/Framework/WebUtil.cs20
3 files changed, 74 insertions, 5 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
index 97a86a8..c0ff454 100644
--- a/OpenSim/Framework/Console/ConsoleUtil.cs
+++ b/OpenSim/Framework/Console/ConsoleUtil.cs
@@ -156,7 +156,27 @@ namespace OpenSim.Framework.Console
156 } 156 }
157 157
158 /// <summary> 158 /// <summary>
159 /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 159 /// Convert a console integer to an int, automatically complaining if a console is given.
160 /// </summary>
161 /// <param name='console'>Can be null if no console is available.</param>
162 /// <param name='rawConsoleVector'>/param>
163 /// <param name='vector'></param>
164 /// <returns></returns>
165 public static bool TryParseConsoleBool(ICommandConsole console, string rawConsoleString, out bool b)
166 {
167 if (!bool.TryParse(rawConsoleString, out b))
168 {
169 if (console != null)
170 console.OutputFormat("ERROR: {0} is not a true or false value", rawConsoleString);
171
172 return false;
173 }
174
175 return true;
176 }
177
178 /// <summary>
179 /// Convert a console integer to an int, automatically complaining if a console is given.
160 /// </summary> 180 /// </summary>
161 /// <param name='console'>Can be null if no console is available.</param> 181 /// <param name='console'>Can be null if no console is available.</param>
162 /// <param name='rawConsoleVector'>/param> 182 /// <param name='rawConsoleVector'>/param>
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index 0545bea..824c7e2 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -257,6 +257,12 @@ namespace OpenSim.Framework.Servers
257 (string module, string[] args) => Notice(GetThreadsReport())); 257 (string module, string[] args) => Notice(GetThreadsReport()));
258 258
259 m_console.Commands.AddCommand ( 259 m_console.Commands.AddCommand (
260 "Debug", false, "debug comms set",
261 "debug comms set serialosdreq true|false",
262 "Set comms parameters. For debug purposes.",
263 HandleDebugCommsSet);
264
265 m_console.Commands.AddCommand (
260 "Debug", false, "debug threadpool set", 266 "Debug", false, "debug threadpool set",
261 "debug threadpool set worker|iocp min|max <n>", 267 "debug threadpool set worker|iocp min|max <n>",
262 "Set threadpool parameters. For debug purposes.", 268 "Set threadpool parameters. For debug purposes.",
@@ -284,11 +290,42 @@ namespace OpenSim.Framework.Servers
284 290
285 public void RegisterCommonComponents(IConfigSource configSource) 291 public void RegisterCommonComponents(IConfigSource configSource)
286 { 292 {
293 IConfig networkConfig = configSource.Configs["Network"];
294
295 if (networkConfig != null)
296 {
297 WebUtil.SerializeOSDRequestsPerEndpoint = networkConfig.GetBoolean("SerializeOSDRequests", false);
298 }
299
287 m_serverStatsCollector = new ServerStatsCollector(); 300 m_serverStatsCollector = new ServerStatsCollector();
288 m_serverStatsCollector.Initialise(configSource); 301 m_serverStatsCollector.Initialise(configSource);
289 m_serverStatsCollector.Start(); 302 m_serverStatsCollector.Start();
290 } 303 }
291 304
305 private void HandleDebugCommsSet(string module, string[] args)
306 {
307 if (args.Length != 5)
308 {
309 Notice("Usage: debug comms set serialosdreq true|false");
310 return;
311 }
312
313 if (args[3] != "serialosdreq")
314 {
315 Notice("Usage: debug comms set serialosdreq true|false");
316 return;
317 }
318
319 bool setSerializeOsdRequests;
320
321 if (!ConsoleUtil.TryParseConsoleBool(m_console, args[4], out setSerializeOsdRequests))
322 return;
323
324 WebUtil.SerializeOSDRequestsPerEndpoint = setSerializeOsdRequests;
325
326 Notice("serialosdreq is now {0}", setSerializeOsdRequests);
327 }
328
292 private void HandleDebugThreadpoolSet(string module, string[] args) 329 private void HandleDebugThreadpoolSet(string module, string[] args)
293 { 330 {
294 if (args.Length != 6) 331 if (args.Length != 6)
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 0e9de59..706b33f 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -67,6 +67,11 @@ namespace OpenSim.Framework
67 public static int RequestNumber { get; internal set; } 67 public static int RequestNumber { get; internal set; }
68 68
69 /// <summary> 69 /// <summary>
70 /// Control where OSD requests should be serialized per endpoint.
71 /// </summary>
72 public static bool SerializeOSDRequestsPerEndpoint { get; set; }
73
74 /// <summary>
70 /// this is the header field used to communicate the local request id 75 /// this is the header field used to communicate the local request id
71 /// used for performance and debugging 76 /// used for performance and debugging
72 /// </summary> 77 /// </summary>
@@ -145,10 +150,17 @@ namespace OpenSim.Framework
145 150
146 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed) 151 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
147 { 152 {
148 //lock (EndPointLock(url)) 153 if (SerializeOSDRequestsPerEndpoint)
149 //{ 154 {
150 return ServiceOSDRequestWorker(url,data,method,timeout,compressed); 155 lock (EndPointLock(url))
151 //} 156 {
157 return ServiceOSDRequestWorker(url, data, method, timeout, compressed);
158 }
159 }
160 else
161 {
162 return ServiceOSDRequestWorker(url, data, method, timeout, compressed);
163 }
152 } 164 }
153 165
154 public static void LogOutgoingDetail(Stream outputStream) 166 public static void LogOutgoingDetail(Stream outputStream)