Categorygithub.com/Harichandra-Prasath/GO-WorkerPool
modulepackage
0.0.0-20241123145940-22cad4a90962
Repository: https://github.com/harichandra-prasath/go-workerpool.git
Documentation: pkg.go.dev

# README

WorkerPool

This is a WorkerPool Implementation in golang with Auto Scaling.

Key Features

  1. One can set the max workers and min workers for auto scaling.
  2. If there are more jobs than workers, and less workers than max workers, new worker will be spawned to take up the job.
  3. If there are inactive workers and total workers is greater than min workers, inactive workers will be scaled down till min workers.
  4. Workers run concurrently and Isolated.
  5. For a incoming job, random available worker will be chosen.

Scaling Up

image

Scaling Down

image

Results

N_JOBSJOB_TIMEN_GOROUTINESN/2_WORKERS
1000000500 ms2.052139768 s1.369614837 s
500000500 ms1.358096717 s1.160396269 s
100000500 ms681.6893570 ms1.039766089 s
1000000700 ms2.344755774 s1.758263126 s
500000700 ms1.635180000 s1.582455652 s
100000700 ms925.170906 ms1.44006322 s

The above results are obtained with no auto scaling. The efficiency may be improved by enabling auto scaling for low amount of tasks and long running parrallel tasks.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
check for the incoming job.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author