Size: a a a

ClickHouse не тормозит

2020 September 20

И

Иван in ClickHouse не тормозит
Denny Crane [not a Yandex bot]
я думаю когда допилят в КХ S3, это будет уже рукой подать до Snowflake
А как же кредиты за выполнение запросов и вот это всё, там же именно за БД как сервис ты платишь, а не за выделенный инстанс. Хотя я мб что-то не знаю про snowflake
источник

D

Dj in ClickHouse не тормозит
Denny Crane [not a Yandex bot]
вот интересно, в оракле хинтами легко with xxx as select /*+materialize*/ получаем временную таблицу xxx, а не подстановку в запрос, в PG как оно? синтаксис особый или вообще никак?
https://stackoverflow.com/a/52380725
хотя тут написано наоборот. WITH - всегда материализуется
источник

И

Иван in ClickHouse не тормозит
Это скорее exasol хипстерский + в облаке
источник

D

Dj in ClickHouse не тормозит
Иван
А как же кредиты за выполнение запросов и вот это всё, там же именно за БД как сервис ты платишь, а не за выделенный инстанс. Хотя я мб что-то не знаю про snowflake
да, CPU время на запросы посчитать несложно на самом деле, даже из тех же метрик/логов
источник

D

Dj in ClickHouse не тормозит
Denny Crane [not a Yandex bot]
вот интересно, в оракле хинтами легко with xxx as select /*+materialize*/ получаем временную таблицу xxx, а не подстановку в запрос, в PG как оно? синтаксис особый или вообще никак?
источник
2020 September 21

R

RapidCodeLab in ClickHouse не тормозит
Приветствую, подскажите coalesce(avgIf(field, field2=1), 0)  as result получаю все равно null,  avgIf(field, field2=1) = null а хочу 0 , почему coalesce не работает, или я не понимаю как он должен работать?)
источник

S

Slach in ClickHouse не тормозит
ох блин =) НУ ПОЧЕМУ на nodejs ;)
Большое спасибо за ссылку
источник

A

Alexandr in ClickHouse не тормозит
Slach
ох блин =) НУ ПОЧЕМУ на nodejs ;)
Большое спасибо за ссылку
ну пардон. Вообще-то это POC, он сейчас переписывается на go, примерно через неделю будет бета
источник

S

Slach in ClickHouse не тормозит
Sergey M
Подскажите, не могу понять.
Поставил виртуалку на виртуалбокс.
Поставил убунту.
Поставил clickhouse
Все отлично, localhost:8123 - ok

Интернет есть, пинги идут
Но хочу к кликхаузу обращаться из винды и через 192.168.x.xx:8123 не видит.

Причем внутри виртуалки только  localhost видит, 192.168.x.xx:8123 тоже не видит.

Конфиг какой то надо поправить?
grep -r listen /etc/clickhouse-server/
источник

S

Slach in ClickHouse не тормозит
Alexandr
ну пардон. Вообще-то это POC, он сейчас переписывается на go, примерно через неделю будет бета
О! а вы разработчик?
просто на go оно логичнее конечно. потому что можно кодовую базу оригинального loki использовать
Большое человеческое СПАСИБО вам и низкий поклон за ваши усилия тогда! Прямо мега клевая штука для clickhouse ;)

ребятам из flant надо будет показать. чтобы туда еще научиться логи складывать из kubernetes
вообще огонь будет
источник

A

Alexandr in ClickHouse не тормозит
Slach
О! а вы разработчик?
просто на go оно логичнее конечно. потому что можно кодовую базу оригинального loki использовать
Большое человеческое СПАСИБО вам и низкий поклон за ваши усилия тогда! Прямо мега клевая штука для clickhouse ;)

ребятам из flant надо будет показать. чтобы туда еще научиться логи складывать из kubernetes
вообще огонь будет
на ноде было шустрее, но логично что go будет лучше для совместимости, да и драйвер для CH у го в разы лучше, так как нативный, а не обёртка вокруг HTTP
источник

DV

Dmitry Vasiliev in ClickHouse не тормозит
$ kubectl logs -n observability   clickhouse-logs-0  -c clickhouse  -f
Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Not found: logger.log (version 20.5.3.27 (official build))
dirname: missing operand
Try 'dirname --help' for more information.
Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Not found: logger.errorlog (version 20.5.3.27 (official build))
dirname: missing operand
Try 'dirname --help' for more information.
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
Include not found: clickhouse_compression
Logging information to console
2020.09.21 07:00:48.502648 [ 34 ] {} <Information> : Starting ClickHouse 20.5.3.27 with revision 54435, build id: 5820B4CE93C60E3C, PID 34
2020.09.21 07:00:48.504722 [ 34 ] {} <Information> Application: starting up
2020.09.21 07:00:48.509153 [ 34 ] {} <Information> Application: It looks like the process has no CAP_IPC_LOCK capability, binary mlock will be disabled. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_ipc_lock=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.
2020.09.21 07:00:48.509968 [ 34 ] {} <Information> StatusFile: Status file /var/lib/clickhouse/status already exists - unclean restart. Contents:
PID: 34
Started at: 2020-09-21 06:59:28
Revision: 54435
Include not found: networks
2020.09.21 07:00:48.513564 [ 34 ] {} <Information> Application: Setting max_server_memory_usage was set to 27.57 GiB
2020.09.21 07:00:48.513577 [ 34 ] {} <Information> Application: Loading metadata from /var/lib/clickhouse/
2020.09.21 07:00:48.515749 [ 34 ] {} <Information> DatabaseOrdinary (system): Total 7 tables and 0 dictionaries.
2020.09.21 07:00:48.516635 [ 46 ] {} <Information> BackgroundProcessingPool: Create BackgroundProcessingPool with 16 threads
2020.09.21 07:00:48.644432 [ 34 ] {} <Information> DatabaseOrdinary (system): Starting up tables.
2020.09.21 07:00:48.646641 [ 34 ] {} <Information> DatabaseOrdinary (default): Total 0 tables and 0 dictionaries.
2020.09.21 07:00:48.646658 [ 34 ] {} <Information> DatabaseOrdinary (default): Starting up tables.
2020.09.21 07:00:48.651629 [ 34 ] {} <Information> DatabaseOrdinary (logs): Total 19 tables and 0 dictionaries.
2020.09.21 07:00:53.693814 [ 68 ] {} <Information> DatabaseOrdinary (logs): 73.6842105263158%
ClickHouse init process failed.

подскажите пожалуйста почему не может стартануть (обычный рестарт)?
источник

S

Slach in ClickHouse не тормозит
Dmitry Vasiliev
$ kubectl logs -n observability   clickhouse-logs-0  -c clickhouse  -f
Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Not found: logger.log (version 20.5.3.27 (official build))
dirname: missing operand
Try 'dirname --help' for more information.
Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Not found: logger.errorlog (version 20.5.3.27 (official build))
dirname: missing operand
Try 'dirname --help' for more information.
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
Include not found: clickhouse_compression
Logging information to console
2020.09.21 07:00:48.502648 [ 34 ] {} <Information> : Starting ClickHouse 20.5.3.27 with revision 54435, build id: 5820B4CE93C60E3C, PID 34
2020.09.21 07:00:48.504722 [ 34 ] {} <Information> Application: starting up
2020.09.21 07:00:48.509153 [ 34 ] {} <Information> Application: It looks like the process has no CAP_IPC_LOCK capability, binary mlock will be disabled. It could happen due to incorrect ClickHouse package installation. You could resolve the problem manually with 'sudo setcap cap_ipc_lock=+ep /usr/bin/clickhouse'. Note that it will not work on 'nosuid' mounted filesystems.
2020.09.21 07:00:48.509968 [ 34 ] {} <Information> StatusFile: Status file /var/lib/clickhouse/status already exists - unclean restart. Contents:
PID: 34
Started at: 2020-09-21 06:59:28
Revision: 54435
Include not found: networks
2020.09.21 07:00:48.513564 [ 34 ] {} <Information> Application: Setting max_server_memory_usage was set to 27.57 GiB
2020.09.21 07:00:48.513577 [ 34 ] {} <Information> Application: Loading metadata from /var/lib/clickhouse/
2020.09.21 07:00:48.515749 [ 34 ] {} <Information> DatabaseOrdinary (system): Total 7 tables and 0 dictionaries.
2020.09.21 07:00:48.516635 [ 46 ] {} <Information> BackgroundProcessingPool: Create BackgroundProcessingPool with 16 threads
2020.09.21 07:00:48.644432 [ 34 ] {} <Information> DatabaseOrdinary (system): Starting up tables.
2020.09.21 07:00:48.646641 [ 34 ] {} <Information> DatabaseOrdinary (default): Total 0 tables and 0 dictionaries.
2020.09.21 07:00:48.646658 [ 34 ] {} <Information> DatabaseOrdinary (default): Starting up tables.
2020.09.21 07:00:48.651629 [ 34 ] {} <Information> DatabaseOrdinary (logs): Total 19 tables and 0 dictionaries.
2020.09.21 07:00:53.693814 [ 68 ] {} <Information> DatabaseOrdinary (logs): 73.6842105263158%
ClickHouse init process failed.

подскажите пожалуйста почему не может стартануть (обычный рестарт)?
grep -r logger /etc/clickhouse-server
поглядите
посмотрите что там написано, выглядит как какие то косяки в конфиге
такое ощущение что пытались логирование перенастроить или ссылается кто-то в /metadata/*/*.sql на таблицы которые не существуют

вообще лучше глянуть в /var/log/clickhouse/clickhouse-server.err.log
только PV для /var/log/clickhouse/ сделайте
источник

S

Slach in ClickHouse не тормозит
Народ, кстати. а никто не помнит? Вроде же была какая то утилитка типа clickhouse-bench
которой можно SQL скормить и она его запустит сколько то раз и дальше время покажет?
источник

S

Slach in ClickHouse не тормозит
clickhouse-benchmark
сам спросил сам ответил
источник

DV

Dmitry Vasiliev in ClickHouse не тормозит
Slach
grep -r logger /etc/clickhouse-server
поглядите
посмотрите что там написано, выглядит как какие то косяки в конфиге
такое ощущение что пытались логирование перенастроить или ссылается кто-то в /metadata/*/*.sql на таблицы которые не существуют

вообще лучше глянуть в /var/log/clickhouse/clickhouse-server.err.log
только PV для /var/log/clickhouse/ сделайте
конфиг не меняли, с ним он и работал,
я перенаправляю все в stdout/stderr:
<logger>
   <level>information</level>
   <console>1</console>
</logger>


включил debug:
2020.09.21 07:09:41.819732 [ 75 ] {} <Debug> logs.envoy: Loading mutation: mutation_237046.txt entry, commands size: 1
2020.09.21 07:09:41.821255 [ 75 ] {} <Debug> logs.envoy: Loading mutation: mutation_654399.txt entry, commands size: 1
2020.09.21 07:09:41.822902 [ 75 ] {} <Debug> logs.envoy: Loading mutation: mutation_1060891.txt entry, commands size: 1
2020.09.21 07:09:41.824608 [ 75 ] {} <Debug> logs.envoy: Loading mutation: mutation_113951.txt entry, commands size: 1
ClickHouse init process failed.
dmitry.vasiliev@production-kubeops-1:~$
источник

DV

Dmitry Vasiliev in ClickHouse не тормозит
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.797634 [ 72 ] {} <Debug> SystemLog (system.metric_log): Will use existing table system.metric_log for MetricLog
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.799775 [ 72 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 214.03 GiB.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801415 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Selected 2 parts from 202009_643424_644132_158 to 202009_644133_644133_0
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801447 [ 52 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 214.03 GiB.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801471 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Merging 2 parts: from 202009_643424_644132_158 to 202009_644133_644133_0 into Wide
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801708 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Selected MergeAlgorithm: Horizontal
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.896353 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Merge sorted 5350 rows, containing 235 columns (235 merged, 0 gathered) in 0.09487751 sec., 56388.49501847171 rows/sec., 100.56 MiB/sec.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.912282 [ 52 ] {} <Debug> MemoryTracker: Peak memory usage: 270.12 MiB.
Sep 21 07:19:02 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: ClickHouse init process failed.
источник

S

Sergey in ClickHouse не тормозит
@milovidov_an подскажите пожалуйста где можно почитать какие останутся потенциальные возможности по потере данных после реализации WAL+fsync в clickhouse?
источник

AE

A E in ClickHouse не тормозит
Denny Crane [not a Yandex bot]
Memory limit (for query) exceeded:  -- maximum: 488.28 MiB
это однозначно указывает max_memory_usage не 200G, а 488.28

от пользователя которому прилетела ошибка  select * from system.settings where name = 'max_memory_usage'
Спасибо. Проверю. Я верно понимаю что это лимит на какого-то пользака срабатывает?
источник

DV

Dmitry Vasiliev in ClickHouse не тормозит
Dmitry Vasiliev
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.797634 [ 72 ] {} <Debug> SystemLog (system.metric_log): Will use existing table system.metric_log for MetricLog
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.799775 [ 72 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 214.03 GiB.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801415 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Selected 2 parts from 202009_643424_644132_158 to 202009_644133_644133_0
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801447 [ 52 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 214.03 GiB.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801471 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Merging 2 parts: from 202009_643424_644132_158 to 202009_644133_644133_0 into Wide
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.801708 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Selected MergeAlgorithm: Horizontal
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.896353 [ 52 ] {} <Debug> system.metric_log (MergerMutator): Merge sorted 5350 rows, containing 235 columns (235 merged, 0 gathered) in 0.09487751 sec., 56388.49501847171 rows/sec., 100.56 MiB/sec.
Sep 21 07:18:58 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: 2020.09.21 07:18:58.912282 [ 52 ] {} <Debug> MemoryTracker: Peak memory usage: 270.12 MiB.
Sep 21 07:19:02 ip-172-31-93-85.ap-southeast-1.compute.internal c53bd36c8226[4837]: ClickHouse init process failed.
# check if clickhouse is ready to accept connections
   # will try to send ping clickhouse via http_port (max 12 retries, with 1 sec delay)
   if ! wget --spider --quiet --prefer-family=IPv6 --tries=12 --waitretry=1 --retry-connrefused "http://localhost:$HTTP_PORT/ping" ; then
       echo >&2 'ClickHouse init process failed.'
       exit 1
   fi

у меня в /docker-entrypoint-initdb.d/init-db.sh была долгая команда
источник