Sub topic 15
Memory and database storage, large sites and crawling behind a login
This chapter assumes you can scope a crawl with include and exclude rules, limits and speed settings. It covers how to choose a storage mode for large sites, and how to crawl pages that need a login.
Memory storage and database storage
The SEO Spider keeps crawl data in one of two places. You choose under Configuration > System > Storage Mode.
| Mode | Where data lives | Strengths | Limits |
|---|---|---|---|
| Memory | RAM | Fastest on small sites | Crawl size is capped by allocated RAM. A crash can lose the crawl. |
| Database | Local database on disk | Handles millions of URLs. Auto-saves, so an interrupted crawl can be reopened. | Slower, and needs a fast disk. An SSD is strongly recommended. |
In database mode, finished and in-progress crawls appear under File > Crawls. You don't have to save them by hand.
The 100k figure is a rule of thumb, not a hard limit. Rendering, many extractions and large page sizes all raise memory use.
Memory allocation
Set the RAM available to the Spider under Configuration > System > Memory Allocation. Leave at least 2 GB free for the operating system and other programs. Restart the Spider after you change it.
If you see a low memory warning, the Spider pauses so you can save and avoid losing data. Your options are to raise the allocation, switch to database mode, or narrow the crawl.
Strategies for large sites
- Crawl a section at a time with an Include rule instead of the whole site.
- Turn off what you don't need, such as images, CSS, JavaScript files and external links.
- Don't enable rendering unless the pages need it, because it costs far more memory and time.
- Set a crawl depth or URL limit for a first pass.
- Lower speed if the server slows down. You have permission to crawl, but you shouldn't hurt your own site's performance.
Crawling behind a login
Staging sites and members' areas usually need authentication. Open Configuration > Authentication.
- Standards Based handles Basic and Digest authentication, the browser pop-up kind. Enter the credentials when prompted.
- Forms Based opens an integrated browser. You add the login page, sign in as you would normally, and the Spider reuses the session cookies for the crawl.
A logged-in crawl can follow links that change data, such as "delete" or "log out". Add Exclude rules before you start. This rule, entered under Configuration > Exclude, stops the crawl from ending its own session:
.*/logout.*Use a test account with limited rights and crawl slowly. Also remember that the saved crawl and any exports can contain private content, so store them accordingly.
Exercise
You are crawling a 2-million-URL shop on a laptop with an SSD. The Spider runs out of memory after 40 minutes and you lose the crawl. Which storage mode should you use, and what other change reduces the load?
Show answer
Switch to database storage, which writes the crawl to disk and lets you reopen an interrupted crawl. Then reduce the load by crawling in sections with Include rules, or by turning off resource types you don't need, such as images, CSS and JavaScript files.