Skip to content

Commit 7452fdb

Browse files
committed
update dtable-db.conf page
1 parent 5458650 commit 7452fdb

File tree

2 files changed

+121
-54
lines changed

2 files changed

+121
-54
lines changed

docs/assets/stylesheets/extra.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,4 +504,9 @@
504504
background-color: #efefef;
505505
border-radius: 5px;
506506
padding: 0px 10px 0 5px;
507+
}
508+
509+
/* data tables */
510+
.md-typeset__table code {
511+
white-space: nowrap;
507512
}
Lines changed: 116 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,41 @@
1-
# dtable-db config
1+
# Configuration of dtable-db
22

3-
dtable-db is the component that provides SQL querying capability in SeaTable server. Users can query their bases with SQL. It also handles archiving for large bases (since Enterprise Edition 2.3.0), to make querying large bases more efficient.
3+
This is a cheat sheet for the [dtable-db](/introduction/architecture/#seatable-server-container) configuration file `dtable-db.conf`. It contains all possible settings that can be configured as well as their default values.
44

5-
## Configurations
5+
The default values provided here are best-effort (not built automatically). They will be used, if no value is defined at all. It is not necessary the value, that is written in the configuration file on first startup.
66

7-
The configuration options are available in `dtable-db.conf`. The options are grouped in sections.
7+
In the default values below, a value in the form `$XYZ` refers to an environment variable.
88

9-
### `[general]`
10-
11-
This section contains general settings about dtable-db service.
9+
??? tip "Configuration changes require a restart"
1210

13-
- `host`: The address dtable-db listens on. Defaults to 0.0.0.0.
14-
- `port`: The port dtable-db listens on. Defaults to 7777.
15-
- `log_dir`: Location for the dtable-db logs in the container. Defaults to `/opt/seatable/logs`. (Added in 2.3.0)
16-
- `log_level`: Only log messages with level priority higher than this will be logged. Supported levels are "debug", "info", "warn", "error", with ascending priority. The default is "info".
17-
- `slow_query_threshold`: If the processing time exceeds this threshold, a slow log will be recorded in addition to the normal log. Unit is in milliseconds. Defaults to 1000 (=1 sec). (Added in 2.3.0)
18-
- `base_api_limit_per_day`: Limits the number of API calls per base per day. Default is -1, meaning there is no limit.
11+
New configuration options will only apply after a restart of SeaTable.
1912

20-
Please use the following parameters only in very special occasions. In most cases you should use the default values.
13+
??? abstract "Notes about the configuration file format"
2114

22-
- `global_row_update_limit`: Controls the rate of row update/delete/insert per second for the entire system. Row update/delete/insert via SQL and APIs are all affected. This option controls the global rate when there are concurrent updates to multiple bases. The unit is in number of rows. Default is 30000. (Added in 3.0.0)
23-
- `row_update_limit`: Controls the rate of row update/delete/insert per second for each base. Row update/delete/insert via SQL and APIs are all affected. The unit is in number of rows. Default is 5000. (Added in 3.0.0)
24-
- `query_per_minute_limit`: Limits the number of API calls per minute for the entire system. Default is 50000. If this value is less than 0, meaning no limits.
15+
The configuration file uses the **INI format**, which is a simple text-based format for storing configuration data. It consists of sections (denoted by square brackets, e.g., [general]) and key-value pairs.
2516

26-
### `[storage]`
17+
Comments in the configuration file start with the hash symbol `#` and extend to the end of the line.
2718

28-
This sections defines where the database files for bases with activated big data backend are stored and when old data is cleaned.
19+
When dealing with special characters like single quotes `'`, double quotes `"` or the hash symbol `#`, it's generally best to enclose the value in double quotes.
2920

30-
- `data_dir`: Location of the data directory in the container. You must specify this option. Typically it is `/opt/seatable/db-data`.
31-
- `cleanup_at`: The execution time of clean up deleted data. Format is `hh:mm`. Defaults to `00:00`.
21+
!!! danger "dtable-db reads values from dtable_server_config.json"
3222

33-
### `[dtable cache]`
34-
35-
This sections contains options for caching bases from dtable-server.
23+
Note that `dtable-db` reads `dtable_server_config.json` for Redis, MariaDB, and private key settings, even if `dtable-server` is disabled or runs separately. Ensure these configurations are correct.
3624

37-
- `dtable_server_url`: local address for dtable-server. You must specify this option. Typically it is `http://127.0.0.1:5000`.
38-
- `total_cache_size`: size of the base cache in MB. Since 4.4 version, the default is 2000MB (2GB). Before 4.4 version, the default is 500MB. This difference is due to a change of memory consumption estimation algorithm. With 4.4 version the new algorithm is more close to the real memory consumption of the cache.
39-
40-
### `[backup]`
41-
42-
Section `[backup]` contains options to configure backup functions for big data backend (available since Enterprise Edition 3.0.0):
43-
44-
- `dtable_storage_server_url`: The URL of dtable storage server. Required to enable automatic backup. For configuration of dtable storage server, please refer to [this documentation](../configuration/dtable-storage-server-conf.md). You must specify this option. Typically it is `http://127.0.0.1:6666`.
45-
- `backup_at`: The execution time of backup. Format is `12:30`. The default value is `02:00`. It is mutual exclusion with `backup_interval`. If neither `backup_at` nor `backup_interval` are specified, then `backup_at` will be used by default.
46-
- `backup_interval`: The interval between each backup. Unit is in seconds. The default value is 86400 (=24 hours). You can not define `backup_interval` and `backup_at` at the same time.
47-
- `keep_backup_num`: The number of backups that will be kept, oldest backups will be removed. The default value is 3.
48-
49-
### `[SQL]`
5025

51-
General configuration options of the output of the SQL endpoint.
26+
Other configuration files are not used, if you run dtable-db separately.
5227

53-
- `default_result_rows`: Maximal number of rows that will be returned in one query, if `LIMIT` syntax is not used. Defaults to 100.
54-
- `result_rows_hard_limit`: Maximal number of rows that will be returned in one query. If the number of rows specified in `LIMIT` syntax is larger than this option, the system still returns at most the number of rows that specified in this option. The default is 10000.
55-
- `exec_cost_hard_limit`: Maximal execution cost of a query. If the estimated cost of a query exceeds this limit, the query is rejected. Default is 5000000.
28+
The following options are grouped by their sections.
5629

5730
## Example configuration
5831

59-
```
32+
This is a typical configuration file, created automatically on the first startup by SeaTable.
33+
34+
```ini
6035
[general]
6136
host = 127.0.0.1
6237
port = 7777
63-
log_dir = /shared/seatable/logs
38+
log_dir = /opt/seatable/logs
6439

6540
[storage]
6641
data_dir = /opt/seatable/db-data
@@ -73,27 +48,114 @@ dtable_storage_server_url = "http://127.0.0.1:6666"
7348
keep_backup_num = 3
7449
```
7550

51+
## Available configuration options
52+
53+
### `[general]`
54+
55+
This section contains general settings about `dtable-db` service.
56+
57+
| Parameter | Description | Default |
58+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ |
59+
| `host` | The address `dtable-db` listens on. | 0.0.0.0 |
60+
| `port` | The port `dtable-db` listens on. | 7777 |
61+
| `log_dir` | Location for the `dtable-db` logs in the container. | /opt/seatable/logs |
62+
| `log_level` | Only log messages with level priority higher than this will be logged. Supported levels are "debug", "info", "warn", "error", with ascending priority. | info |
63+
| `slow_query_threshold` | If the processing time exceeds this threshold, a slow log will be recorded in addition to the normal log. Unit is in milliseconds. | 1000 |
64+
| `query_per_minute_limit` | Sets the total max. of API calls per minute for the entire system. The default is suitable for most cases. | 50000 |
65+
66+
Please use the following parameters only in very special occasions. In most cases you should use the default, which means no limitation.
67+
68+
| Parameter | Description | Default |
69+
| ------------------------- | ------------------------------------------------------------------------------------------------------- | ------- |
70+
| `global_row_update_limit` | Sets the global rate of row updates, deletes, and inserts per second, affecting SQL and API operations. | 0 |
71+
| `row_update_limit` | Sets the rate or row updates, deletes, and inserts per second and per base. | 0 |
72+
73+
### `[storage]`
74+
75+
This sections defines where the database files for bases with activated big data backend are stored and when old data is cleaned.
76+
77+
| Parameter | Description | Default |
78+
| ------------ | ------------------------------------------------------------------------------ | --------------------- |
79+
| `data_dir` | Location of the data directory in the container. You must specify this option. | /opt/seatable/db-data |
80+
| `cleanup_at` | The execution time of clean up deleted data. Format is `hh:mm`. | 00:00 |
81+
82+
### `[dtable cache]`
83+
84+
This sections contains options for caching bases from dtable-server.
85+
86+
| Parameter | Description | Default |
87+
| ------------------- | ------------------------------------------------------------------------------------------ | --------------------- |
88+
| `dtable_server_url` | local address for dtable-server. You must specify this option. | http://127.0.0.1:5000 |
89+
| `total_cache_size` | The base cache size in MB. Default was increased from 500 (MB) to 2000 (MB) in version 4.4 | 2000 |
90+
91+
### `[SQL]`
92+
93+
General configuration options of the output of the SQL endpoint.
94+
95+
| Parameter | Description | Default |
96+
| ------------------------ | -------------------------------------------------------------------------------------------------------------- | ------- |
97+
| `default_result_rows` | Maximal number of rows returned in one query, if `LIMIT` syntax is not used. | 100 |
98+
| `result_rows_hard_limit` | Maximal number of rows returned in one query (system wide). Overrides any larger `LIMIT` value in a query | 10000 |
99+
| `exec_cost_hard_limit` | Maximal execution cost of a query. If the estimated cost of a query exceeds this limit, the query is rejected. | 5000000 |
100+
101+
### `[backup]`
102+
103+
<!-- md:version 3.0 -->
104+
<!-- md:feature -->
105+
106+
Section `[backup]` contains options to configure backup functions for big data backend:
107+
108+
| Parameter | Description | Default |
109+
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
110+
| `dtable_storage_server_url` | The URL of dtable storage server. Required to enable automatic backup. | http://127.0.0.1:6666 |
111+
| `backup_at` | The execution time of backup. Format is like `12:30`. It is mutual exclusion with `backup_interval`. | 02:00 |
112+
| `backup_interval` | The interval between each backup. Unit is in seconds. The default value is 86400 (=24 hours). You can not define `backup_interval` and `backup_at` at the same time. | |
113+
| `keep_backup_num` | The number of backups that will be kept, oldest backups will be removed. | 3 |
114+
115+
!!! warning "Important change with 5.2"
116+
117+
The logic for big data backup will change with version 5.2. Next to `keep_backup_num`, new options will be available.
118+
76119
## Deprecated or removed options
77120

78-
### [database]
121+
### `[database]`
79122

80-
!!! note "Not necessary anymore"
123+
??? note "[database] is not necessary anymore"
81124

82-
Since version 2.7 this complete section `[database]` is no longer used. dtable-db will use the database settings in `conf/dtable_server_config.json`.
125+
Since version 2.7 this complete section `[database]` is no longer used. `dtable-db` will use the database settings in `conf/dtable_server_config.json`.
83126

84-
The section `[database]` contains options for accessing the MySQL database used by dtable-server. Note:
127+
The section `[database]` contained options for accessing the MySQL database used by dtable-server.
85128

86-
- `host`: Address of database. You must provide this option.
87-
- `port`: Port of database. Defaults to 3306.
88-
- `user`: Username for login to the database. You must provide this option.
89-
- `password`: Password for the database user. You must provide this option.
90-
- `db_name`: Database name used by dtable-server. You must provide this option.
129+
- `host`: Address of database. You must provide this option.
130+
- `port`: Port of database. Defaults to 3306.
131+
- `user`: Username for login to the database. You must provide this option.
132+
- `password`: Password for the database user. You must provide this option.
133+
- `db_name`: Database name used by dtable-server. You must provide this option.
91134

92-
### [dtable cache]
135+
### `[general]`
136+
137+
- `base_api_limit_per_day`: Limits the number of API calls per base per day. -1 means no limit.
138+
139+
### `[dtable cache]`
93140

94141
- `private_key`: Must be the same value like `DTABLE_PRIVATE_KEY` in `dtable_web_settings.py`. Only necessary if your version is before "Enterprise edition 3.5.5". If your version is newer the value is read from `dtable_server_config.json`.
95142
- `clean_cache_interval`: Interval between cache cleaning. Unit is in seconds. Defaults to 300. This option is removed in "Enterprise edition 4.4.0". Since 4.4.0 a real-time eviction mechanism replaced regular cache cleanup mechanism.
96143

97-
### [SQL]
144+
### `[SQL]`
98145

99146
- `group_by_stmt_limit`: Maximal number of concurrent `group by` requests. If the number of `group by` requests exceeds this limit, new `group by` queries will wait in a queue. Default is 2. This option is removed in version 5.1.0. This option was only relevant when querying bases with big-data. In 5.1.0 version `group by` queries can be handled by a new OLAP engine, which is much more efficient. So this option is no longer necessary.
147+
148+
<!-- to clarify with DJ
149+
- general: dev_mod
150+
- general: op_log_delete_restore_threshold
151+
- general: transaction_timeout
152+
- metrics: aufnehmen?
153+
- profiling?
154+
- sql all these xxxCost?
155+
- SnapshotAfterEntries ?!?
156+
- what is olap?
157+
- when configuration is only read from dtable-db???
158+
- configuration defaults sind andere als von configuration beim ersten start geschrieben. gewollt? Beispiel host: 0.0.0.0 is default, geschrieben wird 127.0.0.1. Warum überhaupt? Wir nutzen docker, dort ist erstmal nur aus docker netzwerk erlaubt.
159+
- was ist tls in der configuration?
160+
- ENV: SEATABLE_LOG_TO_STDOUT ?!? scheint irgendwie parallel zu LOG_DIR
161+
- -->

0 commit comments

Comments
 (0)