revert newrelic changes and disable gevent

This commit is contained in:
Kenneth Kehl
2025-07-29 10:22:36 -07:00
parent e7cee89624
commit 1eeceb072e
7 changed files with 10 additions and 11 deletions

View File

@@ -70,7 +70,7 @@ run-celery: ## Run celery, TODO remove purge for staging/prod
-A run_celery.notify_celery worker \ -A run_celery.notify_celery worker \
--pidfile="/tmp/celery.pid" \ --pidfile="/tmp/celery.pid" \
--loglevel=INFO \ --loglevel=INFO \
--pool=gevent --pool=solo
--concurrency=20 --concurrency=20

View File

@@ -5,7 +5,6 @@ import time
from io import StringIO from io import StringIO
import botocore import botocore
import gevent
from boto3 import Session from boto3 import Session
from flask import current_app from flask import current_app
@@ -250,7 +249,7 @@ def get_s3_files():
for object_key in object_keys: for object_key in object_keys:
read_s3_file(bucket_name, object_key, s3res) read_s3_file(bucket_name, object_key, s3res)
count = count + 1 count = count + 1
gevent.sleep(0.2) time.sleep(0.2)
except Exception: except Exception:
current_app.logger.exception( current_app.logger.exception(
f"Trouble reading {object_key} which is # {count} during cache regeneration" f"Trouble reading {object_key} which is # {count} during cache regeneration"
@@ -411,7 +410,7 @@ def get_job_from_s3(service_id, job_id):
) )
retries += 1 retries += 1
sleep_time = backoff_factor * (2**retries) # Exponential backoff sleep_time = backoff_factor * (2**retries) # Exponential backoff
gevent.sleep(sleep_time) time.sleep(sleep_time)
continue continue
else: else:
# Typically this is "NoSuchKey" # Typically this is "NoSuchKey"

View File

@@ -1,6 +1,5 @@
import json import json
import gevent
from celery.signals import task_postrun from celery.signals import task_postrun
from flask import current_app from flask import current_app
from requests import HTTPError, RequestException, request from requests import HTTPError, RequestException, request
@@ -84,7 +83,7 @@ def process_job(job_id, sender_id=None):
process_row(row, template, job, service, sender_id=sender_id) process_row(row, template, job, service, sender_id=sender_id)
count = count + 1 count = count + 1
if count % 3 == 0: if count % 3 == 0:
gevent.sleep(1) time.sleep(1)
# End point/Exit point for message send flow. # End point/Exit point for message send flow.
job_complete(job, start=start) job_complete(job, start=start)

View File

@@ -151,7 +151,7 @@ class AwsCloudwatchClient(Client):
# result = temp_client.get_query_results(queryId=query_id) # result = temp_client.get_query_results(queryId=query_id)
# if result['status'] == 'Complete': # if result['status'] == 'Complete':
# break # break
# gevent.sleep(1) # time.sleep(1)
# delivery_receipts = [] # delivery_receipts = []
# for log in result['results']: # for log in result['results']:

View File

@@ -7,7 +7,7 @@ import gunicorn # noqa
# This will give us a better stack trace if # This will give us a better stack trace if
workers = 4 workers = 4
worker_class = "gevent" worker_class = "sync"
worker_connections = 256 worker_connections = 256
bind = "0.0.0.0:{}".format(os.getenv("PORT")) bind = "0.0.0.0:{}".format(os.getenv("PORT"))
statsd_host = "{}:8125".format(os.getenv("STATSD_HOST")) statsd_host = "{}:8125".format(os.getenv("STATSD_HOST"))

View File

@@ -1,5 +1,6 @@
from gevent import monkey # from gevent import monkey
monkey.patch_all() # commenting out while we disable gevent
# monkey.patch_all()
from application import application # noqa from application import application # noqa

View File

@@ -26,7 +26,7 @@ applications:
- type: worker - type: worker
instances: ((worker_instances)) instances: ((worker_instances))
memory: ((worker_memory)) memory: ((worker_memory))
command: newrelic-admin run-program celery -A run_celery.notify_celery worker --loglevel=INFO --pool=gevent --concurrency=20 --prefetch-multiplier=2 command: newrelic-admin run-program celery -A run_celery.notify_celery worker --loglevel=INFO --pool=solo --concurrency=20 --prefetch-multiplier=2
- type: scheduler - type: scheduler
instances: 1 instances: 1
memory: ((scheduler_memory)) memory: ((scheduler_memory))