# Maximum number of tables in a cluster, std::bad\_alloc issue, dropping tables

**URL:** https://forum.scylladb.com/t/maximum-number-of-tables-in-a-cluster-std-bad-alloc-issue-dropping-tables/2335
**Category:** ScyllaDB
**Tags:** data-model, cdc, administration
**Created:** [July 21, 2024, 5:56am UTC](https://forum.scylladb.com/t/maximum-number-of-tables-in-a-cluster-std-bad-alloc-issue-dropping-tables/2335 "2024-07-21T05:56:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Guy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/guy/32/9_2.png) [@Guy](https://forum.scylladb.com/u/Guy)
#### Post date: [July 21, 2024, 5:56am UTC](https://forum.scylladb.com/t/maximum-number-of-tables-in-a-cluster-std-bad-alloc-issue-dropping-tables/2335/1 "2024-07-21T05:56:00Z")

</div>

> [@](#):
>
> [**Originally from the User Slack**](https://scylladb-users.slack.com/)
> 
> ![AmiSri](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/f/fee9ad3caf817f07bfb7ccdf9568af8d924bd46a.jpeg) **@AmiSri:** I am using Scylla version 5.4.3  
> I have 5882 tables till now  
> And recently I faced std::bad\_alloc and writes failed  
> Is there a limit of number of tables in a keyspace  
> Or limit of total number of tables in a cluster
> 
> How to overcome the issue??
> 
> ![Piotr_Smaroń](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/c7e93f1f72e94abeeb7572b9785f007b82cc7308.png) **@Piotr\_Smaroń:** It may be that you created too many tables within one KS, per the doc: [https://opensource.docs.scylladb.com/master/reference/limits.html](https://opensource.docs.scylladb.com/master/reference/limits.html), we “support” up to 5k tablets per KS
> 
> > Limits | ScyllaDB Docs
> 
> ![AmiSri](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/f/fee9ad3caf817f07bfb7ccdf9568af8d924bd46a.jpeg) **@AmiSri:** Yes its in a single keyspace with cdc enabled  
> Is this relevant for all versions of ScyllaDB??  
> @Piotr\_Smaroń
> 
> ![Piotr_Smaroń](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/c7e93f1f72e94abeeb7572b9785f007b82cc7308.png) **@Piotr\_Smaroń:** we’re not testing limits in each version, but you can assume they apply to the recent versions
> 
> ![AmiSri](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/f/fee9ad3caf817f07bfb7ccdf9568af8d924bd46a.jpeg) **@AmiSri:** On dropping the tables, i found load of only one node is seems to be reduced while load on all other nodes in the cluster is same as earlier.  
> I have cleared snapshots too
> 
> Is a repair or rebuild required??  
> What is the correct way to drop tables in a cluster??  
> @Piotr\_Smaroń
> 
> ![Piotr_Smaroń](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/c7e93f1f72e94abeeb7572b9785f007b82cc7308.png) **@Piotr\_Smaroń:** just DROP TABLE should be enough  
> if the disk is still full, you may take a look here [https://opensource.docs.scylladb.com/stable/troubleshooting/drop-table-space-up.html](https://opensource.docs.scylladb.com/stable/troubleshooting/drop-table-space-up.html)  
> Dropping tables doesn’t mean your load will decrease, for load to decrease you must lower the number of queries to the db. Perhaps the tables you dropped had partitions located only on a single node, and since you stopped querying these, your load for this single node has dropped
> 
> > Dropped (or truncated) Table (or keyspace) and Disk Space is not Reclaimed | ScyllaDB Docs
> 
> ![AmiSri](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/2X/f/fee9ad3caf817f07bfb7ccdf9568af8d924bd46a.jpeg) **@AmiSri:** This is a restore server and no quering is going on here, do you mean partition key  
> Please help me understanding “number of queries” mean
> 
> ![Piotr_Smaroń](https://us1.discourse-cdn.com/flex016/uploads/scylladb/original/1X/c7e93f1f72e94abeeb7572b9785f007b82cc7308.png) **@Piotr\_Smaroń:** by queries I meant both reading and writing to a database
