Alaska Software Inc. - SocketSend() how to improve performance.
Username: Password:
AuthorTopic: SocketSend() how to improve performance.
Jack DuijfSocketSend() how to improve performance.
on Tue, 17 Dec 2002 00:45:38 +0100
Hello Alaska Forum,

Currently we are using Sockets to build a client/server solution for Xbase++
application. See http://www.idep.org.uk/dbfcs/index.html to download.
The bottleneck in this is the maximum number of socketRecv() and
SocketSend() calls we can make per second.

Over a 100Mb network we can exchange around 600 datablocks of 1024 bytes per
second. This is 600Kb/s. When we use  the Profiler to find out where the
delay is, it looks as the Socketsend() is the main cause for delay. Initialy
it takes about 1.7 milisecond to send a block of 1024 bytes, after sending
about 30000 blocks, it streched out to 4 miliseconds. The SocketRecv()
always takes less then 1 milisecond to read the datablock.

We played with the datablocksize but the number of calls remains about 600
even if the data is reduced to 512, 256 or 128 bytes. If we increase the
data to 2048, 4096 or 8192, the number of calls per second decrease. (data
of 65535 bytes can only get 20 socketcalls per second).

We set the sockets to NONBLOCKED.

First the ASINET was used, and now we are accessing sockets via
DllExecuteCall() on the WS2_32.dll. This gives us a bit improved
performance, but not as expected. Now we get a maximum of 5% bandwidth
utilisation (100Mb network), We hope this can be improved, but we do not
know how.

Server is W2K P4-2.4Ghz, Client is W2K P3-500, network is 100Mb full duplex.

Any help is welcome.

Regards,
Jack Duijf, Phil Ide
Frank Grossheinrich [Alaska Software]Re: SocketSend() how to improve performance.
on Tue, 17 Dec 2002 09:10:28 +0100
Jack,

I had a quick look into the C source and there is no magic
in it: a bit of parameter checking, a bit of container 
handling (for the buffer), a bit of error handling, we 
then call send() function, and then there is a bit 
cleanup. The function is a total of 100 lines of code 
from function declaration to closing "}".

So calling socket function through Dllxxxx() functions
might not help here.

That's all I have as a quick shot,

Frank++
Technical Support
Alaska Software Technology AG

--------------------------------------------------------------------
Technical Support EMEA: support@de.alaska-software.com
Technical Support APRA: support@us.alaska-software.com
News Server:            news.alaska-software.com
Homepage:               http://www.alaska-software.com
WebKnowledgeBase:       http://www.alaska-software.com/kb
--------------------------------------------------------------------
phil@idep.org.uk Re: SocketSend() how to improve performance.
on Tue, 17 Dec 2002 09:33:38 +0000
>I had a quick look into the C source and there is no magic

Thanks Frank++.

Jack, to answer your question about ADS, I believe they use straight
TCP/IP.

I may have an answer to the other solution I suggested later today, as
it has just become relevant to what I am doing in the office.

I'll keep you posted.

Regards,

Phil Ide

Xbase++ FAQ
current release: 8,  Monday 4th February 2002, 14:54
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***
Mike EvansRe: SocketSend() how to improve performance.
on Tue, 17 Dec 2002 15:41:47 +0200
Hi Jack & Phil. I haven't time these period but with test's under 1.4  i have managed an increase in speed of about 15% on execution
level( Not in transmision but with major optimizations on the execution level of the program (reduce conversions-less variables
initializations-pass parameters by reference if possible less var2bin and vice versa). I don't now if in 1.5 you have changed
something but i think that it will be a good option for even better performance.
I think that in start of february i'll have time to have a look on the transmission module.

P.S. On something similar (WIS) we have a maximum transmite-recieve using 2 threads. So the first one make the even calls and the
second the odd ones. Of course these program doesn't need sychronize between the 2 threads.

"Jack Duijf" <jdsoft@worldonline.nl> wrote in message news:3dfe662e$1@asgcom.alaska-software.com...
> Hello Alaska Forum,
>
> Currently we are using Sockets to build a client/server solution for Xbase++
> application. See http://www.idep.org.uk/dbfcs/index.html to download.
> The bottleneck in this is the maximum number of socketRecv() and
> SocketSend() calls we can make per second.
>
> Over a 100Mb network we can exchange around 600 datablocks of 1024 bytes per
> second. This is 600Kb/s. When we use  the Profiler to find out where the
> delay is, it looks as the Socketsend() is the main cause for delay. Initialy
> it takes about 1.7 milisecond to send a block of 1024 bytes, after sending
> about 30000 blocks, it streched out to 4 miliseconds. The SocketRecv()
> always takes less then 1 milisecond to read the datablock.
>
> We played with the datablocksize but the number of calls remains about 600
> even if the data is reduced to 512, 256 or 128 bytes. If we increase the
> data to 2048, 4096 or 8192, the number of calls per second decrease. (data
> of 65535 bytes can only get 20 socketcalls per second).
>
> We set the sockets to NONBLOCKED.
>
> First the ASINET was used, and now we are accessing sockets via
> DllExecuteCall() on the WS2_32.dll. This gives us a bit improved
> performance, but not as expected. Now we get a maximum of 5% bandwidth
> utilisation (100Mb network), We hope this can be improved, but we do not
> know how.
>
> Server is W2K P4-2.4Ghz, Client is W2K P3-500, network is 100Mb full duplex.
>
> Any help is welcome.
>
> Regards,
> Jack Duijf, Phil Ide
>
>
>
Jack DuijfRe: SocketSend() how to improve performance.
on Thu, 19 Dec 2002 16:31:36 +0100
Hello Mike,

Could you send me the code snippets you changed?
I could do the changes also, and test them.

Regards,
Jack Duijf

"Mike Evans" <software@ipirotiki.gr> schreef in bericht
news:3dff2868$1@asgcom.alaska-software.com...
> Hi Jack & Phil. I haven't time these period but with test's under 1.4  i
have managed an increase in speed of about 15% on execution
> level( Not in transmision but with major optimizations on the execution
level of the program (reduce conversions-less variables
> initializations-pass parameters by reference if possible less var2bin and
vice versa). I don't now if in 1.5 you have changed
> something but i think that it will be a good option for even better
performance.
> I think that in start of february i'll have time to have a look on the
transmission module.
>
> P.S. On something similar (WIS) we have a maximum transmite-recieve using
2 threads. So the first one make the even calls and the
> second the odd ones. Of course these program doesn't need sychronize
between the 2 threads.
>
> "Jack Duijf" <jdsoft@worldonline.nl> wrote in message
news:3dfe662e$1@asgcom.alaska-software.com...
> > Hello Alaska Forum,
> >
> > Currently we are using Sockets to build a client/server solution for
Xbase++
> > application. See http://www.idep.org.uk/dbfcs/index.html to download.
> > The bottleneck in this is the maximum number of socketRecv() and
> > SocketSend() calls we can make per second.
> >
> > Over a 100Mb network we can exchange around 600 datablocks of 1024 bytes
per
> > second. This is 600Kb/s. When we use  the Profiler to find out where the
> > delay is, it looks as the Socketsend() is the main cause for delay.
Initialy
> > it takes about 1.7 milisecond to send a block of 1024 bytes, after
sending
> > about 30000 blocks, it streched out to 4 miliseconds. The SocketRecv()
> > always takes less then 1 milisecond to read the datablock.
> >
> > We played with the datablocksize but the number of calls remains about
600
> > even if the data is reduced to 512, 256 or 128 bytes. If we increase the
> > data to 2048, 4096 or 8192, the number of calls per second decrease.
(data
> > of 65535 bytes can only get 20 socketcalls per second).
> >
> > We set the sockets to NONBLOCKED.
> >
> > First the ASINET was used, and now we are accessing sockets via
> > DllExecuteCall() on the WS2_32.dll. This gives us a bit improved
> > performance, but not as expected. Now we get a maximum of 5% bandwidth
> > utilisation (100Mb network), We hope this can be improved, but we do not
> > know how.
> >
> > Server is W2K P4-2.4Ghz, Client is W2K P3-500, network is 100Mb full
duplex.
> >
> > Any help is welcome.
> >
> > Regards,
> > Jack Duijf, Phil Ide
> >
> >
> >
>
>