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: "apify cost", "apify billing", "reduce apify costs",
"apify pricing", "apify expensive", "apify budget", "compute units".
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
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: "apify cost", "apify billing", "reduce apify costs",
"apify pricing", "apify expensive", "apify budget", "compute units".
allowed-tools
Read, Grep
version
1.0.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","scraping","automation","apify"]
compatible-with
claude-code
Apify Cost Tuning
Overview
Apify charges based on compute units (CU), proxy traffic (GB), and storage. One CU = 1 GB memory running for 1 hour. This skill covers how to analyze, reduce, and monitor costs across all three dimensions.
Pricing Model
Compute Units (CU)
CU = (Memory in GB) x (Duration in hours)
Example: 2048 MB (2 GB) running for 30 minutes = 2 x 0.5 = 1 CU
Plan
CU Price
Included CUs
Free
N/A
Limited trial
Starter
$0.30/CU
Varies by plan
Scale
$0.25/CU
Volume discounts
Enterprise
Custom
Negotiated
Proxy Costs
Proxy Type
Cost
Use Case
Datacenter
Included in plan
Non-blocking sites
Residential
~$12/GB
Sites that block datacenters
Google SERP
~$3.50/1000 queries
Google search results
Storage
Named datasets and KV stores persist indefinitely but count against storage quota. Unnamed (default run) storage expires after 7 days.
Memory is the biggest cost lever. Most CheerioCrawler Actors are over-provisioned.
// Test with progressively lower memory to find the sweet spotfor (const memory of [4096, 2048, 1024, 512, 256]) {
try {
const run = await client.actor('user/actor').call(testInput, {
memory,
timeout: 600,
});
console.log(
`${memory}MB: ${run.status} | ` +
`${run.stats?.runTimeSecs}s | ` +
`${run.usage?.ACTOR_COMPUTE_UNITS?.toFixed(4)} CU | ` +
`$${run.usageTotalUsd?.toFixed(4)}`
);
if (run.status !== 'SUCCEEDED') break;
} catch (error) {
console.log(`${memory}MB: FAILED — ${(error asError).message}`);
break;
}
}
Typical memory sweet spots:
Actor Type
Start At
Sweet Spot
CheerioCrawler (simple)
256 MB
256-512 MB
CheerioCrawler (complex)
512 MB
512-1024 MB
PlaywrightCrawler
2048 MB
2048-4096 MB
Data processing
1024 MB
1024-2048 MB
Step 3: Optimize Crawl Duration
Faster crawls = fewer CUs consumed:
const crawler = newCheerioCrawler({
// Higher concurrency = faster completionmaxConcurrency: 30,
// Don't wait too long on slow pagesrequestHandlerTimeoutSecs: 20,
// Stop early when you have enough datamaxRequestsPerCrawl: 1000,
// Avoid unnecessary retriesmaxRequestRetries: 2, // Default: 3requestHandler: async ({ request, $, enqueueLinks }) => {
// Only extract what you needawaitActor.pushData({
url: request.url,
title: $('title').text().trim(),
// Don't scrape entire page body if you don't need it
});
// Only enqueue relevant links (not every link on the page)awaitenqueueLinks({
selector: 'a.product-link', // Specific selector, not 'a'strategy: 'same-domain',
});
},
});
Step 4: Minimize Proxy Costs
// Strategy 1: Use datacenter proxy first (free with plan)const dcProxy = awaitActor.createProxyConfiguration({
groups: ['BUYPROXIES94952'],
});
// Strategy 2: Only use residential proxy when needed// Don't waste residential bandwidth on non-blocking sites// Strategy 3: Minimize data transfer through residential proxyconst crawler = newPlaywrightCrawler({
proxyConfiguration: resProxy,
preNavigationHooks: [
async ({ page }) => {
// Block images, fonts, CSS (saves residential proxy GB)await page.route('**/*.{png,jpg,jpeg,gif,svg,webp,ico,woff,woff2,ttf,css}',
route => route.abort()
);
},
],
});
// Strategy 4: Session stickiness (reduces new proxy connections)const crawler = newCheerioCrawler({
proxyConfiguration: resProxy,
useSessionPool: true,
sessionPoolOptions: {
sessionOptions: {
maxUsageCount: 100, // More reuse = fewer new connections
},
},
});