Skip to content

Comments

chore: Increase function memory to 3008MB (#2687)#2688

Merged
KATO-Hiro merged 2 commits intostagingfrom
#2687
Oct 12, 2025
Merged

chore: Increase function memory to 3008MB (#2687)#2688
KATO-Hiro merged 2 commits intostagingfrom
#2687

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Oct 12, 2025

close #2687

Summary by CodeRabbit

  • Bug Fixes
    • Reduced crashes and timeouts by tuning server resources and enforcing a clear execution time limit.
  • Chores
    • Updated deployment runtime and resource settings to a newer environment with increased memory and a defined maximum duration.
    • Maintained existing region configuration for consistent latency.
  • Documentation
    • Simplified internal configuration guidance with a concise reference link.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

Updated SvelteKit’s Vercel adapter configuration to explicitly set the Node.js runtime (nodejs22.x), increase serverless memory to 3008 MB, enforce a 30-second max duration, and retain the hnd1 region. Simplified comments and added a reference link in the adapter section.

Changes

Cohort / File(s) Summary
SvelteKit Vercel adapter config
svelte.config.js
Added runtime: 'nodejs22.x', memory: 3008, and maxDuration: 30 to kit.adapter config; retained region: 'hnd1'; streamlined comments with a reference link.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant SK as SvelteKit Build
    participant VA as Vercel Adapter
    participant VF as Vercel Functions

    Dev->>SK: Build project
    SK->>VA: Initialize adapter config
    note over VA: runtime=nodejs22.x<br/>memory=3008 MB<br/>maxDuration=30s<br/>region=hnd1
    VA-->>VF: Provision serverless deployment with constraints
    Dev->>VF: Invoke function (deployment)
    VF-->>Dev: Execute within configured runtime/limits
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nudge the clouds with carrot might,
Boosted RAM for swifter flight—
Node twenty-two, we leap and bound,
Thirty ticks, we’re homeward bound.
In hnd1, I thump with glee,
Deploys as smooth as clover tea. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning Beyond the requested memory increase, the PR also adds runtime and maxDuration properties to the adapter configuration, which were not specified in issue #2687 and fall outside its stated scope. Please remove or relocate the runtime and maxDuration changes to a separate pull request or provide justification for why they should be included alongside the memory update.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly states the primary change—raising serverless function memory to 3008 MB—and matches the memory configuration update in svelte.config.js, using the conventional “chore” prefix and omitting extraneous details to clearly communicate the main intent.
Linked Issues Check ✅ Passed The pull request directly implements the requirement from issue #2687 by setting the Vercel function memory limit to 3008 MB in the SvelteKit configuration, addressing the suspected memory shortage without contradicting any issue details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2687

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 8ad3e46 and d392e5e.

📒 Files selected for processing (1)
  • svelte.config.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview
🔇 Additional comments (4)
svelte.config.js (4)

12-13: LGTM!

The comment update provides a clear reference to the official documentation.


17-17: Memory increase aligns with PR objectives.

The memory increase to 3008 MB (Vercel's maximum) directly addresses the suspected OOM errors mentioned in issue #2687. The specific route /workbooks/{slug} is identified as the problematic endpoint.

Consider monitoring memory usage after deployment to confirm this resolves the OOM issues without masking potential memory leaks or inefficiencies in the route handler. You may also want to investigate the root cause of high memory consumption on this route to determine if code optimization is feasible.


18-18: Clarify the addition of maxDuration.

The maxDuration: 30 property was added alongside the memory increase, but the PR objectives only mention increasing memory. Please clarify:

  • Is this timeout intentional and related to the memory issue?
  • Was this added as a safeguard to prevent long-running functions?
  • Should this change be documented in the PR description?

A 30-second timeout is reasonable for preventing runaway functions, but it would be helpful to understand if this was a deliberate addition or if it should be adjusted based on the expected execution time of the /workbooks/{slug} route.


15-15: No action required: adapter-vercel supports nodejs22.x and Vercel defaults to Node.js 22.x for new projects.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3edc04c and 8ad3e46.

📒 Files selected for processing (1)
  • vercel.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro KATO-Hiro merged commit 7e294cf into staging Oct 12, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2687 branch October 12, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Vercel の サーバレス関数のメモリの上限を引き上げましょう

1 participant