EldoS | Feel safer!

Software components for data protection, secure storage and transfer

100% CPU after a few hours

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#3825
Posted: 09/20/2007 11:18:00
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

Hi Again, Im getting this issue after a few hours running my program where it is using 100% CPU (50% on dual core). The CPU Usage is being caused by the 100's of exceptions being thrown per minute by MsgConnect,
I traced it back to this sub in MsgConnect.MCStdSocket in sub: public override int IntReceive(byte[] Data, int Offset, int DataLen, out int Received), Line 953 trapped on 956

Code
public override int IntReceive(byte[] Data, int Offset, int DataLen, out int Received)

--*CUT*--
                if (State != MCSocketState.issConnected)
                    throw new MCError(MCError.WrongSocketState);

                try
                {
                    Received = FSocket_net.Receive(Data, Offset, DataLen, SocketFlags.None);
                    return 0;
                }
                ---> catch (Exception)
                {
                    Received = 0;
                    return 0;
                }


The Exception was caused by FSocket_net.EnableBroadcast or FSocket_net.MulticastLoopback, The error was:
{"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call"}

What could be wrong??.
Im using MsgConnect 1.5.7.58 Libraries and the compiled program runs on Windows Server 2003
#3827
Posted: 09/20/2007 12:35:27
by Eugene Mayevski (EldoS Corp.)

1) What transport are you using?
2) I am not sure that I understand your phrase about EnableBroadcast. In the code piece that you've quoted there's no place for EnableBroadcast. Where does it come from?


Sincerely yours
Eugene Mayevski
#3834
Posted: 09/21/2007 03:29:29
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

OK then,
1) Im using the MCSocketTransport
2) I'll try and be a little more specific.

In MCSock.cs
Line 956 is catching an error. although it does not say what the error is. (Maybe because I don't know C# :D)
but if I hover over FSocket_net intellisense tells me that the two properties:
EnableBroadcast and MulticastLoopback have the value of:
Code
"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call"

I don't know if this is related or not but something in that try catch block is causing 100's of exceptions per minute.
#3842
Posted: 09/21/2007 09:57:33
by Eugene Mayevski (EldoS Corp.)

No, Intellisense reports completely different thing. It attempts to call the reader methods for those properties, and those methods raise exception. The problem must be somewhere else.

I think the system either runs out of socket handles or something like this.

If you have the source code, you can modify it a bit:

catch (Exception e)
{
Debug.Print(e.Message); // works in .NET 2.0 only
Received = 0;
return 0;
}

This will give you an exception text printed in Debug / Output window of the IDE. Of course, you can as well put MessageBox.Show(e.Message) instead of Debug.Print.

Remember that in both cases you will need to add "using" clause to reference the needed namespaces.


Sincerely yours
Eugene Mayevski
#4175
Posted: 10/30/2007 04:08:39
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

OK Long time no response.
I finally got it to happen again,
The error is:
Code
Existing Connection was forcibly closed by remote host
ComPlus Error -532459699

Info: Process had 291 Threads, 3936 Handles and had been running for 14 Days
And I had 30 Active connections.

I Have attached a list of threads so you can see more clearly just what threads are running.

From my perspective it looks as if when connections are timing out/disconnected, the threads are not being
destroyed properly and are still running.

Just imaginge 250 Threads all throwing the same exception :( = 100% Usage (50%~60% on dual core)


[ Download ]
#4183
Posted: 10/31/2007 03:21:51
by Eugene Mayevski (EldoS Corp.)

It looks like the disconnection is not handled properly in the above case. I will review the code and get back to you then.


Sincerely yours
Eugene Mayevski
#4185
Posted: 10/31/2007 05:07:09
by Eugene Mayevski (EldoS Corp.)

Please use this private build. If it solves the problem, I will place it as a public version.


Sincerely yours
Eugene Mayevski
#4587
Posted: 12/27/2007 19:38:06
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

OK After a good trial run it looks good, 36 days constant uptime and not a single fault :)

Thanks Eugene

Regards Adam.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 6390 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!