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

Re: [Ftpapi] HTTPAPI https question



Post the log.  Then we can see where it seems to be taking long.

But, when you say the first time is slow, then after that it's fast, it tells me that possibly it will be startup of the inhouse job.  There's no reason a client would take longer the first time that I can think of, but when you initiate a new server job on the server side that can sometimes take a while, especially with Java.  

On Tue, Mar 10, 2020 at 11:13 AM Lawrence Loz <loz0707@xxxxxxxxxxxxx> wrote:
Is there any way of getting more meaningful information out of the debug/http log option, to get some kind of idea as to why the log is giving these timings?


From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> on behalf of Scott Klement <sk@xxxxxxxxxxxxxxxx>
Sent: 10 March 2020 16:00
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] HTTPAPI https question
 

Hello,


I'm not aware of any reason that it should take this long to connect.    When I make connections to https URLs, they take a tiny fraction of a second to connect.  I have no experience with connections taking as long as 10 seconds, or even 3 seconds.  Sorry.


-SK


On 3/10/2020 8:18 AM, Lawrence Loz wrote:

Hi,

 

I’ve been asked to look at a performance issue with some webservice service programs written by another programmer in our company who has now moved on. They are written using HTTPAPI and are calling https urls which in this instance happen to be a website within our company also, but not on the iseries.

 

The problem is that on the 1st call the process takes about 10 seconds, but on subsequent calls it only takes about 3 seconds. This seems to be happening on all of webservices written using HTTPAPI, but I am concentrating on one in the hope that, fix that and the others will follow suit.

 

Is there any way of reducing the overhead on the 1st call?

 

The company website calls the iseries using stored procedures, the iseries then does a number of webservice calls and processes, but the website has a 30 second timeout and so the web site often fails on the 1st call because of timeout even through the iseries is eventually succesful, but is then successful on subsequent calls as the iseries processes these within the timeout limit.

By calling the stored procedure direct, observing the timing of the SQL and also looking at the httpapi.log in debug, I’ve arrived at timings.

 

If there’s anything you can suggest to alter in the way we are using HTTPAPI, I’d be really grateful.

 

I’ve copied a section of the RPG code below, to hopefully help.

 

Thanks,               Lawrence

 

http_setCCSIDs(1208: 0);                                      

w#logfile =                                                   

            '/webservices/'+%subst(#1Library:2:3)+            

               '/http_api_log/' + %char(%timestamp:*ISO0)+    

               '-CardUnload.txt';                             

http_debug(*ON:w#logfile);                                    

http_use_cookies(*OFF);                                       

w#tempFile = http_tempfile(); 

rc = http_post( w#endpoint                         

              : %addr(SOAP) + VARYINGDATAOFFSET    

              : %len(SOAP)                         

              : %trim(w#tempfile)                  

              : HTTP_TIMEOUT                       

              : HTTP_USERAGENT                     

              : 'text/xml; charset=UTF-8'          

              : '""' );                            

w#fd = open( %trim(w#tempFile)                     

             : O_CREAT + O_RDWR + O_EXCL           

             : S_IRWXU );                           

                                                    

if (rc<>1);                                          

………….

 

//LL01- https_cleanup();            //*  we did have this in but have removed it and it doesn’t seem to make any difference either way *//

                             



--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi