Skip to content

Commit

Permalink
GitBook: [#140] No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
manast authored and gitbook-bot committed Feb 3, 2023
1 parent a104eb1 commit 35d0147
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/gitbook/guide/going-to-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Even though persistence is very fast, it will have some effect on performance, s

Redis is used quite often as a cache, meaning that it will remove keys according to some defined policy when it reaches several levels of memory consumption. BullMQ on the other hand cannot work properly if Redis evicts keys arbitrarily. Therefore is very important to configure the `maxmemory` setting to `noeviction`. This is the **only** setting that guarantees the correct behavior of the queues.

### Automatic reconnections



### Gracefully shut-down workers

Since your workers will run on servers, it is unavoidable that these servers will need to be restarted from time to time. As your workers may be processing jobs when the server is about to restart, it is important to properly close the workers to minimize the risk of stalled jobs. If a worker is killed without waiting for their jobs to complete, these jobs will be marked as stalled and processed automatically when new workers come online (with a waiting time of about 30 seconds by default). However it is better to avoid having stalled jobs, and as mentioned this can be done by closing the workers when the server is going to be restarted. In NodeJS you can accomplish this by listening to the SIGINT signal like this:
Expand Down

0 comments on commit 35d0147

Please sign in to comment.