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

Re: httpapi speed



   Hi Mike,
   Alan Seiden wrote an article some years ago on installing cURL. I did
   some testing for him but haven't used it since.
   Here's a link to the article:
   [1]http://www.mcpressonline.com/tips-techniques/web-languages/techtip-t
   alk-to-the-internet-with-curl.html
Russ Khoury
i for IBM Developer/Consultant
Paul Russell Associates, Inc.
[2]rkhoury@xxxxxxxxxxxxxxxxxxxx

   On 5/28/2014 6:59 PM, Mike Krebs wrote:

Does anyone have cURL installed on their IBMi? I am curious how it performs vers
us HTTPAPI.



-----Original Message-----
From: [3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [[4]mailto:ftpapi-bounces@lists.s
cottklement.com] On Behalf Of Sawatzki, Peter
Sent: Wednesday, May 28, 2014 4:18 PM
To: HTTPAPI and FTPAPI Projects
Subject: AW: httpapi speed

Scott,

thanks, we will try this. I was not aware of these methods.

(And I guess this is already the solution  to my speed problems: I had an app wr
itten in C on the AS/400 that was performing really slow when it retrieved data
via TCP from a custom server and it turned out that the performance killer was o
pening and closing the connection.)

Peter

-----Ursprüngliche Nachricht-----
Von: [5]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [[6]mailto:ftpapi-bounces@xxxxxxxx
ottklement.com] Im Auftrag von Scott Klement
Gesendet: Mittwoch, 28. Mai 2014 19:25
An: HTTPAPI and FTPAPI Projects
Betreff: Re: httpapi speed

Peter,

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


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 successful
ly in several different projects however I'm wondering why the AS/400 is much sl
ower 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
[7]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 subn
et as the AS/400.

The AS/400 takes 210 seconds to issue 1000 calls, the PC takes less than two sec
onds (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:
[8]http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-


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

References

   1. http://www.mcpressonline.com/tips-techniques/web-languages/techtip-talk-to-the-internet-with-curl.html
   2. mailto:rkhoury@xxxxxxxxxxxxxxxxxxxx
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   6. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   7. http://192.168.101.27/dwhsvc/dwhsvc.dll/datasnap/rest/TServermethods/p
   8. http://www.scottklement.com/mailman/listinfo/ftpapi
   9. http://www.scottklement.com/mailman/listinfo/ftpapi
  10. http://www.scottklement.com/mailman/listinfo/ftpapi
  11. 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
-----------------------------------------------------------------------