04-18-2023, 08:17 PM
(This post was last modified: 04-18-2023, 10:26 PM by Alexandre Machado.)
I found this situation many times helping other users. I can say without any doubt that every time there was a logical reason and it was hidden somewhere in the code. Sometimes in the application itself, sometimes in 3rd party code (some report generators are especially "good" at it)
First thing when trying to solve this kind of situation is getting everything that is wrong fixed.
Once I helped a customer and he granted me access to his production environment. I was shocked to know that his exception log folder contained literally hundreds of exception logs clearly showing programming errors like "DataSet not in edit or insert mode", and even SQL errors. There were also memory leaks. We first reduced the exceptions to only what is expected (e.g. session timeouts and unsupported browsers) and what is really an exceptional circumstance (e.g. a database connection failure). In the end, the problem was being caused by updating a global var string from multiple threads which would cause the whole application to crash.
Having said that:
1- is your service Indy-based or Http.sys-based?
2- How many active sessions when this thing happens?
3- Is your exception logger enabled? Are there hundreds of exceptions going on all the time?
4- When the service stops responding: Does the Windows service console shows the service as running or stopped? Did you check the Windows event log for any event when the service stopped? How is the CPU usage at that point? Does it seem to be idle or hitting 100% for some or all cores? If the service is still running, how task manager shows it regarding memory and CPU?
5- Do you have any 3rd party components like report generators?
6- Are you using a connection pool or direct DB access for each session?
PS:
7- Did you extensively check your application for memory leaks? I don't think memory leaks cause this kind of issue (it causes a different issue, though) but memory leaks usually reveal many other problems with the code
First thing when trying to solve this kind of situation is getting everything that is wrong fixed.
Once I helped a customer and he granted me access to his production environment. I was shocked to know that his exception log folder contained literally hundreds of exception logs clearly showing programming errors like "DataSet not in edit or insert mode", and even SQL errors. There were also memory leaks. We first reduced the exceptions to only what is expected (e.g. session timeouts and unsupported browsers) and what is really an exceptional circumstance (e.g. a database connection failure). In the end, the problem was being caused by updating a global var string from multiple threads which would cause the whole application to crash.
Having said that:
1- is your service Indy-based or Http.sys-based?
2- How many active sessions when this thing happens?
3- Is your exception logger enabled? Are there hundreds of exceptions going on all the time?
4- When the service stops responding: Does the Windows service console shows the service as running or stopped? Did you check the Windows event log for any event when the service stopped? How is the CPU usage at that point? Does it seem to be idle or hitting 100% for some or all cores? If the service is still running, how task manager shows it regarding memory and CPU?
5- Do you have any 3rd party components like report generators?
6- Are you using a connection pool or direct DB access for each session?
PS:
7- Did you extensively check your application for memory leaks? I don't think memory leaks cause this kind of issue (it causes a different issue, though) but memory leaks usually reveal many other problems with the code

