metakgp / iqps-go

Search for question papers when the library can't save you.
https://qp.metakgp.org
GNU General Public License v3.0
16 stars 9 forks source link

Make the crawler concurrent #91

Open rajivharlalka opened 1 week ago

rajivharlalka commented 1 week ago

Is your feature request related to a problem? Please describe. Currently the crawler sequentially fetches each paper details, parses it and downloads the paper. This can be made lot faster using go-routines.

shikharish commented 1 week ago

This was implemented then removed because it lead to the library website dropping requests.

rajivharlalka commented 1 week ago

Did the implementation have an upperbound on the number of parallel requests being made? AFAIR no. IMO using waitgroups to limit the number of concurrent workers to 2-3 should improve the perform significantly.

shikharish commented 1 week ago

I dont remember exactly. BTW we won't need to implement go-routines ourselves as colly has an option to enable async request and also limit them. Can test that.

proffapt commented 3 days ago

@rajivharlalka or @harshkhandeparkar please update the state of this issue to be reflected on the kanban.

harshkhandeparkar commented 2 days ago

@shikharish what should be the status of this?

shikharish commented 2 days ago

It is not needed as of now. We only need to run the crawler once or twice a semester so it's very low priority.

harshkhandeparkar commented 2 days ago

Is it hard to do?

shikharish commented 2 days ago

Not at all

harshkhandeparkar commented 2 days ago

Then just finish it off maybe?

harshkhandeparkar commented 2 days ago

No point in keeping hanging issues if they can be solved in a few minutes.

proffapt commented 2 days ago

@shikharish updates?

shikharish commented 2 days ago

Did some testing and turns out even using 2 go routines leads to dropping of 1-2 requests. Further increasing it to 6 goroutines makes it 3-4 requests.

Should we skip this one for now?

proffapt commented 1 day ago

Try to implement a retry function. Also, how many requests are you able to make concurrently. Even if it is more than one, then that's a win situation.

proffapt commented 1 day ago

Halting this, till we have time to have a look at it comfortably.