Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loadigo

Simple load balancer with Go, Inspired by traefik

Supported Load Balancing Algorithms

  • P2C: Power of Two Choices
  • WRR: Weighted Round Robin
  • RR: Round Robin

Directory Structure

.
├── main.go                  # 로드밸런서 엔트리포인트 (p2c 사용 예시)
├── backend/
│   ├── backend.go           # Backend 인터페이스
│   ├── p2c/                 # Power of Two Choices
│   ├── rr/                  # Round Robin
│   └── wrr/                 # Weighted Round Robin
└── example/
    └── multi_server/        # 테스트용 에코 서버 (8081~8085)

Known Issues

  • wrr: AddServer calls heap.Push (which already appends to lb.servers) and then appends the same backend again. Each backend ends up in the heap twice, and the second append bypasses the heap invariant.
  • wrr: nextServer loops forever when every backend is unhealthy. It needs a nil-return path like rr and p2c.
  • rr / wrr / p2c: CheckServerStatus iterates lb.status without holding the lock, racing with AddServer and with its own writes.
  • p2c: AddServer declares a local variable named backend, shadowing the imported backend package.
  • wrr / p2c: the current field on loadBalancer is unused.

About

Simple load balancer with Go, Inspired by traefik

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages