kr/beanstalkd — pull request #169 by nephics (2013-03-07 17:04:17+00:00)
Title: Beanstalkd uses a lot more CPU cycles when the system is under high load

I experience that beanstalkd uses a lot CPU cycles when the system is under high load. This, even when beanstalkd is not in use.

This simple test shows the issue in effect:
* beanstalkd v1.8 on an Amazon EC2 Large instance with Ubuntu Linux 12.04.2 LTS.
* No jobs in beanstalkd
* Saturate the available CPU cycles with a couple of nice'd dummy processes, using:
`nice -n 10 python -c "while True: x=2**10"&`

In this test beanstalkd (according to top) uses between 15% and 20% of the CPU cycles. As soon as the high load is stopped, beanstalkd goes back to nearly ~0% CPU.

This observed behaviour is quite unfortunate. So what is happening, and is it expected behaviour?