[comment]: # ({48f541a4-ee7b9a7e})
# 20 大型 JSON 值支持

[comment]: # ({/48f541a4-ee7b9a7e})

[comment]: # ({339046b2-1557bf10})
为确保能够可靠地处理使用 JSON [数据类型](/manual/config/items/item#configuration) 的大值（1MiB 或更大），请根据需要检查并应用以下配置更改：

1\. 如果您使用的是 MySQL 或 MariaDB，请在 `/etc/mysql/my.cnf` 中增大允许的最大数据包大小（某些系统上的默认值可能为 1MB）：

```ini
[mysqld]
max_allowed_packet=128M

[mysqldump]
max_allowed_packet=1G
```

2\. 根据需要调整其他 MySQL/MariaDB [服务器系统变量](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html) 和 [InnoDB 系统变量](https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html)。例如：

```ini
innodb_io_capacity=1900
connect_timeout=600
wait_timeout=57600
interactive_timeout=57600
net_read_timeout=7200
net_write_timeout=7200
net-buffer-length=32704
```

3\. 在 Zabbix 服务器配置文件中，将 [`HistoryCacheSize`](/manual/appendix/config/zabbix_server#historycachesize) 增加到 `2G`。

4\. 如果您使用 Zabbix proxy，请在 proxy 配置文件中将 [`HistoryCacheSize`](/manual/appendix/config/zabbix_proxy#historycachesize) 增加到 `2G`，并将 [`ProxyMemoryBufferSize`](/manual/appendix/config/zabbix_proxy#proxymemorybuffersize) 增加到 `2G`。

5\. 如果您使用 Zabbix agent，请增大 Zabbix 服务器/proxy 与 agent 之间的通信超时时间（例如，[监控项超时](/manual/config/items/item#item-timeout)，或 Zabbix [server](/manual/appendix/config/zabbix_server#timeout)/[proxy](/manual/appendix/config/zabbix_proxy#timeout) 和 [agent](/manual/appendix/config/zabbix_agentd#timeout) 配置文件中的 `Timeout` 参数值）。
否则，它们之间的消息可能无法完成，您可能会看到诸如 *“message length does not match expected length”* 之类的错误。
此外，还请根据需要检查其他超时设置，例如[脚本超时](/manual/web_interface/frontend_sections/alerts/scripts#script-timeout)或[监控项测试](/manual/web_interface/frontend_sections/administration/general#timeouts)超时。

[comment]: # ({/339046b2-1557bf10})
