Hi Jose,
I suspect there is some kind of limit on the server you're requesting the websites from. Typhoeus is very fast and you're perhaps throttled. You could put the failed requests back in the queue and try them later.
You described that you're putting chunks of 40 requests in the hydra - thats not necessary. The hydra can handle that itsself with the option max_concurrency. If you say 'Typhoeus::Hydra.new(:max_concurrency => 40)' and queue _all_ your requests the hydra will never do more than 40 requests at a time.
--
Hans
On Wednesday, October 24, 2012 at 9:01 PM, Jose Luis Estrella Campaña wrote:
> Hi there !
>
> I've been using the typhoeus gem to increase the speed of scrapping of a huge website(amount of items wise), without typhoeus the scrapping finished correctly, but it was very slow. So I heard this gem could help me.
> Now, my problem is that Scrapping is stopping at the same point every single time I run it.
>
> I'm using the classic block you guys have to handle errors:
> if response.success?
> # hell yeah
> elsif response.timed_out?
> # aw hell no
> log("got a time out")
> elsif response.code == 0
> # Could not get an http response, something's wrong.
> log(response.curl_error_message)
> else
> # Received a non-successful http response.
> log("HTTP request failed: " + response.code.to_s)
> end
>
>
> and it always goes to the response.code == 0 of the handler, I reiterate it stops at the same point always(a specific URL), and I'm trying 40 simultaneous connections at a time (I finish those 40, and I try another 40, etc)
>
> Is this a common pitfall? or is there a configuration I should be aware of?
>
> Thanks in advance!
>
>
> --
> You received this message because you are subscribed to the Google Groups "Typhoeus" group.
> To view this discussion on the web visit
https://groups.google.com/d/msg/typhoeus/-/5FpGLqpIl7QJ.
> To post to this group, send email to
typh...@googlegroups.com (mailto:
typh...@googlegroups.com).
> To unsubscribe from this group, send email to
typhoeus+u...@googlegroups.com (mailto:
typhoeus+u...@googlegroups.com).
> For more options, visit this group at
http://groups.google.com/group/typhoeus?hl=en.