Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e80a979

Browse filesBrowse files
author
Jon Wayne Parrott
committed
Modify datastore sample for scale
1 parent 4626312 commit e80a979
Copy full SHA for e80a979

File tree

Expand file treeCollapse file tree

4 files changed

+15
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+15
-3
lines changed

‎appengine/flexible/datastore/app.yaml

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
runtime: python
22
env: flex
3-
entrypoint: gunicorn -b :$PORT main:app
3+
entrypoint: uwsgi --http-socket :$PORT --ini uwsgi.ini
44

55
runtime_config:
66
python_version: 3

‎appengine/flexible/datastore/main.py

Copy file name to clipboardExpand all lines: appengine/flexible/datastore/main.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
app = Flask(__name__)
24+
ds = datastore.Client()
2425

2526

2627
def is_ipv6(addr):
@@ -35,7 +36,6 @@ def is_ipv6(addr):
3536
# [START example]
3637
@app.route('/')
3738
def index():
38-
ds = datastore.Client()
3939

4040
user_ip = request.remote_addr
4141

+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Flask==0.12
22
google-cloud-datastore==0.23.0
3-
gunicorn==19.7.1
3+
uwsgi==2.0.15
4+
gevent==1.2.1
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[uwsgi]
2+
wsgi-file=main.py
3+
callable=app
4+
# Socket listen queue size.
5+
listen=1000
6+
# 1 CPU core = 1 process.
7+
processes=1
8+
# 2000 gevent workers.
9+
gevent=2000
10+
# Disable request logging, nginx will do that
11+
disable-logging=1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.