mockserver
mockserver copied to clipboard
Mockserver freezes an endpoint when responding large expectations continuously
Describe the issue mockserver freezes requests after a moments usage.
What you are trying to do I'm trying to develop a frontend-application that is served through nginx with expectations.json and the mockserver container as a backend.
MockServer version 5.14.0
To Reproduce
- I'm runnign the mockserver in a docker-compose environment
- I don't have any code to produce expectations as they are generated by usage. But it is roughly half a million lines of json (23.4 Mb) that are mostly delivered through a single endpoint.
- The json is fetched every two-three seconds
- Result: After running a couple minutes, normally around 10-15, i eventually see frozen http requests and get no more responses from the mockserver.
Expected behaviour I expect the mockserver to keep being responsive despite serving millions of requests.
Nginx Log Before problem:
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:09:09 +0000] "GET /pipeline/status?id=7c951bc8-e821-4c91-8866-3d86d785ee61 HTTP/1.1" 200 15894769 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:09:11 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 2022/09/21 10:09:14 [warn] 32#32: *105 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/1/02/0000000021 while reading upstream, client: 172.21.0.1, server: localhost, request: "GET /pipeline/status?id=7c951bc8-e821-4c91-8866-3d86d785ee61 HTTP/1.1", upstream: "http://172.21.0.2:1080/pipeline/status", host: "localhost:8989", referrer: "http://localhost:8989/"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:09:14 +0000] "GET /pipeline/status?id=7c951bc8-e821-4c91-8866-3d86d785ee61 HTTP/1.1" 200 15894769 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:09:17 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
eventually i get these [warn]s
frontend_1 | 2022/09/21 10:11:14 [warn] 32#32: *105 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/0/04/0000000040 while reading upstream
And in the end the time between the last request and the second to last request takes a very long time.
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:11:59 +0000] "GET /pipeline/status?id=7c951bc8-e821-4c91-8866-3d86d785ee61 HTTP/1.1" 200 15894769 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:02 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:06 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:10 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:18 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:23 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:12:25 +0000] "GET /pipeline/status?id=7c951bc8-e821-4c91-8866-3d86d785ee61 HTTP/1.1" 200 5 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
After problem: I only see requests towards another endpoint and no longer the /pipeline/status endpoint at all which was running every two seconds.
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:07 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:11 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:15 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:19 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:23 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:27 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:31 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"
frontend_1 | 172.21.0.1 - - [21/Sep/2022:10:13:35 +0000] "GET /pipeline/activePipelines HTTP/1.1" 200 3 "http://localhost:8989/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "-"