normal nodejs response time/concurrency for hello world? [specifically for openwhisk standalone]
- Dominant language
- Scala
- Stars
- 6.8k
- Forks
- 1.2k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 2
Description
First of all, thanks for this awesome project.
## Environment details:
* local deployment (standalone docker img: openwhisk/standalone:nightly)
* docker 18.09.8-ce, alpine linux 3.10 on WSL, Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
## Steps to reproduce the issue:
```bash
IMAGE="${1:-openwhisk/standalone:nightly}"
$ docker run --rm -d \
-h openwhisk --name openwhisk \
-p 3233:3233 -p 3232:3232 \
-v /var/run/docker.sock:/var/run/docker.sock \
"$IMAGE" "$@"
$ docker exec openwhisk waitready
$ AUTH=$(docker exec openwhisk wsk property get --auth | awk '{ print $3 }' )
$ wsk property set --auth $AUTH --apihost http://localhost:3233
$ echo 'function main(args) {
const name = args && args.name || "stranger";
return { greeting: `Hello ${name}!` };
}' > hello.js
$ wsk action create helloJS hello.js --concurrency 10
error: Unable to create action 'helloJS': The request content was malformed:
requirement failed: concurrency 10 exceeds allowed threshold of 1 (code oUwMJCOQ4NCcatFSX49kTCwaFYtxhX7D)
Run 'wsk --help' for usage.
$ wsk action create helloJS hello.js
ok: created action helloJS
$ time curl -H 'Content-Type: application/json' -X POST -u "$AUTH" http://localhost:3233/api/v1/namespaces/guest/actions/helloJS?blocking=true
{....,"response":{"result":{"greeting":"Hello ${name}!"}...}
real 0m1.031s
user 0m0.005s
sys 0m0.001s
$ time curl -H 'Content-Type: application/json' -X POST -u "$AUTH" http://localhost:3233/api/v1/namespaces/guest/actions/helloJS?blocking=true
{....,"response":{"result":{"greeting":"Hello ${name}!"}...}
real 0m0.501s
user 0m0.004s
sys 0m0.001s
```
## Provide the expected results and outputs:
I expected the second curl response-time to be much smaller/faster.
## Provide the actual results and outputs:
* Why is concurrency limited 1 for to nodejs:10? Documentation states otherwise.
* It seems that, the more time is in between the curl calls..the smaller/faster the responsetime is.
Given a fair amount of activations, I would expect any recurring call to be superfast:
```
$ wsk activation list | grep helloJS | grep warm | wc -l
27
```
Contributor guide
Research direction
Start by reproducing the standalone Docker setup and the documented Node.js concurrency behavior with the supplied wsk and curl commands. Inspect the action-creation response and compare repeated activation timings, then determine whether the observed limit and latency match the documentation; done means a documented explanation or a confirmed defect with a focused reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, node.js
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100