Skip to content

Instantly share code, notes, and snippets.

@doro
doro / pubsub_too_many_open_files.py
Last active January 17, 2019 13:06
demonstrating "too many open files" issue when using pubsub
import psutil
import gc
from google.cloud import pubsub_v1
topic_project_id = 'PROJECT-ID' # todo: replace with yours
topic_name = 'TOPIC-NAME' # todo: replace with yours
data_str = 'just some text'
p = psutil.Process()
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">