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

Scraper is eating our CPU. #234

Open
mooncalfskb opened this issue Dec 10, 2018 · 1 comment
Open

Scraper is eating our CPU. #234

mooncalfskb opened this issue Dec 10, 2018 · 1 comment

Comments

@mooncalfskb
Copy link

Dear Congress Folk:
As the year progress and the congress xml files on govinfo.gov get bigger and bigger, I am finding that downloading some files is eating 80-90% of our CPU, causing server lag times. Some example problem files are:

https://www.govinfo.gov/sitemap/BILLS_2018_sitemap.xml
https://www.govinfo.gov/sitemap/bulkdata/BILLSTATUS/115hr/sitemap.xml

I would humbly suggest that you need to put a stream handler in the download function of utils in order to download the files in chunks. Examples suggested here:
https://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py

Thanks
Sherrod

@konklone
Copy link
Member

@mooncalfskb Thanks for identifying this. Would you be up for submitting a pull request which refits our download method to use a streaming handler?

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

2 participants