Home All Groups Group Topic Archive Search About

MSMQ Distributed Transaction Coordinator

Author
7 Feb 2007 5:55 PM
Andy Furnival
Hi clever people,

Does anyone know whether or not when using Transaction with MSMQ, does it
use DTC within the Windows API (not within the Managed .Net Framework) or its
own internal transaction management.

The reason I ask is that  I built a MSMQ distribution service that
distributes messages.  In develpment using Transactions like the code below I
could see results of 400+ messages per second to queues locally and on the
network (Workgroup mode).  WHen I placed the same service onto a Windows R2
x64 Server with 16 processors I was lucky to achieve 80-100 messages per
second working to only local queues.  After I restarted MS DTC (after a
hunch) I saw vast improvement to 300 messages per second but I expect that
the server should be able to run much much faster than my development PC.

Let me elaborate in code what i did.  (I didnt copy paste from a IDE so may
not compile if you attempt to run it)

using System.Messaging;
namespace MSMQ{
public class MQExample{
  public MQExample()
  {
   MessageQueue queue = new MessageQueue(".\private$\myQueue");
   MessageQueueTransaction qt = new MessageQueueTransaction();

   qt.Begin();

   queue.Send("Using MessageQueueTransaction", qt); // Does this use DTC?
   // This next way does not use DTC for sure
   queue.Send("Using internal transaction",
MessageQueueTransactionType.Single);

   qt.Commit();
   queue.Close();
  }
}
}

Any ideas, or explanations of performance issues on Windows Server 2003 x64
(and x86 too) with MSMQ with .net 2 ( and 1.1) or why I would get such poor
results.  I've run MQBench on the server and it can send and receive in
accordence to the guidelines from MS so I suspect a .net.

Any help would be much appreciated

Thanks

Andy

AddThis Social Bookmark Button