D.JS v14 - Is the shardCount client option good to use?
I am using TypeScript, so I cant use the shard manager cause it will need me to transpile back to JS. Is this client option a viable and good one to use for sharding?
12 Replies
ShardingManager should work just fine with typescript
You have to transpile back to JS either way, as node can't run TS.
You can use
shards
with 'auto'
to spawn all shards in process; Will only get you so far though.You can also just use internal sharding with
shards: 'auto'
I mean it is absolutely fine to use internal sharding till 20k guilds
It may start to break after that as in performanceI'm using ts-node.
^
ts-node is not a code transpiler it's more of a REPL, it's better to use something like tsup if you really have to
I will look into tsup
You could also use worker sharding, which will run shards in separate threads instead of processes.
compiling with TSC is fine right?
It's the preferred method
i had found this package some days ago and wonder if it is a good idea to implement: https://www.npmjs.com/package/discord-hybrid-sharding
npm
discord-hybrid-sharding
The first package which combines sharding manager & internal sharding to save a lot of resources, which allows clustering!. Latest version: 1.6.7, last published: 2 days ago. Start using discord-hybrid-sharding in your project by running
npm i discord-hybrid-sharding
. There are no other projects in the npm registry using discord-hybrid-sharding.You probably won't require it unless you are in more than 20k guilds
alright, thanks anyway