Improve sustainable throughput for touchpoints#show endpoint

未关闭
#2,157 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@MrNagoo 已经在做这个了。

开始于 2026年10月26日。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript

调研方向

Start by locating the touchpoints#show endpoint and its existing form model caching; the issue names no files or tests. Compare caching or render-on-write approaches, then measure throughput under a request distribution where fewer than 0.001% of requests need re-rendering. Done means one production instance sustains 40–50 requests per second.

由索引模型根据 Issue 内容生成。

描述

performance
The problem

touchpoints#show is the endpoint that returns the widget for a form. It is called whenever a website with an embedded Touchpoints form loads or a hosted Touchpoints form is loaded. The endpoint renders the saved form configuration into JavaScript that displays and manages a form.

Nearly all calls to Touchpoints are to this endpoint. Throughput for touchpoints#show ranges between 3k and 5k requests per minute, while the next busiest endpoint (submissions#create) tops out at about 40 requests per minute.

Currently, a single production instance of the Touchpoints app can only handle about 900 touchpoints#show requests per minute (15 per second, based on load testing with a form of medium-low complexity). This is the main reason that we are running 18 instances of Touchpoints in prod, each costing us 6 Cloud.gov credits per month (we may not actually need all of those but touchpoints#show alone probably justifies at least 8-10 of them).

The goal

The goal for this ticket is to boost the per instance sustainable throughput for touchpoints#show by at least 10X, which should allow us to cut our number of production instances to a more reasonable 2 or 3 count.

The rendered version of a form only changes when the form changes, either because the form's owner edited the form or because Touchpoints developers changed the underlying code or data model for the form. Such changes don't happen very often, which means that most re-renders are redundant. Even without a speed-up to the actual rendering code, we should be able to increase throughput significantly through caching or render-on-write.

To provide some metrics on how often a form needs to be re-rendered, in the last 7 days:

  • 33 million requests to touchpoints#show
  • 2000 requests to endpoints that modify forms
  • Approximately 0.0067% of render requests might actually require a re-rendering
Acceptance Criteria
  • Single production instance of Touchpoints app can handle at least 150 touchpoints#show requests per second, assuming a request distribution where less than 0.001% of requests need to be re-rendered.
主要语言
JavaScript
星标
73
派生
38
平均合并
14 小时 53 分钟
30 天内合并 PR
12

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GSA/touchpoints 的其他 Issue

查看 GSA/touchpoints 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。