Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using get_random() to select a proxy is not optimal #49

Open
fredd-427 opened this issue Sep 25, 2020 · 0 comments
Open

Using get_random() to select a proxy is not optimal #49

fredd-427 opened this issue Sep 25, 2020 · 0 comments

Comments

@fredd-427
Copy link

fredd-427 commented Sep 25, 2020

Hello,
I discovered that using get_random() to choose a proxy from the list is not optimal, indeed in my example:

  • I crawl a site that uses datadom to protect itself from crawling, so not to be banned, I have a DOWNLOAD_DELAY at 180 seconds
  • I have 2 proxies in ROTATING_PROXY_LIST
  • DOWNLOAD_DELAY=180
  • CONCURRENT_REQUESTS_PER_DOMAIN=1
  • CONCURRENT_REQUESTS=2 (like the number of proxies)

Sometimes get_random() returns the same proxy as the spider already in use and therefore waits for the end of the DOWNLOAD_DELAY.

Would it be possible to replace get_random() with a get_unused() function? a function that returns the first "free" proxy that is not inside the DOWNLOAD_DELAY?

thank you
fred

1st file : log I observed with the problem (see the comments to the right)
2nd file : log without problem (see the comments to the right)
1st log.txt
2nd log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant