473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

C#: resource leaks using System.Messaging (MSMQ) from an ASP.NET application

We are seeing some kind of resource leak in our performance lab running an ASP.NET (2.0) application that sends and receives messages from 2 public MSMQ queues. Here's a brief summary of what are application does:

1. user provides input on a form on an aspx page and clicks continues
2. on postback, the page creates a c# .net object and calls a method on it to process the data provided by the user
3. the object in turns creates an MessageQueue object and uses it to send a message to an MSMQ queue. It then creates another MessageQueue object to receive a response message from a different queue. our object does not use events or callbacks. It calls ReceiveByCorrelationId to get its message back.
4. our code calls close and dispose on all queues and messages as soon as they are not needed anymore.
5. because of legacy code and need for backwards compatibility, we use the activeX formatter for the outgoing and incoming MSMQ message.

about our setup:
* our app runs on a win2k advanced server.
* the queues are on a separate server also running win2k
* the DC is yet on another server also running win2k
* all servers are on the same LAN and run MSMQ 2.0

When we run our application in our performance lab using a stress test tool, we are seeing the following behavior:
1. everything runs fine and fast until about 30 to 40 minutes into the test (9 minutes into the test, all test users are fully in the test executing all steps of the test script ). Then we see a huge slow down in response times and after a while aspnet_exe restarts. from that point on, the app never truly recovers and runs slow.
2. we have run TMQ STATE at various times during the test and see a constant increase in the number of handles and threads during the test. For example, TMQ state reports that at 15 minutes into the test, the number of threads is 49 and the number of handles is 383. At 41 minutes into the test the number of threads is 68 and the number of handles is 560.
3. we run only 40 test users during the test so at most there are only 40 concurrent calls happening to MSMQ.
4. The Pool Paged Bytes memory perf counter is creeping up during the test but only from 40 MB to 45 MB or so.
5. There are no MSMQ errors in the event log
6. after the problem occurs, our app logs a number of MSMQ timeout errors indicating that it did not get a response message within a given amount of time (set at 100 seconds for this test)
7. if we run a similar script that does not make calls to MSMQ, we do not see this problem.
8. we turned MSMQ logging on and see many errors/events being recorded in the log during the test

These numbers seems to indicate to me that we are (1) leaking some resource related to MSMQ and (2) that we hit a threshold for this resource 30 to 35 minutes into the test.

We have captured a bunch of other counters and data that we can share if this would help. Note that we have read all MSDN and forum posts related to MSMQ and resources, but none are helping (our messages our way less than 4 MB in size, we don't use callbacks, we don't get a "insufficient resources" error, etc.)

Does anyone have experienced similar issue? Also, does anyone know how to interpret TMQ State data (what are the "number of threads" and "number of handles" data for example) and MSMQ logs?

any help would be greatly appreciated.

~
Nov 26 '07 #1
1 4739
kenobewan
4,871 Expert 4TB
Here is an article that may help:
MSMQ from the plumber's mate
Nov 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have...
10
by: Niall | last post by:
I'm not quite sure which groups to post this to, so short of a massive crosspost, I decided on these two. I am running into troubles with resource usage of our app on Win2k and above systems. In...
3
by: S.Creek | last post by:
Hi, I am trying to build a multi clients application with C# that will send and receive messages using a listener on a server, the computers are all on the same LAN, the listener need to...
1
by: John A Grandy | last post by:
in .NET 2.0 where is the type Message located ? in .NET 1.1 it was System.Messaging.Message
14
by: Webbee | last post by:
I have a service built that is trying to read messages from a private que. When this tries to happen I get this error.... A workgroup installation computer does not support the operation From...
1
by: Anthony J. Biondo Jr. | last post by:
Hi Everyone: I was wondering if it is common practice to use some sort of messaging (MSMQ, WebSphere MQ) with web services. I understand the need for messaging for insert / update transactions,...
5
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so...
0
by: dom_perron | last post by:
Hi, I have a problem when I try to start an application using MSMQ from a Windows Service. The application runs on a server. The client send a message to a public queue created on the server,...
0
by: ASPnewb1 | last post by:
Hello, I have a question about MSMQ as I'm new to using this system in the .NET framework. Here is my following application that I run 2 instances of to test the ability to communicate...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.