Comments (9)
@mamantoha I've sorted it out. I spent way too much time assuming the problem was in the new executor architecture but that is completely unrelated. The issue is here, this line:
def self.start(spin = true)
Log.notice { "Mosquito is buzzing..." }
instance.run
while spin && keep_running
+ Fiber.yield
end
end
I made the mistake of assuming that Fiber.yield was actually communicating to the scheduler that it should transfer control to another fiber, but that is apparently not the case. I'll make a sleep 2
patch shortly, and put in an issue for a smarter Runner one-shot class that doesn't just sleep.
Sorry for the delay in sorting this out!
from mosquito.
@mamantoha Thanks for trying out the new concurrent executor feature!
I'd be happy to help you sort this out. I've run shards.info locally with that commit and had no issue, but it doesn't mean something isn't broken. I think the log configuration for shards.info puts mosquito logs in a separate file -- can you share the logs from the worker when it's pegging the CPU to 100%?
from mosquito.
It’s possible that 100% CPU usage is actually Mosquito doing what it was designed to do. How long did the CPU burst last? I believe I’m able to do a full update scrape in just a few minutes on my laptop.
Shards.info is a network bound workflow so running multiple threads will allow the scrape to be parallelized and scrape much faster than single threaded.
I haven’t set a configuration variable for it yet but you can monkey patch to change the number of executors which get spawned.
from mosquito.
The CPU usage has consistently remained at 100% (Jan 3 - Jan 11), and it returns to normal after reverting to the previous mosquito commit.
I will try to reduce the issue on my Linux laptop over the weekend.
from mosquito.
Ah yeah, I didn't think to look at the graph. If you can send me a database dump I'm happy to run it locally and see where the problem is too.
from mosquito.
@robacarp I successfully replicated the issue on my Linux laptop. Where can I send you a database dump?
Setting getter executor_count = 1
didn't help.
It appears that the process consumes 100% CPU even when no jobs are being executed.
from mosquito.
On macOS, the CPU usage is approximately 10%.
On e6b4b0a around 0%.
from mosquito.
Oh interesting, thank you for the context. I'll shell into a linux VM somewhere and see if I can replicate.
I doubt the database is important.
from mosquito.
Thanks @robacarp
from mosquito.
Related Issues (20)
- Leaky Bucket Queue?
- Array support for params (or better error message...) HOT 5
- mosquito is completely broken after 1.0.1 HOT 5
- Graceful shutdown when receiving the TERM signal HOT 7
- Make executor count configurable HOT 1
- Ability to specify a redis connection pool from an application, instead of making mosquito handle it all
- Add a before/after enqueue set of hooks
- Add hook for job-interrupted, and improve scheduling logic to requeue a job if it needs to be terminated
- unknown command `lmove` HOT 6
- Run mosquito using multiple processes HOT 7
- Job crashing with Missing hash key: "limit" (KeyError) HOT 11
- Address developer experience around Job#job_type
- Memoize an exception thrown by a job so it can be analyzed in an after-hook?
- Provide API for inspecting the backend data
- Provide a way to detect and clean up jobs which were started but never finished HOT 1
- Redis RPOPLPUSH command is deprecated since Redis 6.2
- Provide an easy way to cancel a job without it being rescheduled
- Support error handlers HOT 3
- Update runner to use time::span instead of bare seconds, and monotonic for the idle wait
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 mosquito.