Title
#users-public
Jun Zhou

Jun Zhou

10/18/2022, 1:15 AM
Hi all, I encountered below error when querying table
gpdb_session_level_memory_consumption
. The questdb version is
6.5.3
.
db query error: pq: could not open read-only [file=/data/questdb/db/gpdb_session_level_memory_consumption/54764-09-05.15252/sample_time.d]
The questdb process
root      62155      1  2 Oct10 ?        03:54:28 ./questdb/bin/java -DQuestDB-Runtime-66535 -ea -Dnoebug -XX:ErrorFile=/data/questdb/db/hs_err_pid+%p.log -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch -XX:+UseParallelGC -p ./questdb/bin/questdb.jar -m io.questdb/io.questdb.ServerMain -d /data/questdb
File permissions
-rw-r--r--. 1 root root 16384 Oct 18 04:40 /data/questdb/db/gpdb_session_level_memory_consumption/54764-09-05.15252/sample_time.d
Andrey Pechkurov

Andrey Pechkurov

10/18/2022, 6:33 AM
Hi Jun
6:33 AM
Could you also share error message from the server-side log? It should include an error code
Jun Zhou

Jun Zhou

10/18/2022, 7:04 AM
Hi @Andrey Pechkurov, I upload the log, you can search the keywords 'could not' and there are many errors in the log. Thanks.
Andrey Pechkurov

Andrey Pechkurov

10/18/2022, 7:19 AM
$ tar -xzvf questdb.tgz
stdout-2022-10-10T11-28-00.txt

gzip: stdin: invalid compressed data--crc error

gzip: stdin: invalid compressed data--length error
tar: Skipping to next header
tar: Child returned status 1
tar: Error is not recoverable: exiting now
7:20 AM
there is something wrong with the archive
Jun Zhou

Jun Zhou

10/18/2022, 7:46 AM
I upload it, please try again.
Andrey Pechkurov

Andrey Pechkurov

10/18/2022, 8:18 AM
The error code is 24 - Too many open files. (https://questdb.io/docs/troubleshooting/os-error-codes/)
8:19 AM
You need to increase open files limits in the kernel: https://questdb.io/docs/operations/capacity-planning/#maximum-open-files
8:19 AM
While you're on it, I also suggest to increase max virtual memory areas limit: https://questdb.io/docs/operations/capacity-planning/#max-virtual-memory-areas-limit
Jun Zhou

Jun Zhou

10/18/2022, 8:32 AM
I increased open file limits and max virtual memory areas limit, also restarted os and questdb, but the issue still exist.
[root@p-db-questdb-001 ~]# sysctl fs.file-max
fs.file-max = 100000
[root@p-db-questdb-001 ~]# cat /proc/sys/vm/max_map_count
262144
questdb log
2022-10-18T08:31:37.956095Z I i.q.c.TableReader open partition /data/questdb/db/gpdb_session_level_memory_consumption/54765-05-22.15434 [rowCount=3485, partitionNameTxn=15434, transientRowCount=2489, partitionIndex=5742, partitionCount=5899]
2022-10-18T08:31:37.959315Z C i.q.c.p.PGConnectionContext error [msg=`could not open read-only [file=/data/questdb/db/gpdb_session_level_memory_consumption/54765-05-22.15434/segid.d]`, errno=`24]
2022-10-18T08:31:42.207067Z I i.q.c.TableWriter closed 'gpdb_gp_resq_activity'
2022-10-18T08:31:42.207092Z C i.q.c.p.WriterPool could not open [table=`gpdb_gp_resq_activity`, thread=46, ex=could not open read-write [file=/data/questdb/db/gpdb_gp_resq_activity/54766-01-02.13981/sample_time.d], errno=24]
2022-10-18T08:31:42.207133Z C i.q.c.p.PGConnectionContext error [msg=`could not open read-write [file=/data/questdb/db/gpdb_gp_resq_activity/54766-01-02.13981/sample_time.d]`, errno=`24]
2022-10-18T08:31:42.208238Z I i.q.c.p.PGConnectionContext parse [fd=102, q=COMMIT]
2022-10-18T08:31:42.208325Z I i.q.c.p.PGConnectionContext prepare [name=S_4]
2022-10-18T08:31:42.431052Z I i.q.c.p.PGConnectionContext parse [fd=102, q=]
Andrey Pechkurov

Andrey Pechkurov

10/18/2022, 8:48 AM
Are you running QuestDB under root user or it's a different one?
8:51 AM
try checking the limit per QuestDB's pid:
cat /proc/<PID>/limits
Jun Zhou

Jun Zhou

10/18/2022, 10:38 AM
Are you running QuestDB under root user or it's a different one?
Its root user. I added the below entries in limits.conf and then restart QuestDB, then the issue is resolved.
* soft nofile 655350                                                                                                                                                                                                                                       
* hard nofile 655350
Andrey Pechkurov

Andrey Pechkurov

10/18/2022, 10:42 AM
👍