Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1028)

Side by Side Diff: sky/tools/sky_server

Issue 700213005: Teach sky_server how to use more threads and not drop requests (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import cherrypy 7 import cherrypy
8 import json 8 import json
9 import os 9 import os
10 import staticdirindex 10 import staticdirindex
(...skipping 25 matching lines...) Expand all
36 parser.add_argument('port', type=int) 36 parser.add_argument('port', type=int)
37 configuration.add_arguments(parser) 37 configuration.add_arguments(parser)
38 args = parser.parse_args() 38 args = parser.parse_args()
39 39
40 log_dir = os.path.abspath(os.getcwd()) 40 log_dir = os.path.abspath(os.getcwd())
41 41
42 paths = Paths(os.path.join('out', args.configuration)) 42 paths = Paths(os.path.join('out', args.configuration))
43 43
44 config = { 44 config = {
45 'global': { 45 'global': {
46 # Cherrypy appears to just drop requests if it doesn't have
47 # a thread to service them, so set our thread_pool high enough
48 # so that a z620 can run all the tests w/o timeouts.
49 'server.thread_pool': 30,
46 'server.socket_port': args.port, 50 'server.socket_port': args.port,
47 'tools.staticdir.content_types' : { 51 'tools.staticdir.content_types' : {
48 'sky': 'text/sky', 52 'sky': 'text/sky',
49 }, 53 },
50 'log.screen': args.verbose, 54 'log.screen': args.verbose,
51 'log.access_log': os.path.join(log_dir, 'access_log.txt'), 55 'log.access_log': os.path.join(log_dir, 'access_log.txt'),
52 # This causes some strange python exception?? 56 # This causes some strange python exception??
53 # 'log.error_log': os.path.join(log_dir, 'error_log.txt'), 57 # 'log.error_log': os.path.join(log_dir, 'error_log.txt'),
54 }, 58 },
55 '/': { 59 '/': {
(...skipping 12 matching lines...) Expand all
68 '/sky/services': { 72 '/sky/services': {
69 'tools.staticdir.on': True, 73 'tools.staticdir.on': True,
70 'tools.staticdir.dir': os.path.join(paths.gen_root, 'sky', 'services '), 74 'tools.staticdir.dir': os.path.join(paths.gen_root, 'sky', 'services '),
71 }, 75 },
72 } 76 }
73 cherrypy.quickstart(config=config) 77 cherrypy.quickstart(config=config)
74 78
75 79
76 if __name__ == '__main__': 80 if __name__ == '__main__':
77 main() 81 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698