Re: [twsocket] Can this be made?

2011-10-17 Thread Angus Robertson - Magenta Systems Ltd
 What I want to know is we already have the cache memory stream 
 which we read from and there is multiple copying of data as 
 TMemoryStream-FDocBuf-ICS internal buffer-Winsock. 

Most static files are currently served using TFileStream which is
unbuffered with no cache, so reading large amounts into a larger FDocBuf
is more efficient than at present.  

Obviously specific THttpSrv implementations may be loading the stream in
different ways, from caches or whatever, and messing with buffer sizes,
but many people (including my own implementations) just use the server
defaults, which are not very efficient. 

You can not read a stream straight into TIcsBufferHandler used by
PutDataInSendBuffer in WSocket, it only accepts pointers.  There are
multiple buffer 'pages' 1,460 bytes in size, not necessarily in
contiguous memory, so they have to filled one at a time. Each call to
PutDataInSendBuffer does a lock of all the buffers, so a larger FDocBuf
means before locks.  

So the changes I propose to OverbyteIcsHttpSrv will essentially be the
same as the FTP server, including using TBufferedFileStream, a larger
FDocBuf if the stream size justifies it, and increasing the socket TCP
buffer likewise, no point in allocating 32K buffers for a 2K GIF image. 

Angus

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Can this be made?

2011-10-16 Thread Fastream Technologies
Hello,

I wonder if we could write the data directly to TWSocket bufferlist instead
of FDocBuf in THttpServer so that there is no longer double (and in the case
of SSL triple) copying. We already have a cache TMemoryStream and need as
much speed as it gets.
Best Regards,

SZ
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Can this be made?

2011-10-16 Thread Angus Robertson - Magenta Systems Ltd
 I wonder if we could write the data directly to TWSocket bufferlist 
 instead of FDocBuf in THttpServer so that there is no longer double
 (and in the case of SSL triple) copying.

I'm currently looking at THttpServer performance improvements, I doubled
the speed on Friday by increasing buffers sizes in the client, but plan
to make the buffer size dynamic based on the size of the file being sent,
since there are often lots of small files.  

Currently the server defaults to reading 1,460 bytes at a time from the
stream, which seems appropriate for dial-up modems 10 years ago.   

Angus



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Can this be made?

2011-10-16 Thread Fastream Technologies
Hello,
On Sun, Oct 16, 2011 at 20:27, Angus Robertson - Magenta Systems Ltd 
an...@magsys.co.uk wrote:

  I wonder if we could write the data directly to TWSocket bufferlist
  instead of FDocBuf in THttpServer so that there is no longer double
  (and in the case of SSL triple) copying.

 I'm currently looking at THttpServer performance improvements, I doubled
 the speed on Friday by increasing buffers sizes in the client, but plan
 to make the buffer size dynamic based on the size of the file being sent,
 since there are often lots of small files.

 Currently the server defaults to reading 1,460 bytes at a time from the
 stream, which seems appropriate for dial-up modems 10 years ago.

 Angus




We have made some ICS web server speed improvements too. Together with RAM
cache and keep-alive, it could reply 7700 requests/sec for a 1KB file! The
good thing with proxy servers is that it does not matter if it is a txt or a
php file. 1460 bytes is the Ethernet frame payload size. We have made some
buffering in cache reads so that it now reads 16-32-64KB and pumps in 1460
bytes each time, reducing cache critical section wait time.

What I want to know is we already have the cache memory stream which we read
from and there is multiple copying of data as TMemoryStream-FDocBuf-ICS
internal buffer-Winsock. If only we cıould remove the first part and copy
directly to ICS, it will be faster.

Regards,

SZ
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be