Gabitzuu / redis-sharder

Scalable and robust sharding solution for the Eris discord library. Manages allocating and connecting hundreds of shards.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redis-sharder

Redis sharder is a great solution for sharding with Eris. Managing shards for your large discord bot can be a major headache but with Redis Sharder all you need to do is code your bot and not worry about the issues of spawning and managing tons of shards. Redis Sharder is almost a drop in replacement and uses Eris's internal sharding. Redis sharder is not a clustering solution. You will need to cluster your bot yourself via some means or a process manager.

Clustering Solutions

  • Kubernetes
  • Docker Swarm
  • PM2 Clustering
  • NodeJS Cluster Module

Users of Redis Sharder:

As of 6/14/2020.

Name Guild Count Shard Count
Arcane 74,000 96
Server Captcha Bot 24,000 35

Help

Join our discord. We expect you to know how to code. We will not spoonfeed you. Definitely look through the src of redis sharder so you can view some of the utilities it provides.

Installation

  • Add redis-sharder to your project. npm install @arcanebot/redis-sharder
  • Install and secure Redis on your machine. Redis Sharder requires redis to be secured with a password to use any eval functions because Redis is used for Pub Sub. PLEASE USE AUTHORIZATION!

Stats

<client>.getStats() outputs a Stats object. Use this over <client>.guilds.size.

{
  guilds: 9,
  users: 4099,
  estimatedTotalUsers: 4144,
  voice: 0,
  shards: [ { status: 'ready', id: 0, latency: 74, guilds: 9 } ],
  memoryUsage: { heapUsed: 27908672, rss: 83640320 },
  clusters: [
    {
      id: 0,
      shards: [Array],
      guilds: 9,
      users: 4099,
      voice: 0,
      memoryUsage: [Object],
      uptime: 229
    }
  ]
}

About

Scalable and robust sharding solution for the Eris discord library. Manages allocating and connecting hundreds of shards.


Languages

Language:TypeScript 92.1%Language:JavaScript 7.9%