ot4i / ace-docker

75 stars 167 forks source link

ACE HTTP request Delay 10 seconds #148

Closed Brian0122 closed 2 years ago

Brian0122 commented 3 years ago

Hi,

Product: App Connect Enterprise Version: v.11 FP10

I have a web service endpoint using HTTPInput node in the project. Found that when I invoke the web service via curl command it will delay around 10 seconds to get response. Interesting thing is: When I have internet connected, it will delay 10 seconds. if disconnected from internet, it works as normal, get response quickly.

And if I add --dns param when running docker, it works fine and response quickly, ex.

docker run --name CICS1 -p 7600:7600 -p 7800:7800 -p 7843:7843 --dns=127.0.0.1 --env LICENSE=accept --env ACE_SERVER_NAME=ACESERVER --env ACE_TRUSTSTORE_PASSWORD=truststorepwd --env ACE_KEYSTORE_PASSWORD=keystorepwd yentingkuo/megapoc-cics1:3.2

And same issue happened on the OpenShift 3.11 platform. If I invoke web service using service name, it always delay 10 seconds to get the response.

Wondering if there's something about nslookup? but it's just an simple httpInput object, cannot figure it out why the dns setting will affect the result?

below is trace from curl, delay happens at starttransfer, it costs around 10 seconds.

curl -vvv -w "\nlookup:%{time_namelookup} \n appconnect:%{time_appconnect}\n pretransfer%{time_pretransfer}\n redirect%{time_redirect}\n starttransfer%{time_starttransfer}\n total%{time_total}\n" http://localhost:7800/gethost
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 7800 (#0)
> GET /gethost HTTP/1.1
> Host: localhost:7800
> User-Agent: curl/7.60.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: IBM App Connect Enterprise
< Date: Wed, 20 Jan 2021 04:23:34 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 48
< 
* Connection #0 to host localhost left intact
{"Response":"Success","hostName":"f2885a591a92"}
lookup:0.004338 
 appconnect:0.000000
 pretransfer0.005282
 redirect0.000000
 starttransfer 10.032292
 total10.032357

Thank you.

IBMRob commented 3 years ago

Hi ,

This sounds like an issue with the DNS on your machine. Are you able to see a similar issue if you run another docker container which includes non ACE restAPI or server you can try.

ACE doesn't touch the networking layer and are not aware of any issues which would introduce a delay to the message.

Brian0122 commented 3 years ago

Hi Rob,

I tried running docker with dns parameter, and it works fine with no delay.

docker run --dns=127.0.0.1 --name CICS1 -p 7600:7600 -p 7800:7800 -p 7843:7843 --dns=127.0.0.1 --env LICENSE=accept --env ACE_SERVER_NAME=ACESERVER --env ACE_TRUSTSTORE_PASSWORD=truststorepwd --env ACE_KEYSTORE_PASSWORD=keystorepwd yentingkuo/megapoc-cics1:3.2

and after added the EnableLookups: false in the server.conf.yaml HTTPConnector section which doesn't mention in the document, it works find without add the dns params.

HTTPConnector:
    EnableLookups: false

I'm wondering why EnableLookups is set to true by default, and what is the usage for this parameter? I also deployed to OpenShift, and got delay in production environment but no delay in testing environment. After disabled the lookup, it all works fine..Just cannot figure what happened in this situation.

IBMRob commented 2 years ago

The EnableLookups option is documented in https://www.ibm.com/docs/en/app-connect/11.0.0?topic=mc-integration-server-http-listener-parameters-soap-http-nodes

Closing as I don’t think this is an issue with the container code