#1 2018-07-17 08:38:42

steve888
Member
Registered: 2018-07-17
Posts: 8

HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

I'm attempting to migrate an old legacy project from ADO/Soap to something a little faster.  TSQLDBServerHttpApi seems to be working fine for normal selects, inserts and stored procedures.  My problem is with stored procedures that return very large result sets that are need for certain reports (up to 50k rows and 100+ columns -  Unfortunately I'm unable to change the logic for these stored procedures).  I'm getting WinHTTP.dll timeouts on the client after about 20 seconds.  I have tried increasing the client KeepAliveMS with no success.  Any help would be appreciated.

Server:

    Props := TOleDBMSSQL2012ConnectionProperties.Create('127.0.0.1','ReportsDB','user','password');
    HttpServer := TSQLDBServerHttpApi.Create(Props,'ReportsDB','8787','user','password');
    HttpServer.Properties.ConnectionTimeOutMinutes := 2;

Client:

  http := TSQLDBWinHTTPConnectionProperties.Create('1.2.3.4:8787','ReportsDB','user','pass');

  try
    ds := TDataSet.Create(Self);
    sql:= 'exec GetReportsSP param1, param2, param3';
    ds := ToDataSet(ds,http.Execute(sql,[]));
    PopulateGrid(ds);
  finally
    ds.Free;
  end;

Offline

#2 2018-07-19 09:28:18

steve888
Member
Registered: 2018-07-17
Posts: 8

Re: HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

Does anyone have any suggestions?  Should I attempt to use a specific type of compression?  Any examples/suggestions would be very much appreciated.

Offline

#3 2018-07-19 21:21:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

Does 50k rows and 100+ columns take more than 20 seconds to be retrieved on server side?

Offline

#4 2018-07-19 23:02:29

steve888
Member
Registered: 2018-07-17
Posts: 8

Re: HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

ab wrote:

Does 50k rows and 100+ columns take more than 20 seconds to be retrieved on server side?

Negative.  It executes in SSMS after about 2 seconds.  I also ran a trace on the server and it was also done in about 2 seconds.

Last edited by steve888 (2018-07-19 23:05:54)

Offline

#5 2018-07-20 01:43:40

cybexr
Member
Registered: 2016-09-14
Posts: 81

Re: HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

Maybe you can use fiddler (webdev proxy software ) record your client http packet, then replay the packet from fiddler,  see if it also takes 20 sec , may help you get clue (whether network problem or winhttplib or RESTClient code flaw)

Offline

#6 2018-07-27 08:14:07

steve888
Member
Registered: 2018-07-17
Posts: 8

Re: HTTP remote - WinHTTP.dll error 12002 (The operation timed out)

Thanks for the reply.  I got it working by calling RegisterCompress and by increasing the send/recieve timeouts.  Now I'm having another problem with a stored proc that returns 300+ columns.  FetchAllToBinary throws a 'Too Many Columns' exception.  Any suggestions?

Offline

Board footer

Powered by FluxBB