Low worker performance ?

Asked by Sam

Hi, I made a simple test code to test the performance of gearman. I'm not sure if I have down right. Please give me some advise.
I'm using jmater, config is:
Number of threads = 200
Ramp-Up Period=20
Loop Count=forever

The problem is:
When jmater threads is running in little time, soon comes more than 80,000 jobs in queue and increase rapidly.
Is that mean the workers is so low performance ? Because so simple a job takes relatively a lot time to be done.
Maybe this is not a good usage or my conclusion is wrong or something ?

The test code is below:

Server with client code (a https server using node.js with gearmanode):
//=============
var https = require('https');
var fs = require('fs');
var express = require('express');

var options = {
    key: fs.readFileSync('./moduletst/key.pem'),
    cert: fs.readFileSync('./moduletst/cert.pem')
};

var gearmanode = require('gearmanode');
var client = gearmanode.client({servers: [{host: '192.168.220.129'}]});
gearmanode.Client.logger.transports.console.level = 'info';
var count = 0;

var app = express()
    .use("/gearmantst", function (req, res) {
        var job = client.submitJob('tst', 'gearman tst ' + (++count), {background: true});
        res.end('finish: ' + count);
    })
    .use(function (err, req, res, next) {
        res.end('Invalid body!');
    });

https.createServer(options, app)
    .listen(3000);
//=============

Worker code (using node.js with gearmanode too):
//=============
var gearmanode = require('gearmanode');
var worker = gearmanode.worker({servers: [{host: '192.168.220.129'}]});

gearmanode.Worker.logger.transports.console.level = 'info';

worker.addFunction('tst', function (job) {
    var data = job.payload;
    console.log("############ getdata:", data);
    job.workComplete("1");
}, {toStringEncoding: 'utf8'});
//=============

Question information

Language:
English Edit question
Status:
Expired
For:
Gearman Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.