百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Q

queued

> 编程语言
开源

高度可靠的简单队列服务,可扩展到每秒数百万次操作

196 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

高度可靠的简单队列服务,可扩展到每秒数百万次操作

queued

Fast zero-configuration single-binary simple queue service.

  • Introspect and query contents, and push and delete in huge batches.
  • Programmatic or temporary flow control with rate limiting and suspension.
  • Fast I/O with minimal writes and strong API-guaranteed durability.
  • Available as simple library for direct integration into larger programs.

Quick start

Install

Ensure you have Rust installed.

cargo install queued

Run

queued --data-dir /var/lib/queued

Call

…

Performance

Single node

With a single Intel Alder Lake CPU core and NVMe SSD, queued manages around 300,000 operations (push, poll, update, or delete) per second with 4,096 concurrent clients and a batch size of 64. There is minimal memory usage; only metadata of each message is stored in memory.

As every operation is durably persisted to the underlying storage, the storage I/O performance can quickly become a bottleneck. Consider using RAID 0 and tuning the write latency for better performance.

Safety

At the API layer, only a successful response (i.e. 2xx) means that the request has been successfully persisted (fdatasync) to disk. Assume any interrupted or failed requests did not safely get stored, and retry as appropriate. Changes are immediately visible to all other callers.

It's recommended to use error-correcting durable storage when running in production, like any other stateful workload.

Performing backups can be done by stopping the process and taking a copy of the contents of the file/device.

Management

GET /queues lists all queues. Returns:

json
{
  "queues": [
    { "name": "my-q" },
    { "name": "another-q" }
  ]
}

POST /queue/:queue/suspend can suspend specific API endpoints for a queue, useful for temporary debugging or emergency intervention without stopping the server. It takes a request body like:

json
{
  "delete": true,
  "poll": false,
  "push": false,
  "update": true
}

Set a property to true to disable that endpoint, and false to re-enable it. Disabled endpoints will return 503 Service Unavailable. Use GET /queue/:queue/suspend to get the currently suspended endpoints.

POST /queue/:queue/throttle will configure poll throttling for a queue, useful for flow control and rate limiting. It takes a request body like:

json
{
  "throttle": {
    "max_polls_per_time_window": 100,
    "time_window_sec": 60
  }
}

This will rate limit poll requests to 100 every 60 seconds. No other endpoint is throttled. Throttled requests will return 429 Too Many Requests. Use GET /queue/:queue/throttle to get the current throttle setting. To disable throttling:

json
{
  "throttle": null
}

GET /healthz returns the current build version.

GET /queue/:queue/metrics returns metrics in the Prometheus or JSON (Accept: application/json) format:

…

Important details

  • Messages are delivered in order of their visibility time. Messages visible at the same time may be delivered in any order. Messages will never be delivered before their visibility time, but may be delivered a few seconds later. Polled messages could be updated or deleted a few seconds after their visibility time for the same reason.
  • The ID and poll tag values are unique and opaque.
  • There is no limit on the size of a message. The HTTP API has a limit of 128 MiB per request body.
  • Non-2xx responses are text only and usually contain an error message, so check the status before parsing as JSON.
  • The process will exit when disk space is exhausted.

Development

Clients in example-client can help with running synthetic workloads for stress testing, performance tuning, and profiling.

As I/O becomes the main attention for optimisation, keep in mind:

  • We assume powersafe overwrites i.e. a write won't affect any data outside of the target range.
  • write syscall data is immediately visible to all read syscalls in all threads and processes.
  • write syscalls can be reordered, unless fdatasync/fsync is used, which acts as both a barrier and cache-flusher. This means that a fast sequence of write (1: create) -> read (2: inspect) -> write (3: update) can actually cause 1 to clobber 3. Ideally there would be two different APIs for creating a barrier and flushing the cache.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言