11 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
49053feac7 Clarify EULA applies to this project since 2019
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2024-11-18 21:20:38 +00:00
Alex Ellis (OpenFaaS Ltd)
8e1c34e222 Set default max scale to 5 replicas and a 10% increment
Sets a new default maximum scale limit of 5 replicas out of
the box for CE users, CE meaning "Community" rather than
"Commercial".

The increment factor of 10 vs 25 should not make a difference
to genuine community and hobbyist users.

Tested and verified with unit tests and hey with a CE cluster
where the maximum limit was reached over several minutes,
finally going back to 1 replica.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2023-01-17 21:16:32 +00:00
Gede Wahyu
09736be293 When firing, newReplicas should be greater than currentReplicas
Signed-off-by: Gede Wahyu <tokekbesi@gmail.com>
2018-12-29 19:31:04 +00:00
Gede Wahyu
3bdb194e71 Round up value of newReplicas
Signed-off-by: Gede Wahyu <tokekbesi@gmail.com>
2018-12-29 19:31:04 +00:00
Gede Wahyu
81db6514f7 Fix TestInitialScale expectation
Signed-off-by: Gede Wahyu <tokekbesi@gmail.com>
2018-12-29 19:31:04 +00:00
Gede Wahyu
058d1e481a Test scaled up from 1
Signed-off-by: Gede Wahyu <tokekbesi@gmail.com>
2018-12-29 19:31:04 +00:00
Alex Ellis (VMware)
9cea08c728 Extract scaling from zero
- extracting this package means it can be used in other components
such as the asynchronous nats-queue-worker which may need to
invoke functions which are scaled down to zero replicas.

Ref: https://github.com/openfaas/nats-queue-worker/issues/32

Tested on Docker Swarm for scaling up, already scaled and not
found error.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-11-01 15:10:08 +00:00
Alex Ellis (VMware)
f5939c9a60 Update for scaling edge-case
- as reported on Slack and in issue #931 the gateway scaling code
was scaling to zero replicas as a result of the "proportional
scaling" added by @Templum's PR. This commit added a failing test
which was fixed by adding boundary checking - now if the scaling
amount is "0" we keep the current amount of replicas.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-10-25 11:47:47 +01:00
Alex Ellis (VMware)
811bbe6031 Apply gofmt
Previous PR from Simon or Ken broke build due to missing gofmt
in the PR. This PR applies it to resolve the build issue.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-11 20:46:20 -07:00
Simon Pelczer
7fe67d7af6 Implemented the autoscaling steps to be proportions of the max replicas.
Introduced an new label to set the scaling factor that is used to calculate th proportions, setting it to 0 also allows to disable scaling.
Updated the tests to reflect the changes and added a new test which shows that setting the scaling factor to 0 indeed does disable scaling.
Ensured that the scaling factor is always between [0 and 100].

Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
2018-04-11 19:30:43 -07:00
Ken Fukuyama
e6a6aea422 Moved unit test files inside same directory as test target
The unit tests were inside the `gateway/tests` directory which had no
effect to the coverage for `go test`. Therefore, moved the tests inside
the same directory as the test target.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-04-06 14:13:14 +01:00