Skip to content
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

serial access on localhost too slow #16

Open
supermonster opened this issue Jul 30, 2013 · 3 comments
Open

serial access on localhost too slow #16

supermonster opened this issue Jul 30, 2013 · 3 comments

Comments

@supermonster
Copy link

If I serialize put operation it's painfully slow. I am used to 25-30K operations per second on beanstalkd with php, this one operates at 10 operations per second. When I queue up several thousand operations in async mode then it's moderately fast.

@ceejbot
Copy link
Owner

ceejbot commented Jul 30, 2013

Doing it asynchronously would be the natural way to do things with node. However, being so slow is not desirable. I haven't done any performance profiling work at all on this project yet. If you have any data on exactly what's slow for you, that would be helpful. Otherwise, I'll look into this & do some profiling.

@supermonster
Copy link
Author

Skipping some init code here's the meat:

put();

function put()
{
    var payload = JSON.stringify({a:1, b:"test"});
    beans.put(priority=0, delay=0, ttr=30, payload, function(err, job_id) {
        if (err) throw err;
        console.log((new Date()).valueOf()/1000);
        setImmediate(put);
    });
}

result:

1375225841.397
1375225841.437
1375225841.477
1375225841.517
1375225841.557
1375225841.597
1375225841.637
1375225841.677
1375225841.717
1375225841.757
1375225841.797
1375225841.837

So you can see every synchronized request taking ~40ms. I've just started using the module. Am I doing something wrong?

@jtsoi
Copy link
Contributor

jtsoi commented Dec 18, 2013

@supermonster,

This issue might be resolved now, see this PR: #21

/JT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants