Skip to content
DeRauk Gibble edited this page Sep 28, 2021 · 5 revisions

How fast is Faktory?

A simple setup with one Go worker process running 20 threads on my laptop can produce and consume over 5000 jobs/sec steadily. I've done no profiling and optimization yet so I suspect that can be improved. Help welcome.

How does Faktory compare to other background job systems?

Faktory has several advantages:

  • It's language agnostic - you can run worker processes in any language you want. If your business goes polyglot, Faktory can too.
  • It's designed for real-world business apps - you write the jobs, it gives you error handling, the retry process and a very useful Web UI.
  • It's all built in - one server binary manages it all: data storage, web UI, etc. No other dependencies; just run a worker process to execute jobs.

How do I test my project with Faktory?

faktory_worker_ruby and faktory_worker_go both have Travis-CI set ups for running your test suite against a real Faktory. They do this by running the official contribsys/faktory Docker image.

What does Faktory do when a worker does not send the heartbeat?

  1. If a worker process FETCHes a job, it has 30 minutes by default to ACK that job.
  2. If the process dies, Faktory doesn't know that. All Faktory knows within one minute is that the process has not sent a heartbeat. It might be alive (network dropped) or it might be dead (process crashed).
  3. Since the process might still be alive, Faktory sticks with (1) and does not immediately clear the Busy tab. The network can come back up, the worker process ACK the job and all will be well.
  4. After 30 minutes, Faktory will reclaim the job and put it into the Retry set so the job can be retried in the future. This "reservation reaper" runs every 15 seconds.