NOT_ENOUGH_SPACE error

1,636 views
Skip to first unread message

Leonardo Palomares

unread,
Aug 26, 2022, 9:22:35 AM8/26/22
to ClickHouse
Hi,
I'm pretty new with ClickHouse and 'm dealing with the following error whenever I try to insert a few millons of records in a table...
Code: 243. DB::Exception: Received from localhost:9000. DB::Exception: Cannot reserve 259.27 MiB, not enough space. (NOT_ENOUGH_SPACE)

The server have plenty of free memory (130Gb) and the data disk is just 1% used (brand new server).
ClickHouse version: 22.8.1.2097
so: Ubuntu 20.04

TIA,
Leo

Antonio Rodriguez

unread,
Aug 26, 2022, 9:59:56 AM8/26/22
to ClickHouse
Hi Leo,

Using clickhouse-client
Just before insert:
SET max_memory_usage=10000000000

If you are using a client external to CH server, you need to configure your client to add in the URL:  ?max_memory_usage=10000000000&...
If you are using DBeaver or DataGrip set as parameter

Kind regards,
Antonio

Antonio Rodriguez

unread,
Aug 26, 2022, 10:01:22 AM8/26/22
to ClickHouse
To do it permanent you could set in the user.xml for your user
<max_memory_usage>10000000000</max_memory_usage>

Leonardo Palomares

unread,
Aug 26, 2022, 10:47:07 AM8/26/22
to ClickHouse
Monday morning first thing to try. Thank you so much Antonio!

Have a nice weekend,
Leo

Leonardo Palomares

unread,
Aug 29, 2022, 7:58:37 AM8/29/22
to ClickHouse
Antonio, it worked like a charm!
Thank you so much for your help.

KR,
Leo

Wasim Ismail

unread,
Feb 16, 2023, 5:12:38 PM2/16/23
to ClickHouse
Hi Antonio and rest,

I am using dbeaver and adding this as part of the URL or as additional User Properties is not working.
Can you show me how to add it as parameters in DBeaver, interestingly if I use a clickhouse connection with a named session and then set these parameters that works,
Cant get it to work in dbeaver

Thanks in advance

Wasim Ismail

unread,
Feb 27, 2023, 4:11:31 PM2/27/23
to ClickHouse
Any ideas on this?

Leonardo Palomares

unread,
Feb 28, 2023, 4:31:09 AM2/28/23
to ClickHouse
Hi,

I configured it in Clickhouse itself for all users (at the moment there are only two of us working with this enviroment, so it's more practical for me that way).
In clickhouse/config/users.d/users.xml add <max_memory_usage>10000000000</max_memory_usage>

<?xml version="1.0"?>
<clickhouse>
   <users>
        <default>
            <max_memory_usage>10000000000</max_memory_usage>
        </default>
   </users>
</clickhouse>

I hope this helps you and I'm sorry I didn't reply sooner but I was on vacation.

KR,
Leo

Wasim Ismail

unread,
Feb 28, 2023, 12:36:44 PM2/28/23
to ClickHouse
Thanks! I will see if I can modify for the Clickhouse instance at my org.
Reply all
Reply to author
Forward
0 new messages