Merge "Configuring number of apache processes"
This commit is contained in:
commit
8dfa7d7297
@ -104,6 +104,13 @@ Installation
|
|||||||
|
|
||||||
$ ./manage.py make_web_conf --apache --ssl --sslkey=/path/to/ssl/key --sslcert=/path/to/ssl/cert > /etc/apache2/sites-available/horizon.conf
|
$ ./manage.py make_web_conf --apache --ssl --sslkey=/path/to/ssl/key --sslcert=/path/to/ssl/cert > /etc/apache2/sites-available/horizon.conf
|
||||||
|
|
||||||
|
By default the apache configuration will launch a number of apache processes
|
||||||
|
equal to the number of CPUs + 1 of the machine on which you launch the
|
||||||
|
make_web_conf command. If the target machine is not the same or if you want
|
||||||
|
to specify the number of processes, add the --processes option::
|
||||||
|
|
||||||
|
$ ./manage.py make_web_conf --apache --processes 10 > /etc/apache2/sites-available/horizon.conf
|
||||||
|
|
||||||
6. Finally, enable the above configuration and restart the web server::
|
6. Finally, enable the above configuration and restart the web server::
|
||||||
|
|
||||||
$ sudo a2ensite horizon
|
$ sudo a2ensite horizon
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
CustomLog {{ LOGDIR }}/{{ PROJECT_NAME }}-access.log combined
|
CustomLog {{ LOGDIR }}/{{ PROJECT_NAME }}-access.log combined
|
||||||
|
|
||||||
WSGIScriptReloading On
|
WSGIScriptReloading On
|
||||||
WSGIDaemonProcess {{ PROJECT_NAME }}_website
|
WSGIDaemonProcess {{ PROJECT_NAME }}_website processes={{ PROCESSES }}
|
||||||
WSGIProcessGroup {{ PROJECT_NAME }}_website
|
WSGIProcessGroup {{ PROJECT_NAME }}_website
|
||||||
WSGIApplicationGroup {{ PROJECT_NAME }}_website
|
WSGIApplicationGroup {{ PROJECT_NAME }}_website
|
||||||
WSGIPassAuthorization On
|
WSGIPassAuthorization On
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
@ -74,6 +75,7 @@ context = Context({
|
|||||||
'SSLCERT': '/etc/pki/tls/certs/ca.crt',
|
'SSLCERT': '/etc/pki/tls/certs/ca.crt',
|
||||||
'SSLKEY': '/etc/pki/tls/private/ca.key',
|
'SSLKEY': '/etc/pki/tls/private/ca.key',
|
||||||
'CACERT': None,
|
'CACERT': None,
|
||||||
|
'PROCESSES': multiprocessing.cpu_count() + 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
context['PROJECT_ROOT'] = os.path.dirname(context['PROJECT_PATH'])
|
context['PROJECT_ROOT'] = os.path.dirname(context['PROJECT_PATH'])
|
||||||
@ -213,6 +215,14 @@ location you desire, e.g.::
|
|||||||
"configuration will work only when accessed with "
|
"configuration will work only when accessed with "
|
||||||
"the proper hostname (see --hostname).")
|
"the proper hostname (see --hostname).")
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--processes",
|
||||||
|
dest="processes",
|
||||||
|
help=("Use with the --apache option to define the number of "
|
||||||
|
"apache processes (by default the number of cpus +1 which "
|
||||||
|
"is %s on this machine).") % context['PROCESSES'],
|
||||||
|
metavar="PROCESSES"
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-p", "--project",
|
"-p", "--project",
|
||||||
dest="project",
|
dest="project",
|
||||||
@ -268,6 +278,8 @@ location you desire, e.g.::
|
|||||||
context['CACERT'] = options['cacert']
|
context['CACERT'] = options['cacert']
|
||||||
if options.get('logdir'):
|
if options.get('logdir'):
|
||||||
context['LOGDIR'] = options['logdir'].rstrip('/')
|
context['LOGDIR'] = options['logdir'].rstrip('/')
|
||||||
|
if options.get('processes'):
|
||||||
|
context['PROCESSES'] = options['processes']
|
||||||
if options.get('project'):
|
if options.get('project'):
|
||||||
context['PROJECT_NAME'] = options['project']
|
context['PROJECT_NAME'] = options['project']
|
||||||
if options.get('hostname'):
|
if options.get('hostname'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user