# Copyright 2017 The LUCI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

service: logs
runtime: go
env: flex

resources:
  cpu: 2
  memory_gb: 4
  disk_size_gb: 10

inbound_services:
  - warmup

handlers:
- url: "/internal/*"
  script: _go_app
  secure: always
  login: admin

- url: "/.*"
  script: _go_app
  secure: always


# Have some more liberal health check parameters, as we've observed "nginx"
# timing out in production.
health_check:
  enable_health_check: True
  check_interval_sec: 5
  timeout_sec: 4
  # Stop accepting requests after 20 sec of unhealthiness.
  unhealthy_threshold: 4
  healthy_threshold: 1
  # Restart after 2 min of unhealthiness.
  restart_threshold: 24

# Copyright 2017 The LUCI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

service: logs
runtime: go
env: flex

resources:
  cpu: 2
  memory_gb: 4
  disk_size_gb: 10

automatic_scaling:
  min_num_instances: 4

inbound_services:
  - warmup

handlers:
- url: "/internal/*"
  script: _go_app
  secure: always
  login: admin

- url: "/.*"
  script: _go_app
  secure: always


# Have some more liberal health check parameters, as we've observed "nginx"
# timing out in production.
health_check:
  enable_health_check: True
  check_interval_sec: 5
  timeout_sec: 4
  # Stop accepting requests after 20 sec of unhealthiness.
  unhealthy_threshold: 4
  healthy_threshold: 1
  # Restart after 2 min of unhealthiness.
  restart_threshold: 24

Increase logs module min instances to 4 (from 2)
[logdog] Increase logs module min instances to 4 (from 2)

A bug described symptoms of not enough instances to serve log endpoints.
Because flex takes a longer time to spin up instances than classic,
it's more important to have idle instances ready to serve.

Bug: 910095
Change-Id: I2452fbfd73866321f63d10d57f74aaae9ce83fcb
Reviewed-on: https://chromium-review.googlesource.com/c/1355799
Commit-Queue: Ryan Tseng <2190fe9a39b4920ec7bd59c848ec5cccd163056f@chromium.org>
Reviewed-by: Andrii Shyshkalov <a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org>
