mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Profiling fewer app servers.
This commit is contained in:
parent
32c7c13a4f
commit
182c8f8d18
2 changed files with 9 additions and 5 deletions
|
@ -42,7 +42,7 @@ class DBProfilerMiddleware:
|
|||
setattr(request, 'activated_segments', [])
|
||||
if ((request.path.startswith('/reader/feed') or
|
||||
request.path.startswith('/reader/river')) and
|
||||
random.random() < .1):
|
||||
random.random() < .01):
|
||||
request.activated_segments.append('db_profiler')
|
||||
connection.use_debug_cursor = True
|
||||
|
||||
|
@ -61,7 +61,7 @@ class DBProfilerMiddleware:
|
|||
if hasattr(request, 'sql_times_elapsed'):
|
||||
middleware = SQLLogToConsoleMiddleware()
|
||||
middleware.process_celery(self)
|
||||
logging.debug(" ---> ~FGProfiling~FB app: %s" % request.sql_times_elapsed)
|
||||
# logging.debug(" ---> ~FGProfiling~FB app: %s" % request.sql_times_elapsed)
|
||||
self._save_times(request.sql_times_elapsed)
|
||||
return response
|
||||
|
||||
|
|
10
fabfile.py
vendored
10
fabfile.py
vendored
|
@ -890,9 +890,10 @@ def config_haproxy(debug=False):
|
|||
def build_haproxy():
|
||||
droplets = assign_digitalocean_roledefs(split=True)
|
||||
servers = defaultdict(list)
|
||||
gunicorn_counts_servers = ['app13', 'app18']
|
||||
gunicorn_refresh_servers = ['app06', 'app42']
|
||||
maintenance_servers = ['app01']
|
||||
gunicorn_counts_servers = ['app22', 'app23']
|
||||
gunicorn_refresh_servers = ['app20', 'app21']
|
||||
maintenance_servers = ['app20']
|
||||
ignore_servers = ['app13', 'app18', 'app06', 'app42', 'app04', 'app06', 'app03', 'app11', 'app08', 'app07']
|
||||
|
||||
for group_type in ['app', 'push', 'work', 'node_socket', 'node_favicon', 'www']:
|
||||
group_type_name = group_type
|
||||
|
@ -905,6 +906,9 @@ def build_haproxy():
|
|||
port = 80
|
||||
check_inter = 3000
|
||||
|
||||
if server['name'] in ignore_servers:
|
||||
print " ---> Ignoring %s" % server['name']
|
||||
continue
|
||||
if server_type == 'www':
|
||||
port = 81
|
||||
if group_type == 'node_socket':
|
||||
|
|
Loading…
Add table
Reference in a new issue