# Upstreams and failover

**URL:** <https://discuss.konghq.com/t/upstreams-and-failover/2724>\
**Category:** Questions\
**Created:** [January 30, 2019, 7:06pm UTC](https://discuss.konghq.com/t/upstreams-and-failover/2724 "2019-01-30T19:06:49Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![scortopassi](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@scortopassi](https://discuss.konghq.com/u/scortopassi)\
**Post date:** [October 31, 2019, 2:37pm UTC](https://discuss.konghq.com/t/upstreams-and-failover/2724/9 "2019-10-31T14:37:01Z")

</div>

Hi all, I’ve almost the same problem. I would like to share my kong.yml because in the end @likarev did not provide examples or configurations leading to this behaviour.

I have a service and a related upstream with two targets. To simulate failover, one target always gives 500 on a certain path, the other one 200. Targets have the same weight.  
If I send 100 requests I would like to receive all 200. Instead I receive between 3 and 15 500 errors, depending on how I change some values about retries, success, http\_failures and so on.

Here you are my configs:

```
_format_version: '1.1'

services:
- name: my-service
  host: my-upstream
  port: 8000
  protocol: http
  retries: 3
  routes:
  - name: my-route
    paths:
    - /

upstreams:
- name: my-upstream
  targets:
  - target: 192.168.3.23:10102
    weight: 50
  - target: 192.168.3.28:10102
    weight: 50
  healthchecks:
    active:
      concurrency: 100
      healthy:
        http_statuses:
        - 200
        - 302
        interval: 1
        successes: 1
      http_path: /testKong
      timeout: 1
      type: http
      unhealthy:
        http_failures: 3
        http_statuses:
        - 429
        - 404
        - 500
        - 501
        - 502
        - 503
        - 504
        - 505
        interval: 1
        tcp_failures: 3
        timeouts: 3
    passive:
      healthy:
        http_statuses:
        - 200
        - 201
        - 202
        - 203
        - 204
        - 205
        - 206
        - 207
        - 208
        - 226
        - 300
        - 301
        - 302
        - 303
        - 304
        - 305
        - 306
        - 307
        - 308
        successes: 1
      type: http
      unhealthy:
        http_failures: 1
        http_statuses:
        - 429
        - 500
        - 503
        tcp_failures: 1
        timeouts: 1
  slots: 100

```

Any suggestion? The two targets have the same weight, so (as far as I understand) 50% of requests go to the unhealthy server. But I do not receive 50 errors, much less. So, many requests are correctly redirected and some of them do not. Am i right?

Thanks

---

_[View the full topic](https://discuss.konghq.com/t/upstreams-and-failover/2724)._
