[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: httpapi speed



Mike,

we need to upload data to a web service. Usually this is done at night but now we need to do this process also during the work hours. Currently the process takes around one hour in the night. During work hours this is absolutly unacceptable. Considering that the same process would take around 30 seconds if done with a Delphi app, we need to decide what to do.

Scotts hint with the http_persist_open call seems tob e the way to go and I was not aware that this exists.

Peter

 
-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Mike Krebs
Gesendet: Mittwoch, 28. Mai 2014 21:46
An: HTTPAPI and FTPAPI Projects
Betreff: RE: httpapi speed

Not to distract from the question of speed (HTTPAPI is "slow"), but...

Do you need httpapi to perform faster than it does?

If not,
    the question is rhetorical and we don't have to spend any more time figuring it out.
If it is a requirement,
    we should try to figure it out. 



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, May 28, 2014 12:25 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: httpapi speed

Peter,

When you're connecting to the same server repeatedly, I would recommend using the persistent APIs.  They have the ability to create a single connection, and then re-use that connection for multiple requests.  This should greatly improve performance.


D comm            s               *


  /free

      comm = http_persist_open( url );

      if comm = *null;
         http_crash();
      endif;

      for x = 1 to 1000;

         rci = http_persist_get( comm: url: 0: %paddr( toString ));

         if rci <> 1;
          // handle error
         endif;

      endfor;

      http_persist_close(comm);


On 5/28/2014 5:24 AM, Sawatzki, Peter wrote:
> I'm unsure whether we are doing something wrong: we are using httpapi successfully in several different projects however I'm wondering why the AS/400 is much slower than for example a simple PC that issues a request.
>
> To nail this down I wrote a simple web service that can be called with 
> a GET and that returns a fixed string. The get is called with this 
> code
>
> Rci = http_url_get_raw( Url : 0 : %PAddr( toString ) );
>
> in a loop 1000 times.
>
> On the PC (client) side I have a simple Delphi app that does
>
>   For i:= 1 to 1000 do Idhttp.get(Url);
>
> Where URL is 
> http://192.168.101.27/dwhsvc/dwhsvc.dll/datasnap/rest/TServermethods/p
> ing
>
> And the service responds with "pong". 192.168.101.27 is located in the same subnet as the AS/400.
>
> The AS/400 takes 210 seconds to issue 1000 calls, the PC takes less than two seconds (or 13 seconds for 10,000 calls).
>
> Any idea what I'm doing wrong on the AS/400 side ?
>
> Peter
>
>
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------