Home ci 38. functions: runtimes

38. functions: runtimes

Last updated on Aug 05, 2025

The problem involves understanding the cost implications of using Epycbyte's Edge runtime for a Serverless function compared to Node.js. Here's a structured summary:

  1. Runtime Overview:

    • Edge Runtime: Uses CPU time for billing, which includes only active processing time. Waiting periods (like network requests) don't count towards CPU time.
    • Node.js Runtime: Bills based on wall-clock time, including all elapsed time from start to finish.
  2. Billing Considerations:

    • Hobby Plan: Free usage within limits; ideal for functions that don't require extensive processing.
    • Pro Plan: Charges based on function duration (wall-clock) for Node.js or CPU time for Edge. For Edge, this means focusing on active processing periods.
  3. Function Execution and Costs:

    • Edge Functions: Can stream indefinitely but must send an initial response within 25 seconds. CPU usage averages 50ms per function.
    • Node.js Functions: Have a maximum duration and are billed based on total wall-clock time, including waiting periods.
  4. Performance Optimization:

    • Deploy databases close to functions to minimize network latency and reduce processing time.
    • Utilize Epycbyte Storage and Edge Config for efficient data handling and experimentation.
  5. Feature Support:

    • OTEL is not supported in the Edge runtime, so alternative monitoring tools may be needed.
  6. Recommendations:

    • Monitor CPU usage to stay within Hobby plan limits or upgrade to Pro if necessary.
    • Design functions with an awareness of processing time and waiting periods to optimize costs.