crawling the web

41
1 Crawling Curso: Recuperación de Información -- ChaTo

Upload: carlos-castillo

Post on 01-Nov-2014

1.906 views

Category:

Technology


5 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Crawling the Web

1

Crawling

Curso: Recuperación de Información

-- ChaTo

Page 2: Crawling the Web

2

The Problem

Search engine

Web

days/weeks/months

User

Page 3: Crawling the Web

3

Tipos de crawler

Page 4: Crawling the Web

4

Primeros Crawlers

RBSE Spider

– Web de 100.000 páginas

Crawler del Internet Archive

WebCrawler

– Muy exitoso en su época

Page 5: Crawling the Web

5

Segunda Generación

Mercator, Sphinx

Lycos, Excite, Google

– Paralelos

Crawlers distribuídos

– Y descentralizados

Page 6: Crawling the Web

6

Taxonomía Crawlers

Page 7: Crawling the Web

7

Arquitectura

Page 8: Crawling the Web

8

Arquitectura General

URLsTexto

Schedule Download

Web

Page 9: Crawling the Web

9

Arquitectura Mercator

1 sacar url, 2 fetch, 3 RewindInputStream, 4: dupes, 5: parsear, 6: urls, 7: dupes url, 8: add

Page 10: Crawling the Web

10

Arquitectura Alternativa

Page 11: Crawling the Web

11

Scheduling

Page 12: Crawling the Web

12

Scheduling en general

Varios objetivos simultáneos

– Priorizar mejores páginas

– Utilizar bien la red

– Mantener la colección fresca

– No sobrecargar servidores

Page 13: Crawling the Web

13

Scheduling en dos fases

Page 14: Crawling the Web

14

Scheduling de largo plazo

Cómo medir la importancia

– Driving Query (Agente Personal)

– Backlink count

– Pagerank

– URL● Dominio● Profundidad aparente de subdirectorio

Page 15: Crawling the Web

15

Uso de red

Page 16: Crawling the Web

16

Scheduling de corto plazo

Sean P(i) tamaños de página

B ancho de banda disponible

B(i) ancho de banda usado para sitios

– B(i) = P(i) / T*

T* tiempo óptimo

– T* = suma(P(i)) / B

Page 17: Crawling the Web

17

Red – Escenario óptimo

Page 18: Crawling the Web

18

El óptimo no es posible

Debemos evitar sobrecargar sitios

– Tiempo de espera w aprox. 30seg.

En general B(i) << B

– Alta variabilidad de B(i)

Alta tasa de fallas (20-30%)

Ocurren ineficiencias, el tiempo óptimo T* no es logrado

Page 19: Crawling the Web

19

Red – Escenario realista

Page 20: Crawling the Web

20

Red – Soluciones extremas

Page 21: Crawling the Web

21

Crawling en la práctica

Page 22: Crawling the Web

22

Web Oculta

O web profunda

– Bases de datos

– Un porcentaje alto de lo indexable

– Requieren interacción con formularios

Software

– Agente específico

– Base de datos con palabras del dominio

Page 23: Crawling the Web

23

Problemas Servidores

Uso de ancho de banda

Control de acceso al servidor

– /robots.txt

Control de acceso a los recursos

– Meta name=robots

Se puede identificar un crawler

Page 24: Crawling the Web

24

Problemas Crawler (1)Red

– Costo del ancho de banda

– Variable QoS

– Tiempos de espera, la latencia arruina la política de corto plazo

– Connect exitoso, write no exitoso (firewall)

DNS es cuello de botella

– Crash de DNS locales

– Fallas temporales DNS, en sitios chicos

– Records malos (bad.net misma IP que good.net, luego uno indexa y en los resultados muestra bad.net)

Page 25: Crawling the Web

25

Problemas Crawler (2)Implementación de HTTP

– No cumplen encabezado accept

– Errores de rango cuando se pide un fragmento● e.g.: bytes 0-100k de un archivo de 20k

– Respuesta sin encabezados

– 'Found' cuando quiere decir 'Error'● Redirect a página de error

– Fechas● Particularmente al pedir if-modified-since

Page 26: Crawling the Web

26

Problemas Crawler (3)Codificación HTML

– Elementos o atributos muy largos

– Uso de comillas simples y dobles mezcladas

– Tags vacíos, no vacíos, balanceados, no balanceados

URLs

– Sessionids

– Componentes repetidos

Contenido

– Muchos blogs y forums

– Mucho contenido duplicado

Page 27: Crawling the Web

27

Scheduling de largo plazoresultados

Page 28: Crawling the Web

28

Scheduling de largo plazoresultados

Page 29: Crawling the Web

29

Scheduling de largo plazoresultados

Page 30: Crawling the Web

30

Frescura de la copia localy cooperación del servidor

Page 31: Crawling the Web

31

Normal operation: polling

WebServer

SearchEngine

request

response

headerscontent

Page 32: Crawling the Web

32

Frescura y Edad

Frescura, F(página)

– 0 si la copia es DISTINTA del original

– 1 si la copia es IGUAL

Edad, E(página)

– 0 si la copia es igual al original

– x si han pasado x segundos desde que el original cambió

Page 33: Crawling the Web

33

Frescura y Edad

Tiempo

Edad

SyncUpdate

Tiempo

Frescura

Page 34: Crawling the Web

34

Interrupt­based operation

WebServer

SearchEngine

request

response

notify

Page 35: Crawling the Web

35

Cooperation issues

Objective: keep collection fresh

Problems

– Spamming: can't trust the web servers● Can't rely on quality assertions about pages.

– Privacy: can't trust the search engines● Can't give them full access to everything.

Technologies

– Compression, Differences of content, Fingerprints

– HTTP extensions, Web Services

Page 36: Crawling the Web

36

Cooperation schemes (1 of 2)

Serve meta­data/Notify changes

Serve differences/Send differences

Serve if­modified/Send pages

Pipelining server/Send batches

WebSvr

Srch

Eng

WebSvr

Srch

Eng

WebSvr

Srch

Eng

WebSvr

Srch

Eng

Page 37: Crawling the Web

37

Cooperation schemes (2 of 2)

Web service waitingfor crawlers:FILTERING INTERFACE

SearchEngine

WebServer

sync

Small program running at the server:REMOTE AGENT

SearchEngine

WebServer

sync

Page 38: Crawling the Web

38

Cost­benefit (polling)

Serve meta­data

Network Processing Benefit

Normal

Normal

Normal

Normal

High

Serve differences

Serve onlyif­modified

Serve batchesof pages

Filtering interface

Page 39: Crawling the Web

39

Cost­benefit (interrupt)

Send meta­data

Network Processing Benefit

Normal

Normal

Normal

Normal

High

Send differences

Send changed pages

Send batch update

Remoteagent

Page 40: Crawling the Web

40

Will websites cooperate ?

Large websites

– Will cooperate is there is a benefit for them

– Web service for crawlers and e.g. e-commerce brokers

Websites that are customers of a search engine

– Websites that pay to be indexed more often and provide co-branded searches

General websites

– We can use to some extent the HTTP features such as pipelining or other future extensions

Page 41: Crawling the Web

41

Conclusiones

Varios problemas relacionados con la naturaleza de la Web:

– Enorme

– Calidad variable

– Co-existencia de distintas implementaciones

Problemas aplicables en otros contextos

– Sincronizar una copia local

– Descubrir elementos importantes basándose en evidencia insuficiente