diff options
| author | jason | 2016-05-24 16:49:54 -0600 |
|---|---|---|
| committer | jason | 2016-05-24 16:49:54 -0600 |
| commit | a592ba06ea019bbb0051ffe5fc006d98560d038a (patch) | |
| tree | 588590a6423a19c59aa2cac9f57b7025f4f5f44b /docs | |
| parent | 2c599d965493b3658ffadc0c3e9e1b5a209cf1ba (diff) | |
| download | eventmq-a592ba06ea019bbb0051ffe5fc006d98560d038a.tar.gz eventmq-a592ba06ea019bbb0051ffe5fc006d98560d038a.zip | |
More work for named queues
- Rename `WORKERS` setting to `CONCURRENT_JOBS` for more clarity. Added this
setting to the command line options, the ini .conf & default settings conf.py
files.
- Added support for JSON style arrays in INI config.
- Added support for weighted named queues. The style for the setting is
[[weight, "name"], [weight, "name"]]. Configured in both the INI and command
line for job manager. Added documentation.
- Updated the spec for the INFORM message. Weights are sent with the queue
names. If there are no weights specified they will be given the default value
of 0.
- updated Router.queues to a list from a deque so that it can be sorted
by priority more easily.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/conf.py | 7 | ||||
| -rw-r--r-- | docs/protocol.rst | 13 | ||||
| -rw-r--r-- | docs/settings_file.rst | 34 |
3 files changed, 36 insertions, 18 deletions
diff --git a/docs/conf.py b/docs/conf.py index 864bbcf..aa23956 100644 --- a/docs/conf.py +++ b/docs/conf.py | |||
| @@ -16,6 +16,7 @@ import sys | |||
| 16 | import os | 16 | import os |
| 17 | import shlex | 17 | import shlex |
| 18 | 18 | ||
| 19 | import eventmq # for __version__ | ||
| 19 | # If extensions (or modules to document with autodoc) are in another directory, | 20 | # If extensions (or modules to document with autodoc) are in another directory, |
| 20 | # add these directories to sys.path here. If the directory is relative to the | 21 | # add these directories to sys.path here. If the directory is relative to the |
| 21 | # documentation root, use os.path.abspath to make it absolute, like shown here. | 22 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| @@ -52,15 +53,15 @@ master_doc = 'index' | |||
| 52 | 53 | ||
| 53 | # General information about the project. | 54 | # General information about the project. |
| 54 | project = u'EventMQ' | 55 | project = u'EventMQ' |
| 55 | copyright = u'2015, eventboard.io' | 56 | copyright = u'2016, eventboard.io' |
| 56 | author = u'eventboard.io' | 57 | author = u'EventMQ Contributors' |
| 57 | 58 | ||
| 58 | # The version info for the project you're documenting, acts as replacement for | 59 | # The version info for the project you're documenting, acts as replacement for |
| 59 | # |version| and |release|, also used in various other places throughout the | 60 | # |version| and |release|, also used in various other places throughout the |
| 60 | # built documents. | 61 | # built documents. |
| 61 | # | 62 | # |
| 62 | # The short X.Y version. | 63 | # The short X.Y version. |
| 63 | version = '0' | 64 | version = eventmq.__version__ |
| 64 | # The full version, including alpha/beta/rc tags. | 65 | # The full version, including alpha/beta/rc tags. |
| 65 | release = '0' | 66 | release = '0' |
| 66 | 67 | ||
diff --git a/docs/protocol.rst b/docs/protocol.rst index 4c2aff0..c341403 100644 --- a/docs/protocol.rst +++ b/docs/protocol.rst | |||
| @@ -71,7 +71,7 @@ FRAME Value Description | |||
| 71 | 1 eMQP/1.0 Protocol version | 71 | 1 eMQP/1.0 Protocol version |
| 72 | 2 REQUEST command | 72 | 2 REQUEST command |
| 73 | 3 _MSGID_ A unique id for the msg | 73 | 3 _MSGID_ A unique id for the msg |
| 74 | 4 _QUEUE_NAME_ the name of the queue the worker belongs to | 74 | 4 _QUEUE_NAME_ the name of the queue the request should be sent to |
| 75 | 5 _HEADERS_ dictionary of headers. can be an empty set | 75 | 5 _HEADERS_ dictionary of headers. can be an empty set |
| 76 | 6 _MSG_ The message to send | 76 | 6 _MSG_ The message to send |
| 77 | ====== ============== =========== | 77 | ====== ============== =========== |
| @@ -85,7 +85,7 @@ FRAME Value Description | |||
| 85 | 1 eMQP/1.0 Protocol version | 85 | 1 eMQP/1.0 Protocol version |
| 86 | 2 PUBLISH command | 86 | 2 PUBLISH command |
| 87 | 3 _MSGID_ A unique id for the msg | 87 | 3 _MSGID_ A unique id for the msg |
| 88 | 4 _TOPIC_NAME_ the name of the queue the worker belongs to | 88 | 4 _TOPIC_NAME_ the name of the topic this message should be published across |
| 89 | 5 _HEADERS_ csv list of headers | 89 | 5 _HEADERS_ csv list of headers |
| 90 | 6 _MSG_ The message to send | 90 | 6 _MSG_ The message to send |
| 91 | ====== ============== =========== | 91 | ====== ============== =========== |
| @@ -99,7 +99,7 @@ FRAME Value Description | |||
| 99 | 1 eMQP/1.0 Protocol version | 99 | 1 eMQP/1.0 Protocol version |
| 100 | 2 SCHEDULE command | 100 | 2 SCHEDULE command |
| 101 | 3 _MSGID_ A unique id for the msg | 101 | 3 _MSGID_ A unique id for the msg |
| 102 | 4 _TOPIC_NAME_ name of queue that the job should run in | 102 | 4 _QUEUE_NAME_ name of queue that the job should run in |
| 103 | 5 _HEADERS_ csv list of headers for this message | 103 | 5 _HEADERS_ csv list of headers for this message |
| 104 | 6 _MSG_ The message to send | 104 | 6 _MSG_ The message to send |
| 105 | ====== ============== =========== | 105 | ====== ============== =========== |
| @@ -113,7 +113,7 @@ FRAME Value Description | |||
| 113 | 1 eMQP/1.0 Protocol version | 113 | 1 eMQP/1.0 Protocol version |
| 114 | 2 UNSCHEDULE command | 114 | 2 UNSCHEDULE command |
| 115 | 3 _MSGID_ A unique id for the msg | 115 | 3 _MSGID_ A unique id for the msg |
| 116 | 4 _TOPIC_NAME_ ignored for this command, broadcasted to all queues | 116 | 4 _QUEUE_NAME_ ignored for this command, broadcasted to all queues |
| 117 | 5 _HEADERS_ csv list of headers for this message | 117 | 5 _HEADERS_ csv list of headers for this message |
| 118 | 6 _MSG_ The message to send | 118 | 6 _MSG_ The message to send |
| 119 | ====== ============== =========== | 119 | ====== ============== =========== |
| @@ -129,7 +129,7 @@ FRAME Value Description | |||
| 129 | 1 eMQP/1.0 Protocol version | 129 | 1 eMQP/1.0 Protocol version |
| 130 | 2 INFORM command | 130 | 2 INFORM command |
| 131 | 3 _MSGID_ A unique id for the msg | 131 | 3 _MSGID_ A unique id for the msg |
| 132 | 4 _QUEUE_NAME_ csv seperated names of queue the worker belongs to | 132 | 4 Queues. Unused for scheduler |
| 133 | 5 scheduler type of peer connecting | 133 | 5 scheduler type of peer connecting |
| 134 | ====== ============== =========== | 134 | ====== ============== =========== |
| 135 | 135 | ||
| @@ -144,7 +144,7 @@ FRAME Value Description | |||
| 144 | 1 eMQP/1.0 Protocol version | 144 | 1 eMQP/1.0 Protocol version |
| 145 | 2 INFORM command | 145 | 2 INFORM command |
| 146 | 3 _MSGID_ A unique id for the msg | 146 | 3 _MSGID_ A unique id for the msg |
| 147 | 4 _QUEUE_NAME_ csv seperated names of queue the worker belongs to. | 147 | 4 _QUEUES_ csv seperated arrays containing an int and a string for weight and name. e.g. [40, 'email'] |
| 148 | 5 worker type of peer connecting | 148 | 5 worker type of peer connecting |
| 149 | ====== ============== =========== | 149 | ====== ============== =========== |
| 150 | 150 | ||
| @@ -203,7 +203,6 @@ Heartbeating | |||
| 203 | * If the worker detects that the broker disconnected it SHOULD restart the conversation. | 203 | * If the worker detects that the broker disconnected it SHOULD restart the conversation. |
| 204 | * If the broker detects that a worker has disconnected it should stop sending it a message of any type. | 204 | * If the broker detects that a worker has disconnected it should stop sending it a message of any type. |
| 205 | * If the scheduler detects that the broker disconnects it SHOULD restart the conversation. | 205 | * If the scheduler detects that the broker disconnects it SHOULD restart the conversation. |
| 206 | * If the broker detects that a scheduler has disconnected it should ??????????. | ||
| 207 | 206 | ||
| 208 | REQUEST Headers | 207 | REQUEST Headers |
| 209 | --------------- | 208 | --------------- |
diff --git a/docs/settings_file.rst b/docs/settings_file.rst index 07d2338..b0bc36c 100644 --- a/docs/settings_file.rst +++ b/docs/settings_file.rst | |||
| @@ -15,16 +15,34 @@ Scheduler | |||
| 15 | Job Manager | 15 | Job Manager |
| 16 | *********** | 16 | *********** |
| 17 | 17 | ||
| 18 | concurrent_jobs | ||
| 19 | =============== | ||
| 20 | Default: 4 | ||
| 21 | |||
| 22 | This is the number of concurrent jobs the indiviudal job manager should execute | ||
| 23 | at a time. If you are using the multiprocess or threading model this number | ||
| 24 | becomes important as you will want to control the load on your server. If the | ||
| 25 | load equals the number of cores on the server, processes will begin waiting for | ||
| 26 | cpu cycles and things will begin to slow down. | ||
| 27 | |||
| 28 | A safe number to choose if your jobs block a lot would be (2 * cores). If your | ||
| 29 | jobs are cpu intensive you will want to set this number to the number of cores | ||
| 30 | you have or (cores - 1) to leave cycles for the os and other processes. This is | ||
| 31 | something that will have to be tuned based on the jobs that are | ||
| 32 | running. Grouping similar jobs in named queues will help you tune this number. | ||
| 33 | |||
| 18 | queues | 34 | queues |
| 19 | ====== | 35 | ====== |
| 20 | Default: default | 36 | Default: (10, default) |
| 21 | 37 | ||
| 22 | Comma seperated list of queues to process jobs for. Example: | 38 | Semi-colon seperated list of queues to process jobs for with thier |
| 23 | ``queues=high,med,low,default``. The philosophy taken for this list is each job | 39 | weights. Example: ``queues=(10, data_process); (15, email)``. With these |
| 24 | manager should have a single primary queue. This queue is the first in the list | 40 | weights and the ``CONCURRENT_JOBS`` setting, you should be able to tune managers |
| 25 | (in the case of the example ``high`` is the primary queue). Subsequent queues | 41 | running jobs locally pretty efficiently. If you have a larger box with a weight |
| 26 | are queues that this job manager should help out with should jobs be backed up, | 42 | of 50 on q1 and 8 concurrent jobs and a smaller box with a weight 30 and 4 |
| 27 | and there are no primary queue jobs to take care of. | 43 | concurrent jobs, the q1 jobs will be sent to the large box until it is no longer |
| 44 | accepting jobs. At this point jobs will start to be sent to the next highest | ||
| 45 | number until the large box is ready to accept another q1 job. | ||
| 28 | 46 | ||
| 29 | .. note:: | 47 | .. note:: |
| 30 | 48 | ||