OpenFeign / OpenFeign/feign

Performance discussion about default openfeign client

Open
#2,267 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feedback provided regression
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

Resume
Discussion about default client performance of spring-cloud-openfeign

Versions
Java 17
Springboot 2.7.18
spring-cloud-dependencies 2021.0.8

Scenario

During a performance tests in a microservice that contain a 3 feign clients, it was possible to saw a high GC usage (i.e. high cpu utilization as well) in two methods, as we can see at profiler image bellow

profiler-onlySpringCloudFeign

We have a high tps scenario here - 110tps. The situation was absolutely unstable and we has too much resources to handle with that.

After studying the issue I decided to use lib {io.github.openfeign:feign-httpclient:11.8} and do a new evaluation. To my surprise, we had a significant improvement in resource usage, as feign started using other classes and no longer generated as many objects, as shown bellow

springCloudFeign-httpClient

So, my question: Is this the expected behavior of the default implementation or is there something I did incorrectly, because we've a big difference here.

Code

I don't have a high customization clients, only a custom decoder and base64 auth, as bellow

@FeignClient(value = "...", url = "...",
        configuration = ClientConfig.class)
public interface .. {

    @PostMapping("..")
    SpecificObject post(
            @RequestHeader("..") Boolean ..,
            @RequestBody SpecificObject ..
    );
}

image

basicAuthInterceptor

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the default client path used by spring-cloud-openfeign under Java 17, Spring Boot 2.7.18, and spring-cloud-dependencies 2021.0.8, then compare a 110 TPS run with feign-httpclient 11.8. Use the profiler evidence and the stated custom decoder and basic-auth configuration to isolate the allocation difference. Done means a reproducible explanation of whether the default behavior is expected and a documented conclusion or actionable change.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.