Comments (8)
It seems NDB datastore is exactly what we need: https://cloud.google.com/appengine/docs/python/ndb/
"NDB uses Memcache as a cache service for "hot spots" in the data. If the application reads some entities often, NDB can read them quickly from cache."
from samples.
Hmm, I changed the code to use NDB datastore and uploaded it to https://9-dot-apprtc.appspot.com. But the setup time does not seem to improve based on both client side log and server side log. (scratching head)
from samples.
After more investigation I found most of the time for loading the first GET is spent in getting the lock. Acquiring the lock typically takes 100-200ms, but may take as long as >1s in some cases.
Querying the datastore takes 10-20ms for DB, 20-40 for NDB.
Writing to the datastore takes 30-40ms for DB and NDB.
from samples.
BTW, we have a decent 80-90% memcache hit rate, so I can confirm memcache is indeed used in NDB.
from samples.
Our code does not release the lock when calling channel.send_message, which is very slow.
Moving it out of the lock can save ~60ms.
from samples.
Hmm, now I don't think using memcache or NDB will help us much.
NDB makes reading fast when it reads from cache. But apprtc usually does read + write to add a user, where the write will invalidate the cache, so the next read for the second user will load from datastore.
Using appstats, I see NDB almost doubles the RPC calls to add a user and takes more time than DB.
If we write our own memcache logic, we can make the read for the second user faster (20ms vs. <10ms). But the writing part is not any better, since we need to write to both memcache and datastore, and we cannot return the request before the datastore write is completed using async functions, because that will abort the async write.
Similar to adding a message to the memcache/datastore.
from samples.
Let's discuss when I get back to Kirkland. Each candidate should be fast since that is only read from memcache, right?
from samples.
We shouldn't do one datastore/memcache read per candidate, but only one
read in total when the second user joins.
If candidate is sent to GAE after the second user joins, GAE will send it
to GCE.
On Fri, Nov 14, 2014 at 4:36 AM, Justin Uberti [email protected]
wrote:
Let's discuss when I get back to Kirkland. Each candidate should be fast
since that is only read from memcache, right?—
Reply to this email directly or view it on GitHub
#163 (comment).
-jiayl
from samples.
Related Issues (20)
- When Chrome displays virtual camera colors, the colors are displayed incorrectly HOT 3
- When I use Android phone to publish stream, I get this problem in my chrome browser: "Uncaught TypeError: Cannot read property 'find' of undefined." HOT 1
- Invite is being truncated HOT 1
- Scalable Video Coding example needs update HOT 3
- Scalable Video Codec prevent incorrect Safari usage
- Scalable Video Codec include an SVC support check HOT 1
- WebGPU code refresh needed: layout parameter now required in createRenderPipeline calls HOT 2
- No SRFLX ICE candidates? HOT 1
- [Sample PeerConnection Channel] - The all sound turn off after enable navigator.mediaDevices.getUserMedia HOT 2
- E2E interop test failures HOT 4
- Send SDP answer without signalling server HOT 5
- Update insertable streams section to WebRTC Encoded transforms HOT 4
- Video Analyzer doesn't work on http/default server settings HOT 3
- Can I share some Windows? Let's HOT 1
- Add new sample: Mirroring and recording video from camera stream HOT 1
- navigator.mediaDevices.getUserMedia doesn't work on macos catalyst WKWebView HOT 1
- mp4 mimeType is downloaded with .webm extension, not a mp4. HOT 1
- Can a shared surface select its derivative window? HOT 1
- Script (lit-element) error , not close jsx param.
- On some of my machines I got the error "Error creating offer: SyntaxError: Failed to construct 'RTCPeerConnection': '' is not a valid URL." HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samples.