Re: [twsocket] SSL post extremely slow

2016-04-26 Thread brian -
Memo isn't touched during the progress, only the progressbar. Removed
OnSenData event, same results.

Saved Uploaded File OK
New File Name: d:\tempwork\telecom\uploads\20160426-200144_testpng.png
File Size: 4,553,987
Upload Duration: 33.94 secs
Speed: 134,181 chars/sec
Upload FileName: testpng.png
FileTitle: upload test
Post URL: http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm

On Tue, Apr 26, 2016 at 7:07 PM, François Piette 
wrote:

> Hello,
>
> You are updating your progress bar and memo in the event, each time it is
> called. This probably slow down everything.
> Please retest without any GUI interaction during transfer.
>
> --
> francois.pie...@overbyte.be
> The author of the freeware multi-tier middleware MidWare
> The author of the freeware Internet Component Suite (ICS)
> http://www.overbyte.be
>
>
>
> -Message d'origine-
> De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
> brian
> -
> Envoyé : mardi 26 avril 2016 03:58
> À : ICS support mailing
> Objet : Re: [twsocket] SSL post extremely slow
>
> Did the test with a 4,5MB file, non-SSL
>
> Firefox: 2.6s
>
> Saved Uploaded File OK
> New File Name: d:\tempwork\telecom\uploads\20160426-021729_Aion 2016.Apr.21
> - 10.57.48.png
> File Size: 4,553,987
> Upload Duration: 2.6 secs
> Speed: 1,754,908 chars/sec
> Upload FileName: Aion 2016.Apr.21 - 10.57.48.png
> FileTitle: aion ss test
> Post URL: http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm
>
> ICS: 34.1s
>
> POST /testing/uploadfile.htm HTTP/1.0
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Referer: http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm
> Content-Type: multipart/form-data;
> boundary=147712359214935
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
> Firefox/45.0
> Host: www1.telecom-tariffs.co.uk
> Content-Length: 4554186
>
> 34133ms
>
> unit Unit1;
> >
> > interface
> >
> > uses
> >   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
> > System.Classes, Vcl.Graphics,
> >   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, OverbyteIcsWndControl,
> >   OverbyteIcsHttpProt, Vcl.StdCtrls, Vcl.ComCtrls,
> >
> >   MultipartBuilder;
> >
> > type
> >   TForm1 = class(TForm)
> > Button1: TButton;
> > Button2: TButton;
> > HttpCli1: THttpCli;
> > ProgressBar1: TProgressBar;
> > Memo1: TMemo;
> > procedure Button1Click(Sender: TObject);
> > procedure HttpCli1SendData(Sender: TObject; Buffer: Pointer; Len:
> > Integer);
> > procedure HttpCli1BeforeHeaderSend(Sender: TObject; const Method:
> > string; Headers: TStrings);
> > procedure HttpCli1SendEnd(Sender: TObject);
> >   private
> > { Private declarations }
> >   public
> > { Public declarations }
> >   end;
> >
> > var
> >   Form1: TForm1;
> >   x: Int64;
> >
> > implementation
> >
> > {$R *.dfm}
> >
> > procedure TForm1.Button1Click(Sender: TObject); Var fil: AnsiString;
> > mp: TMultiPartObject;
> > fl: string;
> > tm: TMemoryStream;
> > Const cT = '147712359214935';
> > begin
> >   // Fill multipart data+file
> >   fl := 'z:\Aion 2016.Apr.21 - 10.57.48.png';
> >   mp := TMultiPartObject.Create(cT);
> >   tm := TMemoryStream.Create;
> >   tm.LoadFromFile(fl);
> >   ProgressBar1.Max := tm.Size;
> >   With mp do begin
> > AddFileFromStream('image',ExtractFileName(fl),'image/png',tm);
> > CloseData;
> > fil := GetFile;
> >   end;
> >   mp.Free;
> >
> >   x := GetTickCount;
> >   With HttpCli1 do begin
> > url := 'http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm';
> > SendStream := TMemoryStream.Create;
> > SendStream.Write(fil[1],length(fil));
> > SendStream.Seek(0,0);
> > RcvdStream := TMemoryStream.Create;
> > Timeout := 5;
> > Agent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0)
> > Gecko/20100101 Firefox/45.0';
> > ContentTypePost := 'multipart/form-data; boundary='+cT;
> > Reference :=
> > 'http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm
> > ';
> > try
> >   PostAsync;
> > except
> >   On E:Exception do ShowMessage(E.Message);
> > end;
> >   end;
> > end;
> >
> > procedure TForm1.HttpCli1BeforeHeaderSend(Sender: TObject; const Method:
> &g

Re: [twsocket] SSL post extremely slow

2016-04-26 Thread François Piette
Hello,

You are updating your progress bar and memo in the event, each time it is
called. This probably slow down everything.
Please retest without any GUI interaction during transfer.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be



-Message d'origine-
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de brian
-
Envoyé : mardi 26 avril 2016 03:58
À : ICS support mailing
Objet : Re: [twsocket] SSL post extremely slow

Did the test with a 4,5MB file, non-SSL

Firefox: 2.6s

Saved Uploaded File OK
New File Name: d:\tempwork\telecom\uploads\20160426-021729_Aion 2016.Apr.21
- 10.57.48.png
File Size: 4,553,987
Upload Duration: 2.6 secs
Speed: 1,754,908 chars/sec
Upload FileName: Aion 2016.Apr.21 - 10.57.48.png
FileTitle: aion ss test
Post URL: http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm

ICS: 34.1s

POST /testing/uploadfile.htm HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Referer: http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm
Content-Type: multipart/form-data;
boundary=147712359214935
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
Firefox/45.0
Host: www1.telecom-tariffs.co.uk
Content-Length: 4554186

34133ms

unit Unit1;
>
> interface
>
> uses
>   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, 
> System.Classes, Vcl.Graphics,
>   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, OverbyteIcsWndControl,
>   OverbyteIcsHttpProt, Vcl.StdCtrls, Vcl.ComCtrls,
>
>   MultipartBuilder;
>
> type
>   TForm1 = class(TForm)
> Button1: TButton;
> Button2: TButton;
> HttpCli1: THttpCli;
> ProgressBar1: TProgressBar;
> Memo1: TMemo;
> procedure Button1Click(Sender: TObject);
> procedure HttpCli1SendData(Sender: TObject; Buffer: Pointer; Len:
> Integer);
> procedure HttpCli1BeforeHeaderSend(Sender: TObject; const Method:
> string; Headers: TStrings);
> procedure HttpCli1SendEnd(Sender: TObject);
>   private
> { Private declarations }
>   public
> { Public declarations }
>   end;
>
> var
>   Form1: TForm1;
>   x: Int64;
>
> implementation
>
> {$R *.dfm}
>
> procedure TForm1.Button1Click(Sender: TObject); Var fil: AnsiString;
> mp: TMultiPartObject;
> fl: string;
> tm: TMemoryStream;
> Const cT = '147712359214935';
> begin
>   // Fill multipart data+file
>   fl := 'z:\Aion 2016.Apr.21 - 10.57.48.png';
>   mp := TMultiPartObject.Create(cT);
>   tm := TMemoryStream.Create;
>   tm.LoadFromFile(fl);
>   ProgressBar1.Max := tm.Size;
>   With mp do begin
> AddFileFromStream('image',ExtractFileName(fl),'image/png',tm);
> CloseData;
> fil := GetFile;
>   end;
>   mp.Free;
>
>   x := GetTickCount;
>   With HttpCli1 do begin
> url := 'http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm';
> SendStream := TMemoryStream.Create;
> SendStream.Write(fil[1],length(fil));
> SendStream.Seek(0,0);
> RcvdStream := TMemoryStream.Create;
> Timeout := 5;
> Agent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) 
> Gecko/20100101 Firefox/45.0';
> ContentTypePost := 'multipart/form-data; boundary='+cT;
> Reference := 
> 'http://www1.telecom-tariffs.co.uk/testing/uploadfile.htm
> ';
> try
>   PostAsync;
> except
>   On E:Exception do ShowMessage(E.Message);
> end;
>   end;
> end;
>
> procedure TForm1.HttpCli1BeforeHeaderSend(Sender: TObject; const Method:
> string; Headers: TStrings);
> begin
>   Memo1.Lines.Add(Headers.Text);
> end;
>
> procedure TForm1.HttpCli1SendData(Sender: TObject; Buffer: Pointer; Len:
> Integer);
> begin
>   ProgressBar1.Position := ProgressBar1.Position + Len; end;
>
> procedure TForm1.HttpCli1SendEnd(Sender: TObject); begin
>   With HttpCli1 do begin
> SendStream.Free;
> RcvdStream.Free;
>   end;
>   Memo1.Lines.Add('');
>   Memo1.Lines.Add(IntToStr(GetTickCount-x)+'ms');
> end;
>
> end.
>


On Mon, Apr 25, 2016 at 7:12 PM, Angus Robertson - Magenta Systems Ltd <
an...@magsys.co.uk> wrote:

> > Are there any known issues with SslHttpCli for sending data? I've 
> > observed the following:
> > Sending a 3MB picture to imgur:
> > * with ICS/OpenSSL: takes ~27 seconds
>
> Done some testing with a view to investigating this issue, but not 
> currently sure it's worth any more time.
>
> I'm using an updated version of the sample OverbyteIcsHttpPost against 
> the I