跳到正文
cccskills
免费在 GitHub 公开

apify-performance-tuning

Improve Apify Actor runs by comparing baseline metrics and adjusting crawler choice, concurrency, memory, and proxies. Get workload-specific recommendations for speed, reliability, and cost, along with before-and-after measurements.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Optimize Apify Actor performance: crawl speed, memory usage, concurrency, and proxy rotation. Use when Actors are slow, consuming too much memory, or being blocked by target sites, or when a crawl is too expensive per run. Trigger with "apify performance", "optimize apify actor", "apify slow", "crawlee concurrency", "apify memory tuning", "scraper performance".

实测评分 未实测

查看安装方法

适用场景

  • Speeding up a slow crawl
  • Reducing memory use or out-of-memory crashes
  • Lowering cost per Actor run
  • Responding to proxy blocks and 403 errors

包含的文件(3)

  • SKILL.md6.2 KB
  • references/implementation.md6.8 KB
  • references/monitoring.md1.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Apify Performance Tuning

Overview

Optimize Apify Actors for speed, cost, and reliability. Covers Crawlee concurrency settings, memory profiling, proxy rotation strategies, request batching, and crawler selection for different workloads.

The workflow is a repeatable loop: measure a baseline, apply one lever, re-measure. The single highest-impact lever is usually crawler choice — swapping a browser crawler for CheerioCrawler on non-JS pages is a 5-10x speedup on its own. The full six-step walkthrough, with every code block, lives in references/implementation.md.

Prerequisites

  • Existing Actor with measurable baseline performance
  • Understanding of apify-sdk-patterns
  • Access to Actor run stats in Apify Console
  • APIFY_TOKEN in the environment for reading run stats via ApifyClient

Instructions

Work the levers in order. Each step is expanded — with copy-paste code — in the reference file linked below.

  1. Measure a baseline. Pull runTimeSecs, requestsFinished, memAvgBytes, and usageTotalUsd from the run stats before changing anything. You cannot judge an optimization without a before number.
  2. Choose the right crawler. HttpCrawler/CheerioCrawler for static HTML or JSON (low memory, fast); PlaywrightCrawler/PuppeteerCrawler only when the page genuinely needs JavaScript rendering.
  3. Tune concurrency. Raise maxConcurrency for Cheerio (up to ~50); keep it low (~3-5) for browser crawlers because each page costs ~200MB. Let autoscaledPoolOptions adjust within the band.
  4. Optimize memory. Push data immediately instead of accumulating arrays; for browser crawlers, block images/CSS/fonts in preNavigationHooks and cap concurrent browsers.
  5. Right-size the memory allocation. Compute units bill on memory x duration — start low (512 MB for Cheerio) and only raise it if the Actor is memory-starved.
  6. Rotate proxies and tune requests. Start on datacenter proxies, fall back to residential on 403/blocked; use a session pool for IP rotation and ban detection.

Full step-by-step walkthrough with all code: references/implementation.md.

The minimal starting skeleton — swap a browser crawler for Cheerio and push immediately:

import { CheerioCrawler } from 'crawlee';
import { Actor } from 'apify';

const crawler = new CheerioCrawler({
  maxConcurrency: 50,             // Cheerio is cheap — parallelize hard
  maxRequestsPerMinute: 300,      // But cap the rate to protect the target
  requestHandler: async ({ $, request }) => {
    await Actor.pushData({ url: request.url, title: $('title').text().trim() });
  },
});

Output

Applying this skill produces:

  • A baseline vs. tuned metrics comparison (pages/min, avg/max memory, compute units, cost/run) drawn from the run stats.
  • A crawler and concurrency recommendation matched to whether the target pages need JS rendering.
  • A memory allocation value sized to the workload, with the compute-unit cost tradeoff made explicit.
  • A proxy and session strategy (datacenter-first with residential fallback) for reliability under anti-bot blocking.

Instrument the running crawl to confirm the gains in real time — see references/monitoring.md for the throughput logger and a before/after impact table.

Error Handling

IssueCauseSolution
Out of memory crashToo many concurrent browsersReduce maxConcurrency
Slow crawl speedLow concurrencyIncrease maxConcurrency
High failure rateAnti-bot blockingAdd proxy, reduce concurrency
Expensive runsOver-provisioned memoryProfile and reduce allocation
Stalled crawlRequest handler timeoutSet requestHandlerTimeoutSecs

Examples

Slow Playwright crawl on static pages. The Actor renders every page in a browser at 3 pages/min. The pages are server-rendered HTML, so switch to CheerioCrawler and raise maxConcurrency — ~30 pages/min (10x). Code: references/implementation.md Steps 1-2.

Out-of-memory crashes under load. A PlaywrightCrawler at maxConcurrency: 20 OOMs. Drop concurrency to 3, block images/CSS/fonts in preNavigationHooks, and call window.stop() post-navigation. Code: references/implementation.md Step 3.

Getting blocked (403s) mid-crawl. Start on datacenter proxies, and on a 403 re-enqueue the request with a residential proxy and retire the session to force a new IP. Code: references/implementation.md Step 5.

Runs cost too much. A 4GB allocation bills 8x more than needed for HTML parsing. Right-size to 512 MB and re-measure cost/run. Code: references/implementation.md Step 4; impact table in references/monitoring.md.

Resources

Next Steps

For cost optimization beyond performance tuning, see the apify-cost-tuning skill in this pack — it covers compute-unit budgeting, storage costs, and scheduling strategies that this skill's memory right-sizing feeds into.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Add a synthetic-data CI gate for customer-owned Abridge integration code. Test consent handling, note-review handoffs, redaction, and rollback behavior with mocked vendor boundaries, without connecting CI to a live Abridge or EHR tenant.

中文简介正在准备中。当前显示英语简介。

  • Adding regression checks to an Abridge integration repository
  • Testing consent and note-release handling
  • Checking logs for sensitive data exposure
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

Triage Abridge recording, note review, Epic handoff, and access problems using observed symptoms and approved guidance. Identify the affected workflow stage, organize a minimal timeline, and prepare a redacted escalation record for the responsible team.

中文简介正在准备中。当前显示英语简介。

  • Separate recording problems from upload failures
  • Investigate note creation delays and editor issues
  • Identify the responsible team for Epic handoff failures
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

Map and review an Abridge clinical documentation workflow from consent and recording through draft review, evidence checks, edits, and final disposition. Keep clinician approval explicit, identify failure exits, and separate verified facts from tenant-specific details and pending approvals.

中文简介正在准备中。当前显示英语简介。

  • Map a clinical note workflow for a care setting
  • Check where consent and patient identity are verified
  • Review draft notes against linked evidence before sign-off
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

Audit how clinician-reviewed Abridge note sections map into Epic templates and downstream workflows. Use approved test records to document destinations, exceptions, evidence, rollback steps, and a go or no-go decision for a specific environment.

中文简介正在准备中。当前显示英语简介。

  • Checking Abridge note section mappings to Epic templates
  • Auditing a department’s approved documentation handoff
  • Preparing test evidence and a go or no-go decision
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

Review Abridge adoption and workflow value using local usage records, clinician feedback, and verified contract costs. Build an evidence based decision table covering adoption, quality, support burden, and options to expand, hold, or improve the rollout.

中文简介正在准备中。当前显示英语简介。

  • Reviewing adoption after an Abridge rollout
  • Preparing evidence for a renewal decision
  • Comparing workflow outcomes across care settings
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

Prepare a bounded support bundle for an Abridge issue using allowlisted operational details such as versions, coarse timestamps, and correlation references. Exclude recordings, transcripts, patient identifiers, credentials, and unrestricted logs, then document redactions and review details.

中文简介正在准备中。当前显示英语简介。

  • Preparing reviewed evidence for an Abridge support case
  • Documenting redactions and excluded data
  • Collecting approved operational details for an incident
jeremylongshore/tons-of-skills-marketplace28682026年10月25日 更新

查看 jeremylongshore 的全部技能

报告此技能的问题