> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 客户端性能调优

> Optimize AutoMQ setup for cloud-native throughput with tailored client configurations, leveraging Kafka compatibility and object storage for high efficiency.

AutoMQ 不依赖本地磁盘，直接将数据写入对象存储。相较于本地磁盘写入，对象存储的文件创建操作具有较高延迟。例如，我们的实测数据显示：向 S3 写入 4MiB 文件时，P99 延迟约 400 毫秒。受此影响，在一些吞吐量优先的场景中，需要适当的调整客户端参数以满足系统性能目标的要求（[Little’s Law](https://en.wikipedia.org/wiki/Little's_law)）。

<Tip>
  注意：

  本文列举的配置仅供参考，用户需基于自身场景诉求、系统目标综合考虑，合理的调整对应参数值。

  如果您的场景对消息读写延迟敏感，可以通过[此处表单](https://www.automq.com/contact)联系 AutoMQ 团队获取支持。AutoMQ BYOC 和 AutoMQ Software 支持个位数毫秒的低延迟数据读写。
</Tip>

### Producer 配置

| **Producer配置项**<br />     | **说明**<br />                                   | **推荐值**<br />  |
| ------------------------- | ---------------------------------------------- | -------------- |
| linger.ms<br />           | Producer 等待消息批量发送的延迟时间，通过累积更多消息提升单次请求效率。<br /> | 100<br />      |
| metadata.max.age.ms<br /> | 元数据强制刷新时间，避免因元数据过期导致路由错误。<br />                | 60000<br />    |
| batch.size<br />          | 单个批次的最大字节数，直接影响网络请求次数与吞吐量。<br />               | 1048576<br />  |
| max.request.size<br />    | 单个请求的最大字节数，限制Producer 能发送的消息大小。<br />          | 16777216<br /> |

### Consumer 配置

| **Consumer 配置项**<br />          | **说明**<br />                                               | **推荐值**<br /> |
| ------------------------------- | ---------------------------------------------------------- | ------------- |
| metadata.max.age.ms<br />       | 元数据强制刷新时间，避免因元数据过期导致路由错误。<br />                            | 60000<br />   |
| max.partition.fetch.bytes<br /> | 限制单个分区在 Fetch 请求中返回的最大数据量，与fetch.max.bytes 协同控制拉取粒度。<br /> | 8388608<br /> |
