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

(Feature Request) Throttling number of spiders running concurrently in the same process #869

Open
madvas opened this issue Aug 30, 2014 · 6 comments
Labels

Comments

@madvas
Copy link

@madvas madvas commented Aug 30, 2014

It would be nice to be able to throttle number of spiders running concurrently from the script as in a docs in "Common Practices" (http://doc.scrapy.org/en/latest/topics/practices.html#running-multiple-spiders-in-the-same-process)

I was doing spider, which started them few hundreds at once, it didn't work, logging didn't even started.
It would be nice if we could easily set this number.

Thank you very much,
You're doing great job guys!

@madvas
Copy link
Author

@madvas madvas commented Aug 30, 2014

Btw, I needed hundreds of different spiders, because I needed to use hundreds of different cookies, it wasn't for different domains as in docs example. If there's better way I should approach this, please feel free to tell me :)

@kmike
Copy link
Member

@kmike kmike commented Aug 30, 2014

Hi @madvas,

Maybe you can use cookiejar meta key?

But I'm curious why starting a few hundreds at once didn't work.

@madvas
Copy link
Author

@madvas madvas commented Aug 30, 2014

Hello @kmike,

Well, I don't know neither, I wasn't digging too much into it, cuz I didn't want to overload server. Maybe with cookiejar it would be possible also. Basically what I needed was to log in with around hundred of different accounts and then do scraping. I found this quite clean solution for this.

@jmaynier
Copy link

@jmaynier jmaynier commented Sep 21, 2016

@kmike
I use cookiejar for this kind of situationm, but it seems that you cannot specify CONCURRENT_REQUESTS and DOWNLOAD_DELAY per cookiejar.

@kmike
Copy link
Member

@kmike kmike commented Sep 21, 2016

@jmaynier you can set custom request.meta['download_slot'] for requests, an unique value per cookiejar. This way concurrency settings will work per cookiejar.

@jmaynier
Copy link

@jmaynier jmaynier commented Sep 21, 2016

Thanks @kmike, it seems to be exactly what I was looking for ! I will try it right away :-)
It should be part of scrapy documentation.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.