I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of my
applications in particular is used more than the others. Since updating 2
applications, I have had problems on the event log of the servers, following
stopping of the aspnet_ws.exe process.
Something is causing the following error in the windows application event log:
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. The following
information is part of the event: .NET Runtime version 1.1.4322.2032- Setup
Error: Failed to load resources from resource file
This is usually followed by the crashing of the aspnet_ws.exe process, which
will crash all users that are in any application on the server. This happens
about 3-8 times per day, at random times, with an absolute unknown cause for
this.
I have searched all over the net for help on this error, and I cannot find a
single answer that will fix this. I am thinking it is is something in my
code, but what is odd is that this error does NOT happen at anytime on our
test server or my local computer that uses the same application.
We test the application constantly on the test server, and no matter what,
the log never receives this error. It is possible that the reason for this
is the higher load on our production servers. There are usually 85 - 100
users simultaneously hitting the box.
Here is an example of the new stuff that has been added since I have been
starting to get that error. (Prior to adding this code, I have never seen
this error in the log.)
Code:
Imports System.Threading
Public Sub PostDocument
Dim ThreadPost As New Thread(New ThreadStart(AddressOf ExecutePost))
ThreadPost.Priority = ThreadPriority.Lowest
ThreadPost.Start()
End Sub
Public Sub ExecutePost()
Dim mut As Mutex = New Mutex
mut.WaitOne()
Try
Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password,
Token)
oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8")
Catch ex As Exception
Finally
mut.ReleaseMutex()
End Try
End Sub
All of the above code works correctly in test, and production too. I am just
wondering if excessive use of any of the above at simultaneous times could
cause problems? Is there something I need to do to the server to handle the
Threading? Am I forgetting another step that will cause a problem on the
server?
I am using threading because the response time was very slow on our servers,
so I do not wait for a response. Its a new method I chose, and works
excellent, however, now the servers are still receiving that above message,
and the Memory usage does not even exceed 300K, whereas in the past, it used
to go all the way up to 900K when it crashed.
This is a major problem, and needs to be resolved fast.
Any help would be greatly appreciated. Thank you.
- Vincent 5 4538
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com... I have a load balanced system that consists of 3 production servers. There are about 20 different applications that are used on these boxes. One of my applications in particular is used more than the others. Since updating 2 applications, I have had problems on the event log of the servers, following stopping of the aspnet_ws.exe process.
Something is causing the following error in the windows application event log:
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: .NET Runtime version 1.1.4322.2032- Setup Error: Failed to load resources from resource file
This is usually followed by the crashing of the aspnet_ws.exe process, which will crash all users that are in any application on the server. This happens about 3-8 times per day, at random times, with an absolute unknown cause for this.
I have searched all over the net for help on this error, and I cannot find a single answer that will fix this. I am thinking it is is something in my code, but what is odd is that this error does NOT happen at anytime on our test server or my local computer that uses the same application.
We test the application constantly on the test server, and no matter what, the log never receives this error. It is possible that the reason for this is the higher load on our production servers. There are usually 85 - 100 users simultaneously hitting the box.
Here is an example of the new stuff that has been added since I have been starting to get that error. (Prior to adding this code, I have never seen this error in the log.)
Code:
Where is this code being executed from? You mentioned aspnet_wp, so, is this
being executed from an ASP.NET application?
Imports System.Threading
Public Sub PostDocument Dim ThreadPost As New Thread(New ThreadStart(AddressOf ExecutePost)) ThreadPost.Priority = ThreadPriority.Lowest ThreadPost.Start() End Sub
Public Sub ExecutePost() Dim mut As Mutex = New Mutex mut.WaitOne() Try Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password, Token) oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8") Catch ex As Exception
Why in the world would you want to eat every exception that this code might
possibly throw? Especially when you tell us you're getting crashes?
How about at least saving the exception details (from ex.ToString()) into
the event log or something?
Finally mut.ReleaseMutex() End Try End Sub
All of the above code works correctly in test, and production too. I am just wondering if excessive use of any of the above at simultaneous times could cause problems? Is there something I need to do to the server to handle the Threading? Am I forgetting another step that will cause a problem on the server?
Have you looked at the performance counters to see how many threads are
being used?
John Saunders
> > "Where is this code being executed from? You mentioned aspnet_wp, so, is
this being executed from an ASP.NET application?"
-- yes, this code is being executed from an asp.net web application "Why in the world would you want to eat every exception that this code might
possibly throw? Especially when you tell us you're getting crashes? How
about at least saving the exception details (from ex.ToString()) into the
event log or something?"
-- I agree, that is a good suggestion, and I will add that to my code. I
may write the exception to a text file though so I can seperate the errors
from the event log.
"Have you looked at the performance counters to see how many threads are
being used?"
-- I am looking at the perfmon, but by looking at the thread monitor, I do
not know what to look for. I am not familiar with the type of settings that
are required on the server to handle threads from multiple users accessing
the same application simultaneously. I will keep an eye on the thread
monitor, and see if any of that information helps at all. Is there something
on the server I need to adjust based on the level of users that hit this
thread? Perhaps machine.config, or web.config in the application? Do you see
anything in my code that could cause such an error from occurring in the
application event log? Thank you
-Vincent
--------------------------------------------------------------------
"John Saunders" wrote:
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message news:00**********************************@microsof t.com...I have a load balanced system that consists of 3 production servers. There are about 20 different applications that are used on these boxes. One of my applications in particular is used more than the others. Since updating 2 applications, I have had problems on the event log of the servers, following stopping of the aspnet_ws.exe process.
Something is causing the following error in the windows application event log:
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: .NET Runtime version 1.1.4322.2032- Setup Error: Failed to load resources from resource file
This is usually followed by the crashing of the aspnet_ws.exe process, which will crash all users that are in any application on the server. This happens about 3-8 times per day, at random times, with an absolute unknown cause for this.
I have searched all over the net for help on this error, and I cannot find a single answer that will fix this. I am thinking it is is something in my code, but what is odd is that this error does NOT happen at anytime on our test server or my local computer that uses the same application.
We test the application constantly on the test server, and no matter what, the log never receives this error. It is possible that the reason for this is the higher load on our production servers. There are usually 85 - 100 users simultaneously hitting the box.
Here is an example of the new stuff that has been added since I have been starting to get that error. (Prior to adding this code, I have never seen this error in the log.)
Code:
Where is this code being executed from? You mentioned aspnet_wp, so, is this being executed from an ASP.NET application?
Imports System.Threading
Public Sub PostDocument Dim ThreadPost As New Thread(New ThreadStart(AddressOf ExecutePost)) ThreadPost.Priority = ThreadPriority.Lowest ThreadPost.Start() End Sub
Public Sub ExecutePost() Dim mut As Mutex = New Mutex mut.WaitOne() Try Dim oHB As New HostBridgeLink(gsURL, "F400", UserID, Password, Token) oHB.ExecCmdWithData("PF10", "WEBIND=Y") : oHB.ExecCmd("PF8") Catch ex As Exception
Why in the world would you want to eat every exception that this code might possibly throw? Especially when you tell us you're getting crashes?
How about at least saving the exception details (from ex.ToString()) into the event log or something?
Finally mut.ReleaseMutex() End Try End Sub
All of the above code works correctly in test, and production too. I am just wondering if excessive use of any of the above at simultaneous times could cause problems? Is there something I need to do to the server to handle the Threading? Am I forgetting another step that will cause a problem on the server?
Have you looked at the performance counters to see how many threads are being used?
John Saunders
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com... > "Where is this code being executed from? You mentioned aspnet_wp, so, > is this being executed from an ASP.NET application?"
-- yes, this code is being executed from an asp.net web application
You have to be very careful when using multiple threads in an ASP.NET
appliction. More careful than in other applications. This is because, if you
start a thread during a request, chances are that the request will have
completed before the thread completes. This may leave the thread accessing
invalid data and disposed objects. > "Why in the world would you want to eat every exception that this code > might possibly throw? Especially when you tell us you're getting crashes? How about at least saving the exception details (from ex.ToString()) into the event log or something?"
-- I agree, that is a good suggestion, and I will add that to my code. I may write the exception to a text file though so I can seperate the errors from the event log.
Take a look at System.Diagnostics.EventLog. You'll see that you can write
the errors under their own event source. > "Have you looked at the performance counters to see how many threads > are
being used?"
-- I am looking at the perfmon, but by looking at the thread monitor, I do not know what to look for. I am not familiar with the type of settings that are required on the server to handle threads from multiple users accessing the same application simultaneously. I will keep an eye on the thread monitor, and see if any of that information helps at all. Is there something on the server I need to adjust based on the level of users that hit this thread? Perhaps machine.config, or web.config in the application? Do you see anything in my code that could cause such an error from occurring in the application event log? Thank you
The performance counter I was talking about is simply the number of threads.
John Saunders
John,
I run this code over 100 times on our test servers and not one time did I
encounter this error. Evidentally, the code works correctly. The only
difference of our test server and our production server is the volume of
users that are executing the code simultaneously. If what you said is true,
what would I do to fix this? Is there a way to prevent destruction of
objects prior ot completion of the thread? Everywhere I look on the internet
and in books, my threading code is correct as is. Is there something I need
to do to fix this on the server or in the code?
I was considering calling Microsoft to help us fix this. This is a major
problem that has just recently started to happen, but I was hoping I could
get answers through this message board prior to calling up microsoft. Would
you suggest that I call Microsoft? Thank you -Vincent
"John Saunders" wrote: "VinnieT" <Vi*****@discussions.microsoft.com> wrote in message news:C9**********************************@microsof t.com... > "Where is this code being executed from? You mentioned aspnet_wp, so, > is this being executed from an ASP.NET application?"
-- yes, this code is being executed from an asp.net web application
You have to be very careful when using multiple threads in an ASP.NET appliction. More careful than in other applications. This is because, if you start a thread during a request, chances are that the request will have completed before the thread completes. This may leave the thread accessing invalid data and disposed objects.
> "Why in the world would you want to eat every exception that this code > might possibly throw? Especially when you tell us you're getting crashes? How about at least saving the exception details (from ex.ToString()) into the event log or something?"
-- I agree, that is a good suggestion, and I will add that to my code. I may write the exception to a text file though so I can seperate the errors from the event log.
Take a look at System.Diagnostics.EventLog. You'll see that you can write the errors under their own event source.
> "Have you looked at the performance counters to see how many threads > are being used?"
-- I am looking at the perfmon, but by looking at the thread monitor, I do not know what to look for. I am not familiar with the type of settings that are required on the server to handle threads from multiple users accessing the same application simultaneously. I will keep an eye on the thread monitor, and see if any of that information helps at all. Is there something on the server I need to adjust based on the level of users that hit this thread? Perhaps machine.config, or web.config in the application? Do you see anything in my code that could cause such an error from occurring in the application event log? Thank you
The performance counter I was talking about is simply the number of threads.
John Saunders
"VinnieT" <Vi*****@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com... John,
I run this code over 100 times on our test servers and not one time did I encounter this error. Evidentally, the code works correctly.
Where a multithreaded program is concerned, the repeated success of a test
is not a good measure of code correctness. I've seem problems which
literally could not be reproduced except on 8-CPU systems! You could try
forever on a 4-CPU system and you would never reproduce the problem.
The only difference of our test server and our production server is the volume of users that are executing the code simultaneously.
Do they both use identical hardware? Especially number of CPUs and amount of
physical memory? If disk I/O is involved at all, do they both have the same
disks on the same disk controllers with similar levels of fragmentation?
Murphy wrote his famous Law to warn about multithreaded applications. Any
sequence of events which is not impossible will happen. Much of the "trick"
of programming threads involves making unfortunate things impossible through
synchronization.
If what you said is true, what would I do to fix this? Is there a way to prevent destruction of objects prior ot completion of the thread? Everywhere I look on the internet and in books, my threading code is correct as is. Is there something I need to do to fix this on the server or in the code?
Yes. Don't use Threading in ASP.NET applications.
Did I post this link before?
The ASP.NET Page Object Model
(http://msdn.microsoft.com/library/de...asp?frame=true)
And if I posted it, did you read it? An ASP.NET application follows a
fundamentally different lifecycle than, say, a Windows Forms application or
even a Windows Service. The HttpContext and all it references, the Page and
all it references do not belong to you. In particular, you do not have
control over their lifecycle. When the request is over, the resources
associated with it should be considered to be invalid.
I was considering calling Microsoft to help us fix this. This is a major problem that has just recently started to happen, but I was hoping I could get answers through this message board prior to calling up microsoft. Would you suggest that I call Microsoft? Thank you -Vincent
No, I'd suggest that you either re-engineer your code with an understanding
of the ASP.NET page object model, or else move this troublesome code out of
ASP.NET. There's nothing wrong with an ASP.NET application queueing a
request to a server application which would have this multithreaded code in
it.
John Saunders
P.S. This may not actually be the source of your problem. Moving the
multithreaded code out to a separate process would be one way to confirm
this. If it works in a separate process, then perhaps the problem was the
process it was running in (aspnet_wp).
Another way would be to have the ASP.NET code wait for the completion of all
the threads. This won't work in production, but might be a useful diagnostic
technique. If it works when the page waits for completion, then maybe the
problem was that the code requires the page in order to work correctly. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hemant |
last post by:
Why i am getting this error.
Server Error in '/' Application
Runtime error
Please help me out.
Thank you
|
by: m11533 |
last post by:
I have written an application that runs as a subprocess of a service, where the service is a .NET C# Windows Service that simply starts the...
|
by: Damian |
last post by:
Hi everyone
I'm having an issue with one of our applications. I'm getting the
following error when attempting to log in to the site:
Server...
|
by: Kevin Farless |
last post by:
Hi all,
I'm having trouble viewing any .aspx pages on my hosting company's server.
The server is a new box running Windows Server 2003 default...
|
by: Rich Wallace |
last post by:
Hi all,
I have a VB app that runs and manages individual XLS files within a single
COM object. Upon processing the final fie, I attempt to close...
|
by: VinnieT |
last post by:
I have a load balanced system that consists of 3 production servers. There
are about 20 different applications that are used on these boxes. One of...
|
by: David Lozzi |
last post by:
Howdy,
I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel
and Geoffrey LeBlond. Anyway, they have some instructions on...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| | |