Hi!
I am using Http Client (OE 11.6.2, OpenEdge.Net.pl library) to send GET requests to a server expecting a file (e.g. pdf as application/octet-stream) as a response.
Files under 1 mb arrive relatively fast, but for example a 20 mb file will arrive in around 5 minutes. Logging shows that the file is received in 8kb chunks, is that the cause of the delay and is that (=socket receive buffer) adjustable?
Using 'wget' or 'curl' takes ~2sec to get response back, this means that problem is not on server side.
Any idea how can I receive files quicker using HttpClient?
BR
Toomas
OK, I set both ReadBufferSize & ReceiveBufferSize to 32K.
[17/04/12@09:52:12.585+0300] P-012951 T-1483659040 1 4GL APPL Execute() start
[17/04/12@09:52:12.635+0300] P-012951 T-1483659040 1 4GL HTTPCLIB REQUEST: FILE= request-raw.txt
[17/04/12@09:52:12.636+0300] P-012951 T-1483659040 1 4GL HTTPCLIB RESPONSE: FILE= data-received.txt
[17/04/12@09:52:12.636+0300] P-012951 T-1483659040 1 4GL SOCKET CONNECT: -H xxx -S 8080
[17/04/12@09:52:12.639+0300] P-012951 T-1483659040 1 4GL SOCKET SO-RCVBUF: 65536
[17/04/12@09:52:12.639+0300] P-012951 T-1483659040 1 4GL SOCKET SO-RCVTIMEO: 30
[17/04/12@09:52:12.639+0300] P-012951 T-1483659040 1 4GL SOCKET CONNECT: TIME(ms)=2
[17/04/12@09:52:12.639+0300] P-012951 T-1483659040 1 4GL SOCKET WRITE: TIME(ms)=0
[17/04/12@09:52:12.639+0300] P-012951 T-1483659040 1 4GL SOCKET WRITE: SIZE(b)=182
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL SOCKET READ: AVAIL(b)=14480
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TIME(ms)=0
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL SOCKET READ: SIZE(b)=14480
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: NUM= 1
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: SIZE(b)= 32768
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: READ(b)= 14480
[17/04/12@09:52:12.937+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: FILE= data-chunk-00001.txt
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL SOCKET READ: AVAIL(b)=101360
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TIME(ms)=0
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL SOCKET READ: SIZE(b)=32768
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: NUM= 2
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: SIZE(b)= 32768
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: READ(b)= 32768
[17/04/12@09:52:13.009+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: FILE= data-chunk-00002.txt
...
...
...
[17/04/12@09:53:16.709+0300] P-012951 T-1483659040 1 4GL SOCKET READ: AVAIL(b)=44085
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TIME(ms)=0
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL SOCKET READ: SIZE(b)=32768
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: NUM= 632
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: SIZE(b)= 32768
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: READ(b)= 32768
[17/04/12@09:53:16.710+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: FILE= data-chunk-00632.txt
[17/04/12@09:53:17.012+0300] P-012951 T-1483659040 1 4GL SOCKET READ: AVAIL(b)=11317
[17/04/12@09:53:17.012+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TIME(ms)=0
[17/04/12@09:53:17.012+0300] P-012951 T-1483659040 1 4GL SOCKET READ: SIZE(b)=11317
[17/04/12@09:53:17.013+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: NUM= 633
[17/04/12@09:53:17.013+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: SIZE(b)= 32768
[17/04/12@09:53:17.013+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: READ(b)= 11317
[17/04/12@09:53:17.013+0300] P-012951 T-1483659040 1 4GL HTTPCLIB CHUNK: FILE= data-chunk-00633.txt
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: COMPLETE= yes
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: ERROR= ?
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TOTAL TIME(ms)=64384
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TOTAL SIZE(b)=61273423
[17/04/12@09:54:16.015+0300] P-012951 T-1483659040 1 4GL APPL Execute() done
2min 2 sec total time, response size: 20 742 144 bytes.
Another question is why it takes 59sec to finish Execute after reading from network is done ? Merging chunks together?
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: COMPLETE= yes
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: ERROR= ?
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TOTAL TIME(ms)=64384
[17/04/12@09:53:17.024+0300] P-012951 T-1483659040 1 4GL SOCKET READ: TOTAL SIZE(b)=61 273 423 ???
[17/04/12@09:54:16.015+0300] P-012951 T-1483659040 1 4GL APPL Execute() done
EDIT: Another log file with 1MB buffer - same server, same url, same output:
1) Linux - https://pastebin.com/eGwe4USk - TIME(ms)=6805, TOTAL SIZE(b)=206 329 01, CHUNK: NUM= 217
2) Win64 - https://pastebin.com/StPSDHqt - TIME(ms)=990, TOTAL SIZE(b)=1 586 896, CHUNK: NUM= 25
Debug log seems a little bit weird to me.
BR
Toomas
Hi,
Yes, 11.6.2. Plain HTTP connection.
I know the URI is private (inside your firewall). What would be really helpful for me to be able to profile/discover at least some of the slowness would be the debug dump that's created when you enable logging
If you add
log-manager:logfile-name = session:temp-dir + 'test_bigdata.log'.
log-manager:logging-level = 6.
log-manager:clear-log ().
to the beginning of your test code, the Http Client will crate a file called response-data-received.txt in your -T directory (along with a number of response-data-chunk-NNNN.txt files).
If you can email me the response-data-received file (or attach to this thread) it will be useful in trying to find the issue.