From a68bad1c3afc128194a0d6dea84676025fd19d98 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 15 Jan 2015 17:27:06 -0500 Subject: [PATCH 1/3] Undo nginx rate-limiting. --- conf/server-base.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/server-base.conf b/conf/server-base.conf index 697226f9f..9284fe1cf 100644 --- a/conf/server-base.conf +++ b/conf/server-base.conf @@ -22,7 +22,7 @@ proxy_set_header Transfer-Encoding $http_transfer_encoding; location / { proxy_pass http://web_app_server; - limit_req zone=webapp burst=10 nodelay; + #limit_req zone=webapp burst=10 nodelay; } location /realtime { @@ -42,7 +42,7 @@ location /v1/ { client_max_body_size 20G; - limit_req zone=api burst=5 nodelay; + #limit_req zone=api burst=5 nodelay; } location /c1/ { @@ -54,7 +54,7 @@ location /c1/ { proxy_read_timeout 2000; proxy_temp_path /var/log/nginx/proxy_temp 1 2; - limit_req zone=api burst=5 nodelay; + #limit_req zone=api burst=5 nodelay; } location /static/ { From 0122a6698ff61f24788af60f3aa9190b39d07b34 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 16 Jan 2015 12:14:11 -0500 Subject: [PATCH 2/3] Wrap call to CloudWatch in try/catch block. --- util/queuemetrics.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/queuemetrics.py b/util/queuemetrics.py index ec1444c16..50a51790f 100644 --- a/util/queuemetrics.py +++ b/util/queuemetrics.py @@ -43,12 +43,15 @@ class SendToCloudWatch(Process): self.daemon = True def run(self): - logger.debug('Starting cloudwatch sender process.') + logger.debug('Starting CloudWatch sender process.') connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key) while True: put_metric_args, kwargs = self._put_metrics_queue.get() - logger.debug('Got queued put metrics reqeust.') - connection.put_metric_data(*put_metric_args, **kwargs) + logger.debug('Got queued put metrics request.') + try: + connection.put_metric_data(*put_metric_args, **kwargs) + except: + logger.exception('Writing to CloudWatch failed') class QueueMetrics(object): From 07bb9be6036308d99e730bc62398c97ed17a835b Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 16 Jan 2015 12:14:57 -0500 Subject: [PATCH 3/3] Some class docs added to queuemetrics classes --- util/queuemetrics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/queuemetrics.py b/util/queuemetrics.py index 50a51790f..d09e1a0bd 100644 --- a/util/queuemetrics.py +++ b/util/queuemetrics.py @@ -12,6 +12,7 @@ class NullReporter(object): class QueueingCloudWatchReporter(object): + """ QueueingCloudWatchReporter reports metrics to the "SendToCloudWatch" process """ def __init__(self, request_queue, namespace, need_capacity_name, build_percent_name): self._namespace = namespace self._need_capacity_name = need_capacity_name @@ -35,6 +36,8 @@ class QueueingCloudWatchReporter(object): class SendToCloudWatch(Process): + """ SendToCloudWatch loops indefinitely and pulls metrics off of a queue then sends it to + CloudWatch. """ def __init__(self, request_queue, aws_access_key, aws_secret_key): Process.__init__(self) self._aws_access_key = aws_access_key