Comments (7)
@adrianpaiva1 This is probably beacuse of the 'ticks' are removed. You can use it like this or can add 'sleep' to your controller.
To investigate it further can you please let me know which version of php you are using?
Thanks,
from yii2-beanstalk.
Hi I'm running PHP 7.1.71. Thanks for looking into this, love this library!
I currently have the sleep setting at 3.
Just give you some more info, none of the workers were actually processing jobs. They had crazy high CPU usage without any jobs.
from yii2-beanstalk.
Hi again,
Sleep 3 is very low i mean you can set it something like 100. It is ms. Still it should reduce CPU usage, did it?
Thank you for support.
from yii2-beanstalk.
Hi, I have the same issue since I installed the last version.
This is the unchanged config which causes high CPU load on both the PHP worker process and the beanstalk process:
'beanstalk' => [
'class' => 'udokmeci\yii2beanstalk\Beanstalk',
'host' => '127.0.0.1',
'port' => 11300,
'connectTimeout' => 1,
'sleep' => 60,
],
I've changed the sleep value to 1000, but not no avail.
A different software package that uses the previous version of yii2-beanstalk uses sleep 60 to and does not show out of bound CPU usage.
Andre
from yii2-beanstalk.
It looks like the issue is pointing to getting a RESPONSE_TIMED_OUT whilst trying to reserve the tube in beforeAction of BeanstalkController.php (lines 303-320):
$job = $bean->reserve(0);
if (!$job) {
continue;
}
Using time-out of 0 keeps the process cycling in the while loop and consuming all available CPU cycles. The after job sleep needs to be added before the continue to fix this issue.
from yii2-beanstalk.
Added pull request #37 to make CPU load manageable through sleep.
from yii2-beanstalk.
Thanks merged and released! Controller or Component could also have a default timeout for reserve method.
from yii2-beanstalk.
Related Issues (20)
- Limit number of tubes to be watched HOT 3
- PHP7, declaration of action is not compatible HOT 1
- Use of undefined constant STDOUT - assumed 'STDOUT' HOT 2
- Integration test HOT 3
- Releases HOT 2
- SQLSTATE[HY000] [1040] Too many connections HOT 2
- PHP7 signal handler HOT 4
- Name for actions HOT 2
- Can't use tube named index HOT 1
- Database is require while it shouldn't HOT 1
- I18n error
- How to use logger? HOT 2
- please use version tags HOT 1
- Possible race condition HOT 3
- How to avoid default tube listening? HOT 2
- Multiple workers HOT 3
- `db` component usage hardcode HOT 3
- Reconnection
- This software not working with last version of beanstalkd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-beanstalk.