Index of every page on this site: llms.txt
All skills
Run it yourself

Optimize Apify platform costs through memory tuning, compute unit management, and proxy budgeting. Use when analyzing Apify billing, reducing Actor run costs, or implementing usage monitoring and budget alerts. Trigger with "apify cost", "apify billing", "reduce apify costs", "apify pricing", "apify expensive", "apify budget", "compute units".

  • 4 files
  • 16.2 KB
  • MIT
  • Updated 4 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/apify-cost-tuning

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈496 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Apify Cost Tuning — Worked Examples

End-to-end scenarios that chain the six steps in implementation.md. Each shows the investigate → tune → guard loop against a concrete symptom.

Example 1: "My CheerioCrawler bill tripled last month"

  1. Investigate. Run analyzeActorCosts('user/scraper', 30) (Step 1). The report shows avg cost/run jumped from $0.02 to $0.06 and flags the most expensive run.
  2. Diagnose memory. The Actor is provisioned at 2048 MB but it is a simple Cheerio crawler — the memory sweep (Step 2) succeeds all the way down to 256 MB.
  3. Apply. Set the Actor's default memory to 512 MB (one notch above the 256 MB floor for headroom). CU drops ~4x because CU scales linearly with memory.
  4. Verify. Re-run analyzeActorCosts after the next scheduled batch and confirm avg cost/run fell back toward $0.02.

Example 2: "Residential proxy GB is eating the budget"

  1. Confirm the source. The monthly report (Step 6) shows one Playwright Actor dominating spend, and its runs use a residential proxy configuration.
  2. Block heavy resources. Add the preNavigationHooks route-abort from Step 4 to drop images, fonts, and CSS. On image-heavy sites this cuts residential GB by 50-80% because those assets are the bulk of transferred bytes.
  3. Add stickiness. Enable useSessionPool with maxUsageCount: 100 (Step 4) so the crawler reuses proxy sessions instead of opening new connections per request.

Example 3: "Guard a new Actor against a runaway bill"

Wrap the run in the budget guard from Step 5 so an accidental infinite crawl can't burn more than a hard cap:

// Abort automatically if this run ever exceeds $0.50
const run = await runWithBudget('user/scraper', input, 0.50);

The guard polls usageTotalUsd every 30 seconds and calls .abort() the moment spend crosses the ceiling — pair it with maxRequestsPerCrawl (Step 3) as a belt-and-suspenders upper bound.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files
version
1.5.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "scraping",
  "automation",
  "apify"
]
All 2 allowed tools
ReadGrep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/apify-cost-tuning