Hi, Remi,
Next is the log, you can see it always stop at about 30 seconds, if log smaller, it’s ok. So, have your 1.3G log been fetch in 30 seconds? I think this not just related the log size, also related to the network, pc capability etc. If it could be fetched among 30 seconds, even bigger log is ok. We use 2019.11 version’s master.
$ time wget http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs --2020-01-09 14:01:57-- http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs Resolving lava-master.sw.nxp.com (lava-master.sw.nxp.com)... 134.27.169.17 Connecting to lava-master.sw.nxp.com (lava-master.sw.nxp.com)|134.27.169.17|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: /api/v0.1/jobs/30686/logs/ [following] --2020-01-09 14:01:58-- http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs/ Reusing existing connection to lava-master.sw.nxp.com:80. HTTP request sent, awaiting response... 200 OK Length: 275583101 (263M) [application/yaml] Saving to: ‘logs’
logs 77%[==========================================================> ] 202.48M 10.2MB/s in 31s
2020-01-09 14:02:29 (6.55 MB/s) - Connection closed at byte 212318286. Retrying.
--2020-01-09 14:02:30-- (try: 2) http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs/ Connecting to lava-master.sw.nxp.com (lava-master.sw.nxp.com)|134.27.169.17|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 275583101 (263M) [application/yaml] Saving to: ‘logs’
logs 94%[=======================================================================> ] 247.13M 8.35MB/s in 31s
2020-01-09 14:03:03 (7.88 MB/s) - Connection closed at byte 259138631. Retrying.
--2020-01-09 14:03:05-- (try: 3) http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs/ Connecting to lava-master.sw.nxp.com (lava-master.sw.nxp.com)|134.27.169.17|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 275583101 (263M) [application/yaml] Saving to: ‘logs’
logs 7%[====> ] 19.40M 5.34MB/s eta 53s ^C
real 1m12.372s user 0m0.402s sys 0m3.103s
With curl:
time curl -L http://lava-master.sw.nxp.com/api/v0.1/jobs/30686/logs > aa % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 24 262M 24 63.5M 0 0 1950k 0 0:02:17 0:00:33 0:01:44 5395k curl: (18) transfer closed with 208899007 bytes remaining to read
real 0m33.397s user 0m0.151s sys 0m0.593s
What I miss?
From: Remi Duraffort remi.duraffort@linaro.org Sent: Wednesday, January 8, 2020 11:56 PM To: Milosz Wasilewski milosz.wasilewski@linaro.org Cc: Larry Shen larry.shen@nxp.com; lava-users@lists.lavasoftware.org Subject: Re: [Lava-users] [EXT] Re: lavacli cannot fetch big logs.
Caution: EXT Email Hello,
I tried locally with a log file of 1.1G and lavacli fails while the rest api works.
Which version of LAVA are you using?
I looked at ways to improve the speed for both xmlrpc and the rest api.
For xmlrpc, the main problem is the fact that the data is loaded in memory and then base64 encoded and then send back to the user. Nothing we can do about this without writing our own xmlrpc library (or improving the official library).
For the rest api, we can use FileResponse instead of HttpResponse to improve performance. On my local setup the download is now 60% faster. I will send a merge request.
Rgds
Le mer. 8 janv. 2020 à 11:15, Milosz Wasilewski <milosz.wasilewski@linaro.orgmailto:milosz.wasilewski@linaro.org> a écrit : On Wed, 8 Jan 2020 at 09:56, Larry Shen <larry.shen@nxp.commailto:larry.shen@nxp.com> wrote:
Yes, Milosz,
57MB is fine, in fact, our 100M+ also fine, just if bigger, like 270MB, it will not fine.
ah, ok. I thought there was some other issue with cli.
I guess it related to gunicorn timeout, if not able to read all log among the timeout, it will fail.
I tried your suggestion, but even I switch to use rest api, it will also timeout as it also go the way gunicorn.
I found this:
https://docs.gunicorn.org/en/stable/settings.html#timeouthttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.gunicorn.org%2Fen%2Fstable%2Fsettings.html%23timeout&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837537875&sdata=0AcBqsU%2BlIXZzGyPCEF84ov50bi2bEIxxQQTSFrRs7I%3D&reserved=0
It said:
Default gunicorn was set 30 seconds for worker timeout.
It seems I have to change " /lib/systemd/system/ lava-server-gunicorn.service" to enlarger the timeout. Just wonder in the day which async http server so popular, if possible lava could adopt some such kinds of technology? Like next: https://docs.gunicorn.org/en/stable/design.html#async-workershttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.gunicorn.org%2Fen%2Fstable%2Fdesign.html%23async-workers&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837547873&sdata=anUMalGVlw2UaLeU95nuJPJtGqv4GsHTO%2Fj8Exhu3kk%3D&reserved=0
Or any other suggestion you could give for this gunicorn worker timeout, I mean short turn solution...
I'll defer to Remi. IMHO it would make sense to implement streaming response somewhere. The down side is you don't know the download size in advance but it should not time out.
milosz
-----Original Message----- From: Milosz Wasilewski <milosz.wasilewski@linaro.orgmailto:milosz.wasilewski@linaro.org> Sent: Wednesday, January 8, 2020 5:07 PM To: Larry Shen <larry.shen@nxp.commailto:larry.shen@nxp.com> Cc: lava-users@lists.lavasoftware.orgmailto:lava-users@lists.lavasoftware.org Subject: [EXT] Re: [Lava-users] lavacli cannot fetch big logs.
Caution: EXT Email
On Wed, 8 Jan 2020 at 08:18, Larry Shen <larry.shen@nxp.commailto:larry.shen@nxp.com> wrote:
Hi, there,
We have one job to do some stress test, the final log is about 270MB.
We use `lavacli -i production jobs logs --raw 30686` to fetch the log, it gives me next:
$ time lavacli -i production jobs logs --raw 30686 /usr/lib/python3/dist-packages/lavacli/__init__.py:101: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmsg.pyyaml.org%2Fload&data=02%7C01%7Clarry.shen%40nxp.com%7Ca778c428e4a947d9b3ab08d7941a20f6%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140712254316438&sdata=06j7jwCcUHSkcBHDzKYScsdqjqhyQnpOKiLgDqk2CmY%3D&reserved=0<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmsg.pyyaml.org%2Fload&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837547873&sdata=w7extxW%2B%2BVkWl74Eb3yU8eIV2GzBqLGE%2FA9wsExjito%3D&reserved=0> for full details. config = yaml.load(f_conf.read()) Unable to call 'jobs.logs': <ProtocolError for https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flarry .shen%3Axxx%40xxx.nxp.com<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2F40xxx.nxp.com&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837557860&sdata=V2NeT0Ca9KAhbWHgSljRInJTXS%2Bv%2FCCGVnXJSXYGMMk%3D&reserved=0>%2FRPC2&data=02%7C01%7Clarry.shen%40nxp.c om%7Ca778c428e4a947d9b3ab08d7941a20f6%7C686ea1d3bc2b4c6fa92cd99c5c3016 35%7C0%7C0%7C637140712254316438&sdata=t2frtOwreMTjSSVMDca1ob2T5M0% 2B8QCpBcaXUL1tArc%3D&reserved=0: 500 ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))> real 0m39.006s user 0m0.989s sys 0m0.191s
I check the gunicorn log, it give me:
[2020-01-08 08:11:12 +0000] [188] [CRITICAL] WORKER TIMEOUT (pid:11506)
Any suggestion?
you can try using API instead https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fyour.insta...https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fyour.instance.url%2Fapi%2Fv0.2%2Fjobs%2F30686%2Flogs&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837557860&sdata=aEPIpE3vTW2WeYEAAA9knWHyXlBf8jCbDChK%2BIFrr8o%3D&reserved=0
I just fetched 57MB log and it worked just fine. In the long run we can probably switch lavacli to use REST API.
milosz
Lava-users mailing list Lava-users@lists.lavasoftware.orgmailto:Lava-users@lists.lavasoftware.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist s.lavasoftware.orghttps://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs.lavasoftware.org&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837567852&sdata=ERVSXjAXvUwb9NYU81H%2Bu2mzmn%2BDVxZ8VSjk2o6Lyis%3D&reserved=0%2Fmailman%2Flistinfo%2Flava-users&data=02%7C01% 7Clarry.shen%40nxp.comhttps://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2F40nxp.com&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837567852&sdata=P%2FpuJMVhnIkFIdwQjv8wWxSJELBoC4WYZPKjat57PtI%3D&reserved=0%7Ca778c428e4a947d9b3ab08d7941a20f6%7C686ea1d3bc 2b4c6fa92cd99c5c301635%7C0%7C0%7C637140712254326435&sdata=s2KqYKrm PfCEBOSjF93IpV07I0P6iMp5zQtRRDfYgjU%3D&reserved=0
_______________________________________________ Lava-users mailing list Lava-users@lists.lavasoftware.orgmailto:Lava-users@lists.lavasoftware.org https://lists.lavasoftware.org/mailman/listinfo/lava-usershttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.lavasoftware.org%2Fmailman%2Flistinfo%2Flava-users&data=02%7C01%7Clarry.shen%40nxp.com%7C689f50a0150f4c04b6dd08d794534e16%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637140957837577850&sdata=GuqybrzICjHEhWBva9DoL4wQFCPJwOQQVLGW5qfxc80%3D&reserved=0
-- Rémi Duraffort LAVA Architect Linaro