Hi, I am trying to deploy ClickHouse database using custom docker file. When the config file is empty, the deployment is happening well and I am able to use the database. When I add any configurations (as recommended by ClickHouse for lower memory usage Usage Recommendations | ClickHouse Docs ) I am getting Out of memory issue and unable to use the database as the server is unable to run due to OOM. What is the cause of this issue? Please guide me add these configs using custom docker .
Attaching logs here :2025-09-16T10:20:51Z app[080e6e4f543968] sin [info] INFO Checking filesystem on /var/lib/clickhouse
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info]/dev/vdc: clean, 6375/261120 files, 44370/1047552 blocks
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info] INFO Mounting /dev/vdc at /var/lib/clickhouse w/ uid: 101, gid: 101 and chmod 0755
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info] INFO Resized /var/lib/clickhouse to 4290772992 bytes
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info] INFO Preparing to run: `/entrypoint.sh` as clickhouse
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info] INFO [fly api proxy] listening at /.fly/api
2025-09-16T10:20:51Z runner[080e6e4f543968] sin [info]Machine started in 1.123s
2025-09-16T10:20:51Z app[080e6e4f543968] sin [info]2025/09/16 10:20:51 INFO SSH listening listen_address=[fdaa:1a:aa0a:a7b:fe:e4ad:7e3d:2]:22
2025-09-16T10:21:01Z runner[080e6e4f543968] sin [info]Pulling container image registry.fly.io/clickhouse-snow-2683@sha256:d4abba2bc5c74cdc5bf3d2f1aa85fdb8797f3c2e51035764062d178046788f3c
2025-09-16T10:21:04Z runner[080e6e4f543968] sin [info]Successfully prepared image registry.fly.io/clickhouse-snow-2683@sha256:d4abba2bc5c74cdc5bf3d2f1aa85fdb8797f3c2e51035764062d178046788f3c (2.724769822s)
2025-09-16T10:21:04Z runner[080e6e4f543968] sin [info]Setting up volume ‘clickhouse_data’
2025-09-16T10:21:04Z runner[080e6e4f543968] sin [info]Opening encrypted volume
2025-09-16T10:21:04Z runner[080e6e4f543968] sin [info]Configuring firecracker
2025-09-16T10:21:04Z app[080e6e4f543968] sin [info] INFO Sending signal SIGINT to main child process w/ PID 642
2025-09-16T10:21:05Z app[080e6e4f543968] sin [info]/entrypoint.sh: neither CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD is set, disabling network access for user ‘default’
2025-09-16T10:21:05Z app[080e6e4f543968] sin [info]ClickHouse Database directory appears to contain a database; Skipping initialization
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info]Processing configuration file ‘/etc/clickhouse-server/config.xml’.
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info]Merging configuration file ‘/etc/clickhouse-server/config.d/docker_related_config.xml’.
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info]Merging configuration file ‘/etc/clickhouse-server/config.d/low-memory-config.xml’.
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info]Logging trace to /dev/stdout
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info] INFO Sending signal SIGTERM to main child process w/ PID 642
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info] INFO Main child exited with signal (with signal ‘SIGTERM’, core dumped? false)
2025-09-16T10:21:06Z app[080e6e4f543968] sin [info] INFO Starting clean up.
2025-09-16T10:21:07Z app[080e6e4f543968] sin [info] INFO Umounting /dev/vdc from /var/lib/clickhouse
2025-09-16T10:21:07Z app[080e6e4f543968] sin [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-09-16T10:21:07Z app[080e6e4f543968] sin [info][ 16.823068] reboot: Restarting system
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info]2025-09-16T10:21:08.020731853 [01K590NH1NW0SEEM1459D47Z7T:main] Running Firecracker v1.12.1
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info]2025-09-16T10:21:08.020879926 [01K590NH1NW0SEEM1459D47Z7T:main] Listening on API socket (“/fc.sock”).
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO Starting init (commit: 31d31a51)…
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO Checking filesystem on /var/lib/clickhouse
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info]/dev/vdc: clean, 6375/261120 files, 44370/1047552 blocks
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO Mounting /dev/vdc at /var/lib/clickhouse w/ uid: 101, gid: 101 and chmod 0755
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO Resized /var/lib/clickhouse to 4290772992 bytes
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO Preparing to run: `/entrypoint.sh` as clickhouse
2025-09-16T10:21:08Z app[080e6e4f543968] sin [info] INFO [fly api proxy] listening at /.fly/api
2025-09-16T10:21:09Z runner[080e6e4f543968] sin [info]Machine created and started in 7.616s
2025-09-16T10:21:09Z app[080e6e4f543968] sin [info]2025/09/16 10:21:09 INFO SSH listening listen_address=[fdaa:1a:aa0a:a7b:fe:e4ad:7e3d:2]:22
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]2025/09/16 10:21:17 INFO New SSH session email=puneeth.kumar@codemancers.com verified=true
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]/entrypoint.sh: neither CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD is set, disabling network access for user ‘default’
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]ClickHouse Database directory appears to contain a database; Skipping initialization
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]Processing configuration file ‘/etc/clickhouse-server/config.xml’.
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]Merging configuration file ‘/etc/clickhouse-server/config.d/docker_related_config.xml’.
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]Merging configuration file ‘/etc/clickhouse-server/config.d/low-memory-config.xml’.
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]Logging trace to /var/log/clickhouse-server/clickhouse-server.log
2025-09-16T10:21:17Z app[080e6e4f543968] sin [info]Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
2025-09-16T10:23:44Z runner[080e6e4f543968] sin [info]Pulling container image docker-hub-mirror.fly.io/library/clickhouse@sha256:4643fe917573fe06f4c8dd4dfadef5d3ebe7151ed4b96f611c61d763e3748ebf
2025-09-16T10:23:44Z runner[080e6e4f543968] sin [info]Container image docker-hub-mirror.fly.io/library/clickhouse@sha256:4643fe917573fe06f4c8dd4dfadef5d3ebe7151ed4b96f611c61d763e3748ebf already prepared
2025-09-16T10:23:44Z runner[080e6e4f543968] sin [info]Setting up volume ‘clickhouse_data’
2025-09-16T10:23:44Z runner[080e6e4f543968] sin [info]Opening encrypted volume
2025-09-16T10:23:44Z runner[080e6e4f543968] sin [info]Configuring firecracker
2025-09-16T10:23:44Z app[080e6e4f543968] sin [info] INFO Sending signal SIGINT to main child process w/ PID 638
2025-09-16T10:23:49Z app[080e6e4f543968] sin [info] INFO Sending signal SIGTERM to main child process w/ PID 638
2025-09-16T10:23:50Z app[080e6e4f543968] sin [info] INFO Main child exited normally with code: 143
2025-09-16T10:23:50Z app[080e6e4f543968] sin [info] INFO Starting clean up.
2025-09-16T10:23:50Z app[080e6e4f543968] sin [info] INFO Umounting /dev/vdc from /var/lib/clickhouse
2025-09-16T10:23:51Z app[080e6e4f543968] sin [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-09-16T10:23:51Z app[080e6e4f543968] sin [info][ 163.221583] reboot: Restarting system
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info]2025-09-16T10:23:52.031891782 [01K590TFW49T6BHXXXQZQGVF60:main] Running Firecracker v1.12.1
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info]2025-09-16T10:23:52.032011934 [01K590TFW49T6BHXXXQZQGVF60:main] Listening on API socket (“/fc.sock”).
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info] INFO Starting init (commit: 31d31a51)…
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info] INFO Checking filesystem on /var/lib/clickhouse
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info]/dev/vdc: clean, 2909/261120 files, 35584/1047552 blocks
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info] INFO Mounting /dev/vdc at /var/lib/clickhouse w/ uid: 0, gid: 0 and chmod 0755
2025-09-16T10:23:52Z app[080e6e4f543968] sin [info] INFO Resized /var/lib/clickhouse to 4290772992 bytes
2025-09-16T10:23:53Z app[080e6e4f543968] sin [info] INFO Preparing to run: `/entrypoint.sh` as root
2025-09-16T10:23:53Z app[080e6e4f543968] sin [info] INFO [fly api proxy] listening at /.fly/api
2025-09-16T10:23:53Z runner[080e6e4f543968] sin [info]Machine created and started in 9.086s
2025-09-16T10:23:53Z app[080e6e4f543968] sin [info]2025/09/16 10:23:53 INFO SSH listening listen_address=[fdaa:1a:aa0a:a7b:fe:e4ad:7e3d:2]:22
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]/entrypoint.sh: neither CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD is set, disabling network access for user ‘default’
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]ClickHouse Database directory appears to contain a database; Skipping initialization
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]Processing configuration file ‘/etc/clickhouse-server/config.xml’.
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]Merging configuration file ‘/etc/clickhouse-server/config.d/docker_related_config.xml’.
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]Logging trace to /var/log/clickhouse-server/clickhouse-server.log
2025-09-16T10:24:01Z app[080e6e4f543968] sin [info]Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log


