웹사이트의 웹 크롤러 제어하기

:bookmark: 이 가이드는 Discourse 사이트에서 웹 크롤러를 관리하는 방법을 설명합니다.

:person_raising_hand: 필요한 사용자 권한: 관리자

웹 크롤러는 페이지뷰와 서버 부하를 증가시켜 사이트 성능에 상당한 영향을 미칠 수 있습니다.

사이트에서 페이지뷰가 갑자기 급증하는 경우, 웹 크롤러가 그 원인에 어떻게 기여하고 있는지 확인하는 것이 중요합니다.


크롤러 활동 확인

크롤러가 사이트에 영향을 미치고 있는지 확인하려면 관리자 대시보드에서 Site Traffic(사이트 트래픽) 보고서(/admin/reports/site_traffic)로 이동하세요. 이 보고서는 로그인한 브라우저 사용자, 익명 브라우저 사용자, 크롤러 및 기타 소스의 페이지뷰 수를 세분화하여 보여줍니다.

크롤러가 정상적으로 작동하는 사이트:

크롤러가 통제 불능 상태인 사이트:

특정 크롤러 식별

Web Crawler User Agent(웹 크롤러 사용자 에이전트) 보고서(/admin/reports/web_crawlers)로 이동하여 페이지뷰 수 기준으로 정렬된 웹 크롤러 이름 목록을 확인하세요.

문제 있는 웹 크롤러가 사이트에 접근하면, 해당 크롤러의 페이지뷰 수가 다른 웹 크롤러보다 훨씬 높게 나타납니다. 동시에 여러 악성 웹 크롤러가 작동하고 있을 수도 있다는 점에 유의하세요.

크롤러 차단 및 제한

Google, Bing, Baidu(중국), Yandex(러시아), Naver(한국), DuckDuckGo, Yahoo 및 기타 주요 검색 엔진의 크롤러를 차단하지 않는 것이 좋은 습관입니다(국가에 따라 다름).

웹 크롤러가 통제 불능 상태에 빠졌다면, 동일한 크롤러가 다른 사이트에도 접근했을 가능성이 높으며, 이미 다른 사람이 해당 크롤러에 대한 정보를 요청하거나 보고서를 작성해 두었을 수 있습니다. 이는 해당 크롤러를 제한하거나 차단할지 여부를 판단하는 데 유용할 수 있습니다.

스립트를 통해 제3자 서비스를 사용하여 사이트를 모니터링하거나 기능을 추가하는 경우, 일부 크롤러가 상당한 양의 페이지뷰를 기여할 수 있다는 점에 유의하세요.

신뢰할 수 없는 웹 크롤러 목록을 얻으려면 이 목록을 참조할 수 있습니다. https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/blob/master/robots.txt/robots.txt

크롤러 설정 조정

Admin > Settings(관리자 > 설정)에서 특정 크롤러의 속도를 제한하는 데 도움이 되는 몇 가지 설정이 있습니다:

  • 크롤러 속도 감소:

    • slow down crawler user agents(크롤러 사용자 에이전트 속도 감소) — 기본적으로 gptbot, claudebot, anthropic-ai, brightbot을 포함합니다.
    • slow down crawler rate(크롤러 속도 감소) — 크롤러당 허용되는 요청 사이의 초 단위(기본값: 60)
  • 크롤러 차단:

    • blocked crawler user agents(차단된 크롤러 사용자 에이전트) — 기본적으로 mauibot, semrushbot, ahrefsbot, blexbot, seo spider를 포함합니다.
  • 특정 크롤러만 허용:

    • allowed crawler user agents(허용된 크롤러 사용자 에이전트) — 설정 시, 목록에 있는 크롤러만 사이트 접근이 허용되며, 나머지는 모두 차단됩니다. 이는 엄격한 허용 목록(allowlist)으로 작동합니다. 경고: 이 설정을 사용하면 blocked crawler user agents가 무시되고, 목록에 없는 모든 크롤러(포함되지 않은 경우 주요 검색 엔진 포함)가 차단됩니다.

조절하려는 크롤러의 정확한 사용자 에이전트 이름을 알고 있는지 확인하세요. 위의 설정을 조정했음에도 해당 에이전트의 페이지뷰가 감소하지 않는다면, 올바른 이름을 사용하고 있는지 다시 한번 확인해 보시는 것이 좋습니다.

어떻게 조치해야 할지 확신이 서지 않을 때는 항상 완전한 차단보다는 “속도 감소” 옵션부터 시작하세요. 시간이 지나면서 개선되는지 확인하십시오. 눈에 띄는 결과가 없다면 완전한 차단을 진행할 수 있습니다.

17개의 좋아요

Should there be somekind disclaimer that this works only with good behaving ones? And even Google will bypass all of those when it comes via links from gmail.

Both are enforced on the server.

However, if a bad bot pretends to be Chrome or someone else by spoofing headers then we can not use headers to detect it…

2개의 좋아요

Killer fact: Preview cards show count as a page view !

The server I admin appears to have been swamped with preview card requests of the form http.rb/5.1.0 (Mastodon/4.0.2; + [https://mstdn.science/](https://mstdn.science/))

I don’t think any action can be taken apart from telling mastodon posters to include an image so the preview card is not added automatically.

1개의 좋아요

I already have over 1500 hits per day by crawlers. :tired_face: Can I block them all by using Cloudflare DNS? Or what option is needed to force block them all? (Privat instance)

I simply don’t want them.

Using i.e. nginx as a reverse proxy and stopping there unwanted user agents. That helps a lot. Blocking countries you don’t need helps quite much too.

I can’t block US, France and Germany (big VPS-countries) but for me Russia, Vietnam, Iran, Iraq etc. helped quite much.

But Discourse is quite… is resilient right word. The situation is very much different than with WordPress where those useless SEO-bots, knockers, script kiddies and malicious actors can easily put a server on its knees.

2개의 좋아요

I’m hosting at Hetzner Germany, with just two open ports in my firewall (80/443). And Discourse runs behind the NGINX proxy manager (sure, there are better solutions, but I’m a lazy person to code and like web frontends).

Now I’m going the whitelist route, with a random string as the only allowed entry … from now on, no more page views :smiley:

A question about exactly what to put in “slow down crawler user agents”.
For us Facebook is a major culprit, with Bing a close 3rd.
Report shows the following agents as the principal crawlers soaking up page views:

What exactly should be in “slow down crawler user agents” - these exact urls including “https” or “http”? Or everything after the double-slash? Or something else? Or do we just go by trial and error?

Thanks!

To keep things simple you should use the names of those bots. But you can use any part of user agent string, but be sure it doesn’t affect more than you want.

Slowing down bots is very unreliable way, but some follows that rule. But those comes from your shares etc. and doesn’t create that much workload. WordPress would be another story.

But this is part of my blocked bots list. You get the point from it.

1개의 좋아요

Thanks for this, @Jagster - very helpful. Feels like a game of whack-a-mole sometimes, but I get the idea of using part of the crawler name string rather than the whole thing.

A work in progress for me as site admin I guess - onwards!

1개의 좋아요

There can be several reasons, but googlebot has its budget, and when sitemaps are the most important way to find links, it never reaches internal links when daily/weekly/monthly budget is used.

And in a forum internal links are important for users, not for Google.

But I don’t know if googlebot sees internal links. It should, though.

1개의 좋아요