|
@@ -3,8 +3,6 @@ import sys
|
|
|
import setup_util
|
|
|
import os
|
|
|
|
|
|
-#DART_SDK = os.environ('DART_SDK')
|
|
|
-
|
|
|
def start(args):
|
|
|
setup_util.replace_text('dart/postgresql.yaml', 'host: .*', 'host: ' + args.database_host)
|
|
|
try:
|
|
@@ -34,19 +32,20 @@ def start(args):
|
|
|
conf.append(' upstream dart_cluster {')
|
|
|
for port in range(9001, 9001 + args.max_threads):
|
|
|
conf.append(' server 127.0.0.1:' + str(port) + ';')
|
|
|
+ conf.append(' keepalive ' + str(args.max_concurrency / args.max_threads) + ';')
|
|
|
conf.append(' }')
|
|
|
conf.append(' server {')
|
|
|
conf.append(' listen 8080;')
|
|
|
conf.append(' location / {')
|
|
|
conf.append(' proxy_pass http://dart_cluster;')
|
|
|
conf.append(' proxy_http_version 1.1;')
|
|
|
+ conf.append(' proxy_set_header Connection "";')
|
|
|
conf.append(' }')
|
|
|
conf.append(' }')
|
|
|
conf.append('}')
|
|
|
#
|
|
|
# write nginx configuration to disk
|
|
|
#
|
|
|
- #os.remove('dart/nginx.conf')
|
|
|
with open('dart/nginx.conf', 'w') as f:
|
|
|
f.write('\n'.join(conf))
|
|
|
#
|