Board index » delphi » CPU at 100% causing ClientSocket disconnect

CPU at 100% causing ClientSocket disconnect


2007-01-13 05:18:59 AM
delphi85
I am using Delphi 6 with BDE.
I have an application that sends data back and forth over a
non-blocking ClientSocket. Several times a day my application
detects a socket disconnect. The host site says they are not
seeing a disconnect. If the application is stopped and
restarted it continues working correctly. We have noticed
recently that the CPU usage is at 100% right before it detects a
disconnect. The memory usage is always low, a flat line.
This application has been running for years. We started
noticing this when the host site upgraded their switches. The
only difference they can see is that messages are being routed
more quickly. There is not much inactivity and we have a keep
alive every minute. I have multiple SQL queries that run every
.10 seconds as well as many other queries, inserts and updates.
Any ideas what could cause this? Is there something I can put
in my program to releave the CPU utilization?
Thanks for you assistance.
 
 

Re:CPU at 100% causing ClientSocket disconnect

Thought I'd try again since I haven't gotten any responses.
My program is going into the ClientSocket1.OnDisconnect event.
The host says that they are not disconnecting. What could
possibly cause this event to trigger? The program will
reconnect and continue without problem most of the time.
This happens several times a day.
Once every few days it will just lock and have to be restarted.
I believe this is where it runs into the CPU at 100%.
Ideas?
"Angela Bodnar" <XXXX@XXXXX.COM>writes:
Quote

I am using Delphi 6 with BDE.
I have an application that sends data back and forth over a
non-blocking ClientSocket. Several times a day my application
detects a socket disconnect. The host site says they are not
seeing a disconnect. If the application is stopped and
restarted it continues working correctly. We have noticed
recently that the CPU usage is at 100% right before it detects a
disconnect. The memory usage is always low, a flat line.
This application has been running for years. We started
noticing this when the host site upgraded their switches. The
only difference they can see is that messages are being routed
more quickly. There is not much inactivity and we have a keep
alive every minute. I have multiple SQL queries that run every
.10 seconds as well as many other queries, inserts and updates.
Any ideas what could cause this? Is there something I can put
in my program to releave the CPU utilization?
Thanks for you assistance.


 

Re:CPU at 100% causing ClientSocket disconnect

"Angela Bodnar" <XXXX@XXXXX.COM>writes
Quote
Thought I'd try again since I haven't gotten any responses.
You didn't really provide very many details the first time around, and
you just repeated what you said without adding anything new to it.
It would help if you would actually show your code. You are probably
overloading the socket, or blowing up a thread, or something like
that. Especially since you are seeing 100% CPU usage. That in itself
a usually a good indicator of a runaway thread.
Gambit
 

Re:CPU at 100% causing ClientSocket disconnect

I really didn't think you wanted to see thousands of lines of
code from me. I was just trying to find out if there was a
known problem of this type. I am not even sure if the CPU is
at 100% everytime. It was just noticed by the operator.
Sometimes the program will recover itself and reconnect after
sensing a disconnect. Sometimes it can't recover and this
is ususally accompanied with a socket error 10053 or 10054.
What could possibly cause "overloading the socket" or
"blowing up a thread"?
Thanks.
"Remy Lebeau \(TeamB\)" <XXXX@XXXXX.COM>writes:
Quote

"Angela Bodnar" <XXXX@XXXXX.COM>writes
news:45af92e7$XXXX@XXXXX.COM...

>Thought I'd try again since I haven't gotten any responses.

You didn't really provide very many details the first time around, and
you just repeated what you said without adding anything new to it.

It would help if you would actually show your code. You are probably
overloading the socket, or blowing up a thread, or something like
that. Especially since you are seeing 100% CPU usage. That in itself
a usually a good indicator of a runaway thread.


Gambit


 

Re:CPU at 100% causing ClientSocket disconnect

"Angela Bodnar" <XXXX@XXXXX.COM>writes
Quote
I really didn't think you wanted to see thousands of lines of
code from me.
I don't. Which is why you need to trim it down to the most bare-bones
eample you can that still reproduces the same problem.
Quote
I was just trying to find out if there was a known problem of this
type.
This is not a socket problem. A socket does not use the CPU that
hard. Which is why I suspect your own code is faulty somewhere.
Quote
Sometimes the program will recover itself and reconnect after
sensing a disconnect. Sometimes it can't recover and this
is ususally accompanied with a socket error 10053 or 10054.
Those are normal errors for a socket that was abnormally disconected.
Gambit