ClickHouse: Timeout exceeded while receiving data from client
We are connecting to click house through go library and we have 5 threads which are inserting data in batches using the multiple insert method
We are inserting around 1000 records per batch and we have 5 batches running at any point in time. We are seeing the following exception every 10-20 minutes.
2018.08.08 17:40:02.658716 [ 28 ] <Error> ServerErrorHandler: Code: 210, e.displayText() = DB::NetException: Connection reset by peer: while reading from socket (127.0.0.1:49066), e.what() = DB::NetException, Stack trace:
0. /usr/bin/clickhouse-server(StackTrace::StackTrace()+0x16) [0x56d1436]
1. /usr/bin/clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)+0x22) [0x510bcd2]
2. /usr/bin/clickhouse-server(DB::ReadBufferFromPocoSocket::nextImpl()+0x248) [0x56ee2b8]
3. /usr/bin/clickhouse-server(DB::TCPHandler::runImpl()+0x57a) [0x2dc4dca]
4. /usr/bin/clickhouse-server(DB::TCPHandler::run()+0x2b) [0x2dc5acb]
5. /usr/bin/clickhouse-server(Poco::Net::TCPServerConnection::start()+0xf) [0x58c56af]
6. /usr/bin/clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0x16a) [0x58c5a8a]
7. /usr/bin/clickhouse-server(Poco::PooledThread::run()+0x77) [0x5966e97]
8. /usr/bin/clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x38) [0x5962d58]
9. /usr/bin/clickhouse-server() [0x938cc0f]
10. /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7fd3183cd6ba]
11. /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fd317bf641d]
2018.08.09 05:27:21.728982 [ 22 ] <Error> executeQuery: Code: 209, e.displayText() = DB::Exception: Timeout exceeded while receiving data from client. Waited for 300 seconds, timeout is 300 seconds., e.what() = DB::Exception (from 127.0.0.1:51130) (in query: INSERT into test.data (eventDate, eventDateTime, projectId, url, duration) VALUES), Stack trace:
0. /usr/bin/clickhouse-server(StackTrace::StackTrace()+0x16) [0x56d1436]
1. /usr/bin/clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)+0x22) [0x2db80f2]
2. /usr/bin/clickhouse-server(DB::TCPHandler::readData(DB::Settings const&)+0x2cd) [0x2dc43ad]
3. /usr/bin/clickhouse-server(DB::TCPHandler::processInsertQuery(DB::Settings const&)+0x206) [0x2dc4646]
4. /usr/bin/clickhouse-server(DB::TCPHandler::runImpl()+0x477) [0x2dc4cc7]
5. /usr/bin/clickhouse-server(DB::TCPHandler::run()+0x2b) [0x2dc5acb]
6. /usr/bin/clickhouse-server(Poco::Net::TCPServerConnection::start()+0xf) [0x58c56af]
7. /usr/bin/clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0x16a) [0x58c5a8a]
8. /usr/bin/clickhouse-server(Poco::PooledThread::run()+0x77) [0x5966e97]
9. /usr/bin/clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x38) [0x5962d58]
10. /usr/bin/clickhouse-server() [0x938cc0f]
11. /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7fd3183cd6ba]
12. /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fd317bf641d]
Any thoughts on why this is happening?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (2 by maintainers)
Commits related to this issue
- don't use clz4 tag (native lz4 for clickhouse) - leads to https://github.com/ClickHouse/ClickHouse/issues/2833 — committed to JetBrains/ij-perf-report-aggregator by develar 5 years ago
@develar It worked! How brilliant you are! Thank you again. I create a clickhouse-client.xml file in current path, and write these in it.
And use this commond.
And, the file!
And I check in system table. variables are changed too.

@kshvakov I have the same problem, we are connecting to clickhouse through python library.
They key point to solve it on client side, we can specify CLI client related config values in
/etc/clickhouse-client/conf.d/custom.xml:or pass it as parameter to your connection string if you are using a library/client to connect: e.g. for clickhouse-driver python client, we can use
send_receive_timeoutparameter `