loops - how to practice good ethics while executing many curl requests in php -



loops - how to practice good ethics while executing many curl requests in php -

i have done fair amount of reading on , not quite sure right way go is.

i accessing websites api provides info using on site. on average making on 400 different api requests means on 400 curl requests. proper way create code pause amount of time continue. site not limit amount of hits on not banned pulling of stuff @ once, not want server when 10,000 people me same thing. trying pause code , politely utilize service offer.

what best method pause php execution resource consumption in mind?

what courteous amount of requests per wait cycle?

what courteous amount of wait per cycle?

with of these questions obtain info fast possible while attempting remain in above questions.

sample eve central api response

thank in advance time , patience.

here's thought: have asked? if api has problem handling high load, include limit in terms. if not, i'd recommend emailing service provider, explain want do, , inquire think reasonable load. though it's quite possible servers quite capable of handling load might reasonably want give it, why don't specify.

if want service provider, don't guess want want. ask, , you'll know how far can go without upsetting people built api.

for actual mechanics of pausing, i'd utilize method alex suggested (but has since deleted) of php's usleep.

php loops curl wait

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -