I am using beanstalkc in Python for a queuing process for a program which has to parse a list of URLs. Hence I am using timeout in beanstalk for avoiding huge time consumption by any URL. But even after using it my process doesn't time out in the limit and is taking a lot of time for parsing few URLs. I am using the following code:
for seed in seedlist:
print 'Put data: %s' % seed
bean.put(seed,ttr =5)
while True:
job = bean.reserve()
spider.spider(job.body)
print 'Got data: %s' % job.body
I think you are misunderstanding the purpose of beanstalkd's TTR timeouts. Quoting the beanstalkd FAQ:
So the TTR does not help you in "avoiding huge time consumption by any URL". It does not magically kill your worker processes. All it does is that beanstalkd puts a job back into the queue, if a worker doesn't mark the job as finished after a given timespan (the TTR).