Skip to content

Commit

Permalink
add extra config for parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jun 14, 2016
1 parent f0458c7 commit 5eac1fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mhart/alpine-node:6.2.1
FROM mhart/alpine-node:5.10.1

# Tools
RUN apk update && apk add git curl wget bash
Expand Down
2 changes: 2 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var defaults = {
"DEFAULT_DELAY": 1000, // delay between API requests (default: 1000)
"SCANNER_DELAY": 300, //delay for scanner API requests (more time-sensitive)
"SCANNER_PARALLELISM": 1, //Number of simultaneous API requests to make in scanner
"MMR_PARALLELISM": 15,
"PARSER_PARALLELISM": 1,
"PLAYER_MATCH_LIMIT": 50000, //max results to return from player matches
"BENCHMARK_RETENTION_HOURS": 1, //hours in block to retain benchmark data for percentile
"MATCH_RATING_RETENTION_HOURS": 12, //hours in block to retain match rating data for percentile
Expand Down
2 changes: 1 addition & 1 deletion svc/mmr.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var config = require('../config');
var mQueue = queue.getQueue('mmr');
var getData = utility.getData;
var retrieverArr = config.RETRIEVER_HOST.split(",");
mQueue.process(retrieverArr.length * 10, processMmr);
mQueue.process(retrieverArr.length * config.MMR_PARALLELISM, processMmr);
mQueue.on('completed', function(job)
{
job.remove();
Expand Down
2 changes: 1 addition & 1 deletion svc/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ app.get('/redis/:key', function(req, res, cb)
});
app.listen(config.PARSER_PORT);
//END EXPRESS
pQueue.process(1, function(job, cb)
pQueue.process(config.PARSER_PARALLELISM, function(job, cb)
{
console.log("parse job: %s", job.jobId);
var match = job.data.payload;
Expand Down

0 comments on commit 5eac1fe

Please sign in to comment.