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.
TeleportWork
Justin Clark-Casey (justincc) 2013-08-05 23:44:48 +01:00
parent f9dc5815c4
commit 9bcf072795
3 changed files with 74 additions and 5 deletions

View File

@ -156,7 +156,27 @@ namespace OpenSim.Framework.Console
} }
/// <summary> /// <summary>
/// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 /// Convert a console integer to an int, automatically complaining if a console is given.
/// </summary>
/// <param name='console'>Can be null if no console is available.</param>
/// <param name='rawConsoleVector'>/param>
/// <param name='vector'></param>
/// <returns></returns>
public static bool TryParseConsoleBool(ICommandConsole console, string rawConsoleString, out bool b)
{
if (!bool.TryParse(rawConsoleString, out b))
{
if (console != null)
console.OutputFormat("ERROR: {0} is not a true or false value", rawConsoleString);
return false;
}
return true;
}
/// <summary>
/// Convert a console integer to an int, automatically complaining if a console is given.
/// </summary> /// </summary>
/// <param name='console'>Can be null if no console is available.</param> /// <param name='console'>Can be null if no console is available.</param>
/// <param name='rawConsoleVector'>/param> /// <param name='rawConsoleVector'>/param>

View File

@ -256,6 +256,12 @@ namespace OpenSim.Framework.Servers
"Show thread status. Synonym for \"show threads\"", "Show thread status. Synonym for \"show threads\"",
(string module, string[] args) => Notice(GetThreadsReport())); (string module, string[] args) => Notice(GetThreadsReport()));
m_console.Commands.AddCommand (
"Debug", false, "debug comms set",
"debug comms set serialosdreq true|false",
"Set comms parameters. For debug purposes.",
HandleDebugCommsSet);
m_console.Commands.AddCommand ( m_console.Commands.AddCommand (
"Debug", false, "debug threadpool set", "Debug", false, "debug threadpool set",
"debug threadpool set worker|iocp min|max <n>", "debug threadpool set worker|iocp min|max <n>",
@ -284,11 +290,42 @@ namespace OpenSim.Framework.Servers
public void RegisterCommonComponents(IConfigSource configSource) public void RegisterCommonComponents(IConfigSource configSource)
{ {
IConfig networkConfig = configSource.Configs["Network"];
if (networkConfig != null)
{
WebUtil.SerializeOSDRequestsPerEndpoint = networkConfig.GetBoolean("SerializeOSDRequests", false);
}
m_serverStatsCollector = new ServerStatsCollector(); m_serverStatsCollector = new ServerStatsCollector();
m_serverStatsCollector.Initialise(configSource); m_serverStatsCollector.Initialise(configSource);
m_serverStatsCollector.Start(); m_serverStatsCollector.Start();
} }
private void HandleDebugCommsSet(string module, string[] args)
{
if (args.Length != 5)
{
Notice("Usage: debug comms set serialosdreq true|false");
return;
}
if (args[3] != "serialosdreq")
{
Notice("Usage: debug comms set serialosdreq true|false");
return;
}
bool setSerializeOsdRequests;
if (!ConsoleUtil.TryParseConsoleBool(m_console, args[4], out setSerializeOsdRequests))
return;
WebUtil.SerializeOSDRequestsPerEndpoint = setSerializeOsdRequests;
Notice("serialosdreq is now {0}", setSerializeOsdRequests);
}
private void HandleDebugThreadpoolSet(string module, string[] args) private void HandleDebugThreadpoolSet(string module, string[] args)
{ {
if (args.Length != 6) if (args.Length != 6)

View File

@ -66,6 +66,11 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
public static int RequestNumber { get; internal set; } public static int RequestNumber { get; internal set; }
/// <summary>
/// Control where OSD requests should be serialized per endpoint.
/// </summary>
public static bool SerializeOSDRequestsPerEndpoint { get; set; }
/// <summary> /// <summary>
/// this is the header field used to communicate the local request id /// this is the header field used to communicate the local request id
/// used for performance and debugging /// used for performance and debugging
@ -145,10 +150,17 @@ namespace OpenSim.Framework
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed) public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
{ {
//lock (EndPointLock(url)) if (SerializeOSDRequestsPerEndpoint)
//{ {
lock (EndPointLock(url))
{
return ServiceOSDRequestWorker(url, data, method, timeout, compressed); return ServiceOSDRequestWorker(url, data, method, timeout, compressed);
//} }
}
else
{
return ServiceOSDRequestWorker(url, data, method, timeout, compressed);
}
} }
public static void LogOutgoingDetail(Stream outputStream) public static void LogOutgoingDetail(Stream outputStream)