Я получил это письмо, и мой экземпляр виртуальной машины был приостановлен. Это сервер воздушных потоков, который запускает несколько процессов, включая одну группу обеспечения доступности баз данных, которая очищает 5k - 10k отдельных ссылок и извлекает из нее тело - это выполняется одновременно 500 различными соединениями, что, как я подозреваю, поднимает эту конкретную проблему. Я получаю это электронное письмо после 24 часов работы, и моя виртуальная машина приостанавливается.
Dear Developer,
We've detected that your Google Cloud Project is engaging in cryptocurrency mining, resulting in the suspension of all project resources displaying this behavior.
This activity violates the Google Cloud Platform Terms of Service or the Terms of Service of the Google API you may be using.
We recommend that you review this activity to determine if it is intended. Cryptocurrency mining is often an indication of the use of fraudulent accounts and payment instruments, and we require verification in order to mine cryptocurrency on our platform.
Therefore if you wish to continue engaging in cryptocurrency mining, you must apply for an Invoiced Billing Account. Additional information is available in the Cloud Security Help Center.
To regain access to your suspended resources please submit an appeal:
Sign in to as the project owner, click Request an appeal below, and fill in the following details:
Possible trigger of this activity
If the behavior is intentional, please provide the Invoiced Billing Account ID
If you believe the project may have been compromised by a third party, describe your concerns
Learn more about policy violations and appeals
If you need further help, reach out to the Google Cloud Platform Community Support Forum. If you have a support package, file a ticket through the Support Center.
You may have received an earlier warning about a possible suspension of resources if this violation wasn't corrected. If you didn't receive a warning before this suspension, it was because the project's behavior was seriously impacting the service of other users.
Это код, который я подозреваю, создает проблему
out = []
CONNECTIONS = 500
TIMEOUT = 5
def do_request(url):
try:
requests.head(url, verify=False, timeout=10, headers=headers)
except Exception:
return "", 404
try:
res = requests.get(url, verify=False, timeout=10, headers=headers)
content = extract_content(res.content)
return content, res.status_code
except Exception:
return "", 404
def gen_text_dragnet(article, timeout):
content, status_code = do_request(article["url"])
article.update(body=content[:500], status_code=status_code)
return status_code
def extract_body():
"""
Processing broken URLs are a huge pain in the ass
"""
global_init()
try:
articles = Article.objects.filter(
status_code__exists=False)[:5000]
except Exception as e:
print(e)
raise
print("extracting bodies from {} articles".format(len(articles)))
with concurrent.futures.ThreadPoolExecutor(max_workers=CONNECTIONS) as executor:
future_to_url = (executor.submit(gen_text_dragnet, article, TIMEOUT)
for article in articles)
time1 = time.time()
for future in concurrent.futures.as_completed(future_to_url):
try:
data = future.result()
except Exception as exc:
data = str(type(exc))
finally:
out.append(data)
print(str(len(out)), end="\r")
time2 = time.time()
print(f'Took {time2-time1:.2f} s')
print(pd.Series(out).value_counts())
Это произошло несколько раз, и каждый раз, когда я подаю апелляцию, я не получаю ответа, и мне приходится удалять и заново создавать экземпляр. Это действительно раздражает и не является устойчивым для проекта. Что я могу с этим поделать?