Skip to content
Merged

0.9.x #169

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
ab757f8
Refactor queue implementation, add docs on queue performance & fix so…
sylvinus Feb 19, 2017
3fbdd2e
Fix some more tests
sylvinus Feb 20, 2017
5af3eec
travis debug
sylvinus Feb 20, 2017
eef164f
more debug in travis
sylvinus Feb 20, 2017
3adf4d0
Fix psutil API change
sylvinus Feb 20, 2017
484d7ee
more psutil fixes
sylvinus Feb 20, 2017
451d15b
Fix tests
sylvinus Feb 20, 2017
4744e2b
another fix for psutil api change
sylvinus Feb 20, 2017
9c1550e
More test fixes
sylvinus Feb 21, 2017
df43ea5
Fix tests & restore queued order
sylvinus Feb 22, 2017
cd0b3a9
maxconcurrency refactor
sylvinus Feb 26, 2017
5d6cc22
Add Agent, ProcessPool, and our own Supervisor
sylvinus Feb 27, 2017
57800f8
Agent fixes
sylvinus Feb 28, 2017
639f950
Worker group dashboard + misc fixes
sylvinus Feb 28, 2017
5f51521
0.9.0
sylvinus Mar 1, 2017
7c1e229
Fix agent shutdown
sylvinus Mar 6, 2017
d34c316
Refactor queue implementation (#150)
sylvinus Mar 6, 2017
426dc4a
Merge branch 'agent' into 0.9.x
sylvinus Mar 7, 2017
7b8bd67
stabilize more tests
sylvinus Mar 7, 2017
9689dc0
fix network latency test
sylvinus Mar 8, 2017
77afe3f
add test timeout
sylvinus Mar 8, 2017
57a0113
fix timeout
sylvinus Mar 8, 2017
1daf54d
Deprecate no_mongodb_ensure_indexes & subqueues_delimiter options. Be…
sylvinus Mar 11, 2017
8af36b7
Refactor of the scheduler & test fixes
sylvinus Mar 13, 2017
e91eee6
add missing dep
sylvinus Mar 13, 2017
a879a6b
Make sure the python3 tests actually use python3 !
sylvinus Mar 13, 2017
233821b
Faster wait_for_idle
sylvinus Mar 17, 2017
98d85d0
Better wait_for_idle
sylvinus Mar 18, 2017
09d0c43
Agent improvements + Dashboard page
sylvinus Mar 19, 2017
a5f3d42
Safer wait_for_idle
sylvinus Mar 22, 2017
9fe0579
Autoscaling!
sylvinus Mar 27, 2017
0fd9f29
Fix agent tests + coverage for subprocesses
sylvinus Mar 27, 2017
311c492
Merge branch 'master' into 0.9.x
sylvinus Mar 27, 2017
4895e66
Requirements update
sylvinus Mar 27, 2017
55e8310
Add missing index + better worker.stop in tests
sylvinus Mar 29, 2017
a490347
Add a test for scheduler restart
sylvinus May 1, 2017
2e5d48c
Disable cache busting for dashboard
sylvinus May 6, 2017
51ed2a3
patch
mehdigmira May 24, 2017
6555dc4
Merge pull request #168 from pricingassistant/scheduler-patch
FlorianPerucki May 26, 2017
31a6a7c
Agent has user-provided callback and tries to enforce worker profile …
sylvinus Jun 18, 2017
a26762f
Merge branch '0.9.x' of github.com:pricingassistant/mrq into 0.9.x
sylvinus Jun 18, 2017
7b7cd1f
protect from orchestration crashes
sylvinus Jun 18, 2017
3c32e30
Don't decode redis responses (revert to default)
sylvinus Jun 19, 2017
367861b
implement process_termination_timeout
sylvinus Jun 19, 2017
759f7a0
Python 3 fixes
sylvinus Jun 19, 2017
e2b3122
Upgrade pylint
sylvinus Jun 19, 2017
eb1d4ed
More Python 3 fixes
sylvinus Jun 19, 2017
8b03f4c
Task whitelisting + SIGKILL in agent
sylvinus Jun 20, 2017
e8cd61a
Save traceback history by default
sylvinus Jun 21, 2017
aa530da
temporarily disable sorting in the jobs dashboard
sylvinus Jun 28, 2017
865f46f
Performance optims + prototype PyPy support
sylvinus Jun 28, 2017
97fe009
Make sure env variables are passed correctly from agent to processes
sylvinus Jun 30, 2017
9861f62
Fix traceback API
sylvinus Jul 8, 2017
003e437
prefer displaying traceback_history
sylvinus Jul 8, 2017
0c537db
only take started agents into account
sylvinus Aug 1, 2017
e016ec4
move to webpack
mehdigmira Sep 28, 2017
3318e40
rm old config
mehdigmira Sep 28, 2017
a837187
dockerfile fixes
mehdigmira Sep 28, 2017
4c773ad
Merge pull request #185 from pricingassistant/to-webpack
mehdigmira Sep 29, 2017
3fb7d0b
do not send multiple queries to backend
mehdigmira Sep 29, 2017
aac2ef0
rm from .gitignore
mehdigmira Sep 29, 2017
b838d97
Merge pull request #186 from pricingassistant/performance
mehdigmira Sep 29, 2017
bcc94a9
webpack generated files
mehdigmira Sep 29, 2017
3eb6720
Merge branch '0.9.x' of https://github.com/pricingassistant/mrq into …
mehdigmira Sep 29, 2017
6e1a900
moment
mehdigmira Sep 29, 2017
1980826
Some cleaning tasks are not needed anymore
sylvinus Oct 19, 2017
e281a84
add task to repopulate known queues
Nov 14, 2017
6fd40e8
Correctly patch HTTPConnection.request for Python 3.6 (#184)
Dec 7, 2017
5856134
fix runtime error in get_worker_report
mehdigmira Dec 20, 2017
9b45a8b
don't search entire queue
Jan 10, 2018
cb58ac4
add external ip in config
Jan 10, 2018
40f867d
add external ip on dashboard
Jan 10, 2018
2d224cb
add dateexpires on other statuses
Jan 11, 2018
8ab4942
default job ttl
Jan 15, 2018
92bd2ea
add default value in config for job ttl
Jan 15, 2018
c970335
add minified js
Jan 15, 2018
b212787
fix makefile
Jan 16, 2018
b8d7112
update known queues when requeuing jobs
Jan 16, 2018
5ee1335
Merge branch '0.9.x' into task_expiry
Jan 17, 2018
2b8f364
Merge branch 'master' of github.com:pricingassistant/mrq into 0.9.x
sylvinus Jan 17, 2018
0503a0f
Store subpool tracebacks + test fixes
sylvinus Jan 17, 2018
7a7a598
Merge branch '0.9.x' of github.com:pricingassistant/mrq into 0.9.x
sylvinus Jan 17, 2018
f5e3cf0
make sure there's no job before cleaning a known queue
Jan 19, 2018
04e2e8a
fix cleaning logic
Jan 19, 2018
bfcc5bc
more readable condition
Jan 19, 2018
3b78c0e
Merge branch '0.9.x' into task_expiry
Feb 8, 2018
f607354
fix task expiry ttl
Feb 12, 2018
68f5240
Add warning when context.get_current_config is called before context.…
mongin Mar 6, 2018
78a54ac
remove supervisord from doc
Romarci Mar 6, 2018
b4a65b3
Merge branch 'workshop' of https://github.com/pricingassistant/mrq in…
mongin Mar 6, 2018
ffd31fd
Don't build subprocess32 by default on windows. Fixes #119
sylvinus Mar 6, 2018
d22efd7
Merge branch 'workshop' of github.com:pricingassistant/mrq into workshop
sylvinus Mar 6, 2018
9df282f
filters in workers tab
mehdigmira Mar 6, 2018
09ad19a
add exceptiontype in jobs tab
mehdigmira Mar 6, 2018
8cd35a9
Rename docker container, remove useless subprocess32 usages
sylvinus Mar 6, 2018
13fb673
Merge branch 'workshop' of github.com:pricingassistant/mrq into workshop
sylvinus Mar 6, 2018
7e732f6
Don't use absolute paths in dashboard
sylvinus Mar 6, 2018
fc971ce
Merge https://github.com/tume/mrq/commit/97e2a53136acceba4ace5f043a23…
sylvinus Mar 6, 2018
c73d51b
Add scheduler exemple
mongin Mar 6, 2018
62d7c3d
Merge branch 'workshop' of https://github.com/pricingassistant/mrq in…
mongin Mar 6, 2018
cf213b6
fix cancel by worker + test
mehdigmira Mar 6, 2018
a4a9abe
move worker orchestration code to a separate task
Mar 6, 2018
1b82351
prints
Mar 6, 2018
76d40b9
prevent new scheduled task with dailytime to run if dailytime already…
Mar 6, 2018
5196614
Update simple crawler exemple
mongin Mar 6, 2018
88b75c3
Merge branch 'workshop' of https://github.com/pricingassistant/mrq in…
mongin Mar 6, 2018
0320837
Add cleaning jobs don't over-reach and tests
NicoZivy Mar 6, 2018
3198712
Merge remote-tracking branch 'origin/workshop' into workshop
NicoZivy Mar 6, 2018
2815446
logger refactor
Mar 7, 2018
3f61fab
consistency fixes
Mar 7, 2018
da8c2f2
change logger name
Mar 7, 2018
26e34e5
timed set example
Romarci Mar 8, 2018
fce95dc
Merge branch 'workshop' of github.com:pricingassistant/mrq into workshop
Romarci Mar 8, 2018
9b199d3
fix mrq_logs creation
Romarci Mar 8, 2018
24f64f1
add config + update readme
Romarci Mar 8, 2018
2bc80e6
Update doc for exemples
mongin Mar 9, 2018
445890a
Merge branch 'workshop' of https://github.com/pricingassistant/mrq in…
mongin Mar 9, 2018
be6f3c6
fix iterating keys for python3
Mar 20, 2018
23ec9e8
Refactor subqueue implementation
sylvinus Apr 22, 2018
14e30a7
docker build
Apr 26, 2018
cffcf7d
one clean too many
Apr 26, 2018
a0344c4
update image name
Apr 26, 2018
51684f2
fix mongo logger
Apr 26, 2018
a784bf5
fix testjobaction
Apr 26, 2018
414f89e
fix test_general
Apr 26, 2018
dd478af
test iohooks
Apr 26, 2018
a1a5894
fix test concurrency
Apr 26, 2018
7cb565e
restore quiet logger option
Apr 26, 2018
1804923
test cancel
Apr 26, 2018
25f5305
non existing type
Apr 26, 2018
9658241
test raw
Apr 27, 2018
b56b097
fix test_routes
May 24, 2018
acbb6cd
Test fixes
sylvinus May 27, 2018
77c9042
Merge branch 'workshop' of github.com:pricingassistant/mrq into workshop
sylvinus May 27, 2018
20162a4
Refactor redis_key methods
sylvinus May 27, 2018
322b95c
skip agent test for now
May 28, 2018
24abc67
Merge branch 'workshop' into 0.9.x
May 28, 2018
6d03846
fix ttl attribute error
May 28, 2018
262b45f
fix attribute error
May 28, 2018
34dae37
Make command-line flags explicitly passed with default values able to…
sylvinus Jun 14, 2018
9fe3b3a
no need to ensure known queues
Jun 14, 2018
916a8e8
Relax requirement on gevent 1.3
sylvinus Jun 28, 2018
dcb7c95
Don't check for queue size at each remove_raw_jobs
sylvinus Jun 30, 2018
5737a6e
Allow filtering by parent queues
sylvinus Jul 13, 2018
7180bb6
fix task cancelation
Jul 23, 2018
f1c4acd
cancel edgecases
Jul 24, 2018
21dd22c
flatten worker groups
Jul 31, 2018
5f49482
fix tests
Aug 1, 2018
728c2bd
Add full paths in traces by default
sylvinus Aug 1, 2018
9c4f913
Merge branch '0.9.x' of github.com:pricingassistant/mrq into 0.9.x
sylvinus Aug 1, 2018
ea9c9a2
New method of checking timeouted jobs, add maxconcurrency status in d…
sylvinus Aug 9, 2018
6b3d61b
add metrics class
Aug 21, 2018
dc1991b
fix tests
Aug 21, 2018
41e6225
correctly use metrics
Aug 22, 2018
086e463
multiply worker group commands by number of processes
Aug 23, 2018
0e7c655
typo
Aug 23, 2018
e073a09
extra space
Aug 27, 2018
a6d89c4
Merge pull request #204 from pricingassistant/refactorworkergroup
maelorn Aug 27, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ develop-eggs
lib
lib64
__pycache__
.cache

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -44,3 +45,5 @@ mrq-config.py
dump.rdb
supervisord.pid
memory_traces
mrq/dashboard/static/node_modules/
.vscode
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
env:
- PYTHON_BIN=python
- PYTHON_BIN=python3
- PYTHON_BIN=/pypy/bin/pypy

before_install:
- docker ps
Expand All @@ -15,5 +16,6 @@ before_install:

# TODO: coveralls?
script:
- docker run -i -t -v `pwd`:/app:rw -w /app mrq_local $PYTHON_BIN -m pylint --errors-only --init-hook="import sys; sys.path.append('.')" -d E1103 --rcfile .pylintrc mrq
- docker run -i -t -v `pwd`:/app:rw -w /app mrq_local $PYTHON_BIN -m pytest tests/ -v --junitxml=pytest-report.xml --cov mrq --cov-report term
- docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq $PYTHON_BIN -m pylint --errors-only --init-hook="import sys; sys.path.append('.')" -d E1103 --rcfile .pylintrc mrq
# - docker run -i -t -v `pwd`:/app:rw -w /app mrq_local $PYTHON_BIN -m pytest tests/ --collect-only
- docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq $PYTHON_BIN -m pytest tests/ -v --junitxml=pytest-report.xml --cov mrq --cov-report term --timeout-method=thread --timeout=240
41 changes: 32 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ FROM debian:jessie
# https://github.com/docker-library/buildpack-deps/issues/40
#

RUN echo \
'deb ftp://ftp.us.debian.org/debian/ jessie main\n \
deb ftp://ftp.us.debian.org/debian/ jessie-updates main\n \
deb http://security.debian.org jessie/updates main\n' \
> /etc/apt/sources.list

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" > /etc/apt/sources.list.d/mongodb-org-3.0.list
# RUN echo \
# 'deb ftp://ftp.us.debian.org/debian/ jessie main\n \
# deb ftp://ftp.us.debian.org/debian/ jessie-updates main\n \
# deb http://security.debian.org jessie/updates main\n' \
# > /etc/apt/sources.list

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
RUN echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" > /etc/apt/sources.list.d/mongodb-org-3.4.list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
Expand All @@ -21,17 +21,27 @@ RUN apt-get update && \
python-pip \
python3-pip \
python3-dev \
make \
git \
vim \
mongodb-org-server \
bzip2 \
mongodb-org \
nginx redis-server \
g++ \
&& \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*

RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
RUN apt-get install -y --no-install-recommends nodejs

# Download pypy
RUN curl -sL 'https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.8-1-linux_x86_64-portable.tar.bz2' > /pypy.tar.bz2 && tar jxvf /pypy.tar.bz2 && rm -rf /pypy.tar.bz2 && mv /pypy-* /pypy

# Upgrade pip
RUN pip install --upgrade --ignore-installed pip
RUN pip3 install --upgrade --ignore-installed pip
RUN /pypy/bin/pypy -m ensurepip

ADD requirements-heroku.txt /app/requirements-heroku.txt
ADD requirements-base.txt /app/requirements-base.txt
Expand All @@ -50,8 +60,21 @@ RUN pip install -r /app/requirements-heroku.txt && \
pip install -r /app/requirements-dashboard.txt && \
rm -rf ~/.cache

RUN /pypy/bin/pip install -r /app/requirements-heroku.txt && \
/pypy/bin/pip install -r /app/requirements-base.txt && \
/pypy/bin/pip install -r /app/requirements-dev.txt && \
/pypy/bin/pip install -r /app/requirements-dashboard.txt && \
rm -rf ~/.cache

RUN mkdir -p /data/db

RUN ln -s /app/mrq/bin/mrq_run.py /usr/bin/mrq-run
RUN ln -s /app/mrq/bin/mrq_worker.py /usr/bin/mrq-worker
RUN ln -s /app/mrq/bin/mrq_agent.py /usr/bin/mrq-agent
RUN ln -s /app/mrq/dashboard/app.py /usr/bin/mrq-dashboard

ENV PYTHONPATH /app

VOLUME ["/data"]
WORKDIR /app

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile-with-code
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM pricingassistant/mrq-env:latest

ADD ./mrq /app/mrq
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include *.md
recursive-include mrq/supervisord_templates *
include requirements*
recursive-include mrq/dashboard/static *
recursive-include mrq/dashboard/templates *
Expand Down
50 changes: 29 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,57 @@
docker:
docker build -t mrq_local .
docker build -t pricingassistant/mrq-env .
docker build -t pricingassistant/mrq -f Dockerfile-with-code .

docker_push:
docker push pricingassistant/mrq-env:latest
docker push pricingassistant/mrq:latest

test: docker
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app mrq_local python -m pytest tests/ -v --instafail"
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app pricingassistant/mrq-env python -m pytest tests/ -v --instafail"

test3: docker
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app mrq_local python3 -m pytest tests/ -v --instafail"
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app pricingassistant/mrq-env python3 -m pytest tests/ -v --instafail"

testpypy: docker
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app pricingassistant/mrq-env /pypy/bin/pypy -m pytest tests/ -v --instafail"

shell:
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -p 8000:8000 -v `pwd`:/app:rw -w /app mrq_local bash"
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -p 8000:8000 -v `pwd`:/app:rw -w /app pricingassistant/mrq-env bash"

reshell:
# Reconnect in the current taskqueue container
sh -c 'docker exec -t -i `docker ps | grep pricingassistant/mrq-env | cut -f 1 -d " "` bash'

shell_noport:
sh -c "docker run --rm -i -t -v `pwd`:/app:rw -w /app mrq_local bash"
sh -c "docker run --rm -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq-env bash"

docs_serve:
sh -c "docker run --rm -i -t-p 8000:8000 -v `pwd`:/app:rw -w /app mrq_local mkdocs serve"
sh -c "docker run --rm -i -t -p 8000:8000 -v `pwd`:/app:rw -w /app pricingassistant/mrq-env mkdocs serve"

lint: docker
docker run -i -t -v `pwd`:/app:rw -w /app mrq_local pylint --init-hook="import sys; sys.path.append('.')" --rcfile .pylintrc mrq
docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq-env pylint -j 0 --init-hook="import sys; sys.path.append('.')" --rcfile .pylintrc mrq

linterrors: docker
docker run -i -t -v `pwd`:/app:rw -w /app mrq_local pylint --errors-only --init-hook="import sys; sys.path.append('.')" -d E1103 --rcfile .pylintrc mrq
docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq-env pylint -j 0 --errors-only --init-hook="import sys; sys.path.append('.')" --rcfile .pylintrc mrq

linterrors3: docker
docker run -i -t -v `pwd`:/app:rw -w /app mrq_local python3 -m pylint --errors-only --init-hook="import sys; sys.path.append('.')" -d E1103 --rcfile .pylintrc mrq
docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq-env python3 -m pylint -j 0 --errors-only --init-hook="import sys; sys.path.append('.')" --rcfile .pylintrc mrq

virtualenv:
virtualenv venv --distribute

virtualenv_pypy:
virtualenv -p /usr/bin/pypy pypy --distribute
virtualenv venv --distribute --python=python2.7

deps:
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-dashboard.txt

deps_pypy:
pip install git+git://github.com/schmir/gevent@pypy-hacks
pip install cffi
pip install git+git://github.com/gevent-on-pypy/pypycore
export GEVENT_LOOP=pypycore.loop
pip install -r requirements-pypy.txt

clean:
find . -path ./venv -prune -o -name "*.pyc" -exec rm {} \;
find . -name __pycache__ | xargs rm -r

build_dashboard:
cd mrq/dashboard/static && npm install && mkdir -p bin && npm run build

dashboard:
python mrq/dashboard/app.py

Expand All @@ -62,8 +67,11 @@ pep8:
autopep8:
autopep8 --max-line-length 99 -aaaaaaaa --in-place --recursive mrq

pypi: linterrors
pypi: linterrors linterrors3
python setup.py sdist upload

build_docs:
python scripts/propagate_docs.py

ensureindexes:
mrq-run mrq.basetasks.indexes.EnsureIndexes
9 changes: 3 additions & 6 deletions docs/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ The following general flags can be passed as command-line arguments to either **
- `--mongodb_jobs, --mongodb`: MongoDB URI for the jobs, scheduled_jobs & workers database. Defaults to **mongodb://127.0.0.1:27017/mrq**.
- `--mongodb_logs` :MongoDB URI for the logs database."0" will disable remote logs, "1" will use main MongoDB. Defaults to **1**
- `--mongodb_logs_size`: If provided, sets the log collection to capped to that amount of bytes.
- `--no_mongodb_ensure_indexes`: If provided, skip the creation of MongoDB indexes at worker startup.
- `--redis`: Redis URI. Defaults to **redis://127.0.0.1:6379**.
- `--redis_prefix`: Redis key prefix. Defaults to "mrq".
- `--redis_max_connections`: Redis max connection pool size. Defaults to **1000**.
Expand Down Expand Up @@ -46,16 +45,14 @@ You can pass additional configuration flags:

- `--max_jobs`: Gevent:max number of jobs to do before quitting. Use as a workaround for memory leaks in your tasks. Defaults to **0**
- `--max_memory`: Max memory (in Mb) after which the process will be shut down. Use with `--processes [1-N]`
to have supervisord automatically respawn the worker when this happens. Defaults to **1**
to have the worker automatically respawn when this happens. Defaults to **1**
- `--grenlets, --gevent, --g`: Max number of greenlets to use. Defaults to **1**.
- `--processes, --p`: Number of processes to launch with supervisord. Defaults to **0** (no supervisord).
- `--supervisord_template`: Path of supervisord template to use. Defaults to **supervisord_templates/default.conf**.
- `--processes, --p`: Number of processes to launch . Defaults to **0**.
- `--scheduler`: Run the scheduler. Defaults to **false**.
- `--scheduler_interval`: Seconds between scheduler checks. Defaults to **60** seconds, only ints are acceptable.
- `--report_interval`: Seconds between worker reports to MongoDB. Defaults to **10** seconds, floats are acceptable too.
- `--report_file`: Filepath of a json dump of the worker status. Disabled if none.
- `--subqueues_refresh_interval`: Seconds between worker refreshes of the known subqueues.
- `--subqueues_delimiter`: Delimiter between main queue and subqueue names.
- `--paused_queues_refresh_interval`: Seconds between worker refreshes of the paused queues list.
- `--admin_port`: Start an admin server on this port, if provided. Incompatible with --processes. Defaults to **0**
- `--admin_ip`: IP for the admin server to listen on. Use "0.0.0.0" to allow access from outside. Defaults to **127.0.0.1**.
Expand All @@ -71,7 +68,7 @@ The default is to run tasks one at a time. You should obviously change this beha

This will start 30 greenlets over 3 UNIX processes. Each of them will run 10 jobs at the same time.

As soon as you use the `--processes` option (even with `--processes=1`) then supervisord will be used to control the processes. It is quite useful to manage long-running instances.
The worker is autonomous to handle its processes. It is quite useful to manage long-running instances.

### Simulating network latency

Expand Down
6 changes: 2 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Remember, put mrq-config.py in your workers directory.
MONGODB_JOBS = "mongodb://127.0.0.1:27017/mrq" # MongoDB URI for the jobs, scheduled_jobs & workers database.Defaults to mongodb://127.0.0.1:27017/mrq
MONGODB_LOGS = 1 #MongoDB URI for the logs database."0" will disable remote logs, "1" will use main MongoDB.Defaults to 1
MONGODB_LOGS_SIZE = None #If provided, sets the log collection to capped to that amount of bytes.
NO_MONGODB_ENSURE_INDEXES = None #If provided, skip the creation of MongoDB indexes at worker startup.

#Redis settings
REDIS = "redis://127.0.0.1:6379" #Redis URI.Defaults to redis://127.0.0.1:6379
Expand Down Expand Up @@ -57,10 +56,9 @@ USE_LARGE_JOB_IDS = False #Do not use compacted job IDs in Redis. For compatibil
QUEUES = ("default",) # The queues to listen on.Defaults to default , which will listen on all queues.
MAX_JOBS = 0 #Gevent:max number of jobs to do before quitting. Workaround for memory leaks in your tasks. Defaults to 0
MAX_TIME = 0 # max number of seconds a worker runs before quitting
MAX_MEMORY = 1 #Max memory (in Mb) after which the process will be shut down. Use with PROCESS = [1-N] to have supervisord automatically respawn the worker when this happens.Defaults to 1
MAX_MEMORY = 1 #Max memory (in Mb) after which the process will be shut down. Use with PROCESS = [1-N] to have the worker automatically respawned when this happens.Defaults to 1
GRENLETS = 1 #Max number of greenlets to use.Defaults to 1.
PROCESSES = 0 #Number of processes to launch with supervisord.Defaults to 0.
SUPERVISORD_TEMPLATE = "supervisord_templates/default.conf" #Path of supervisord template to use. Defaults to supervisord_templates/default.conf.
PROCESSES = 0 #Number of processes to launch.Defaults to 0.
SCHEDULER = False #Run the scheduler.Defaults to False.
SCHEDULER_INTERVAL = 60 #Seconds between scheduler checks.Defaults to 60 seconds, only ints are acceptable.
REPORT_INTERVAL = 10.5 #Seconds between worker reports to MongoDB.Defaults to 10 seconds, floats are acceptable too.
Expand Down
8 changes: 0 additions & 8 deletions docs/design.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,3 @@ This was a preview on the very basic features of MRQ. What makes it actually use
* You can run multiple workers in parallel. Each worker can also run multiple greenlets in parallel.
* Workers can dequeue from multiple queues
* You can queue jobs from your Python code to avoid using `mrq-run` from the command-line.

These features will be demonstrated in a future example of a simple web crawler.
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ MRQ was first developed at [Pricing Assistant](http://pricingassistant.com) and
* **Great [dashboard](http://mrq.readthedocs.org/en/latest/dashboard/):** Have visibility and control on everything: queued jobs, current jobs, worker status, ...
* **Per-job logs:** Get the log output of each task separately in the dashboard
* **Gevent worker:** IO-bound tasks can be done in parallel in the same UNIX process for maximum throughput
* **Supervisord integration:** CPU-bound tasks can be split across several UNIX processes with a single command-line flag
* **Job management:** You can retry, requeue, cancel jobs from the code or the dashboard.
* **Performance:** Bulk job queueing, easy job profiling
* **Easy [configuration](http://mrq.readthedocs.org/en/latest/configuration):** Every aspect of MRQ is configurable through command-line flags or a configuration file
Expand Down
13 changes: 2 additions & 11 deletions docs/jobs-maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,9 @@ SCHEDULER_TASKS = [
"interval": 3600
},

# This will requeue jobs 'lost' between redis.blpop() and mongo.update(status=started).
# This can happen only when the worker is killed brutally in the middle of dequeue_jobs()
# This will make sure MRQ's indexes are built
{
"path": "mrq.basetasks.cleaning.RequeueLostJobs",
"params": {},
"interval": 24 * 3600
},

# This will clean the list of known queues in Redis. It will mostly remove empty queues
# so that they are not displayed in the dashboard anymore.
{
"path": "mrq.basetasks.cleaning.CleanKnownQueues",
"path": "mrq.basetasks.indexes.EnsureIndexes",
"params": {},
"interval": 24 * 3600
}
Expand Down
2 changes: 1 addition & 1 deletion docs/jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ However, to be reliable a task queue needs to prepare for everything that can go
* ```retry```: The method `task.retry()` was called to interrupt the job but mark it for being retried later. This may be useful when calling unreliable 3rd-party services.
* ```maxretries```: The task was retried too many times. Max retries default to 3 and can be configured globally or per task. At this point it should be up to you to cancel them or requeue them again.

Only jobs in statuses `success` and `cancel` will be cleaned from MongoDB after a delay of `result_ttl` seconds (see [Task configuration](configuration.md))
Jobs in status `success` will be cleaned from MongoDB after a delay of `result_ttl` seconds (see [Task configuration](configuration.md))

## Task API

Expand Down
4 changes: 3 additions & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Performance
# Worker performance

Performance is an explicit goal of MRQ as it was first developed at [Pricing Assistant](http://www.pricingassistant.com/) for crawling billions of web pages.

Expand All @@ -8,6 +8,8 @@ On a regular Macbook Pro, we see 1300 jobs/second in a single worker process wit

However what we are really measuring there is MongoDB's write performance. An install of MRQ with properly scaled MongoDB and Redis instances is be capable of much more.

For more, see our tutorial on [Queue performance](queue-performance.md).

## PyPy support

Earlier in its development MRQ was tested successfully on PyPy but we are waiting for better PyPy+gevent support to continue working on it, as performance was worse than CPython.
Expand Down
Loading