-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ØMQ (zeromq) isn't quite working #10
Comments
Not sure about the return issue, but is there a reason you wouldn't use valid URIs in your API (i.e. http://cssprefix.com/check.json?url=URLENCODEDURL)? Thanks, |
I haven’t looked at the code, but this sounds like it could be a scoping issue. |
@hardyjohnson no - there's not. But it's still in development and the scaling issue already hit my server hard enough to take the thing out. So yeah, the url should be validated first because I end up with junk files in the job directory. @mathiasbynens the jobs are passed back and forth via sockets, and only a single socket is setup (with workers listening and grabbing). I think it needs an intermediate process to join requests up to responses and pipe them back and forth correctly, but I'm not savvy enough with zeromq to know how to go about doing that (or even if it's correct). |
I'm learning about ZMQ sockets as I went on this, but even with just binding |
@lennym so send me a pull request! It's utterly new to me and I couldn't find any decent examples that I could get what I needed on the web (though the docs are superb, I needed the starting thread). |
TL;DR - please have a look at my zeromq setup - it's wrong and needs fixing - help me Obi-Wan....
I'm using zeromq to post off the job of parsing all the CSS in a url, and then once it's complete, it passes the message back to the the main app.js node process.
Ideally, lots of requests could come in, and I could be running 2-4 worker processes (
node prefix.js
) and requests would queue up, get processed, and returned to the correct waiting http client.My problem (aside from having never used zeromq or any queuing system for that matter) is that the job is passed off to the worker, but because (I think) I have an odd one-to-one queue set up, the same job gets returned to all of the clients.
It's tricky to replicate, because you need concurrent request - but here's an example:
Note that the last two return checks are exactly the same, even though the CSS is different for all three sites - which says to me that the worker returned to two clients - hence the screw up.
I'd love for someone with experience to dive in an have a decent crack at getting the parent / worker set up correct - then we'll have a web service that doesn't blow up my machine when concurrent requests come in!
The text was updated successfully, but these errors were encountered: