Differentiated service with Google App Engine

84 views
Skip to first unread message

rerngvit yanggratoke

unread,
Jul 26, 2012, 3:11:48 PM7/26/12
to google-a...@googlegroups.com
Hello,
       Anyone have an idea on how to achieve a differentiated service with Google App Engine? I have two types of users. One is premium while another one is free user. I would like to set different minimum latencies for firing up new GAE instances between the two. In other words, I am willing to pay extra for the traffic generated from the premium users. Nonetheless, for the free users, I would prefer to pay at minimum or within the daily free quota provided by Google. In my case, I expect that the free users are able to tolerate higher latency than the premium ones. I believe that this case should be quite general and apply to many people.
       Assuming that I can identify types of users by the URLs they use or via other mechanisms. The only way I could think of is creating two separated applications and letting the premium users access the one that enables billing, while free users access the one that doesn't. However, my free and premium users need to share the datastore because they are also have to communicate within the application. Unfortunately, it seems that sharing a datastore across applications is not possible at the moment (feel free to correct me if I am wrong). 

Any ideas or suggestions?

Cheers,
Rerngvit
Message has been deleted

David Hardwick

unread,
Jul 26, 2012, 11:19:12 PM7/26/12
to google-a...@googlegroups.com
Hi 

If you put in a feature request to have two+ apps access the same datastore natively then I will definitely star it!

Drake

unread,
Jul 26, 2012, 11:41:43 PM7/26/12
to google-a...@googlegroups.com

If you are on a mult-threaded platform… you can achieve this by just adding a Wait to the people you want to run slower. That will free CPU for the other request.

 

When you go over 8 requests per instance this will have less effect, but generally how it works is

User 1 Process start:

                User 1 runs until you hit an API

User 2 Starts:

                User 2 runs until you hit an API

User 1 Resumes:

                User 1 runs until an API

User 2 resumes:

                User 2 runs until an API

User 1 finishes

User 2 finishes

 

If you insert Pause/wait/DoNothing   Spacers in your code that are condition on the QoS of the user then the non-delayed user will get priority.
I do a similar trick to make certain that low priority requests don’t cause high priority requests that are near the timelimit from finishing.

 

Better to know that you can serve 100 small tasks and only hit 75% CPU than to have a big task drop because small tasks ate all the CPU.

 

From: google-a...@googlegroups.com [mailto:google-a...@googlegroups.com] On Behalf Of David Hardwick
Sent: Thursday, July 26, 2012 8:17 PM
To: google-a...@googlegroups.com
Subject: [google-appengine] Re: Differentiated service with Google App Engine

 

If you put in a feature request to have more than one app access the same datastore natively, then I will surely start that issue!



On Thursday, July 26, 2012 3:11:48 PM UTC-4, rerngvit yanggratoke wrote:

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/cs1aYijZARwJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Kyle Finley

unread,
Jul 27, 2012, 12:39:23 AM7/27/12
to google-a...@googlegroups.com
David and anyone else who is interested here's the feature request:

Instead of allowing multiple apps to share one datastore; It appears that the App Engine team is planning on giving more control over app versions, in the future. I believe this is the Google IO session that discusses it:



-Kyle

Rerngvit Yanggratoke

unread,
Jul 27, 2012, 2:42:37 AM7/27/12
to google-a...@googlegroups.com
Thanks David, I have stared the issue.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/-mTVi29GpDwJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Best Regards,
Rerngvit Yanggratoke 

Rerngvit Yanggratoke

unread,
Jul 27, 2012, 2:49:58 AM7/27/12
to google-a...@googlegroups.com
Thanks, Drake. I believe that surely will help with the prioritization of CPU resources. It's only that I am more concerned with the cost of running extra GAE instances because that is the major cost at the moment.  

Rerngvit Yanggratoke

unread,
Jul 27, 2012, 2:54:55 AM7/27/12
to google-a...@googlegroups.com
However, sharing datastore across applications is one of the solutions to the differentiated service. I am happy with GAE team comes up with other solutions as well. As a result I created a new issue specifically to this. Anyone who need this are welcome to star the issue.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/F8SZuWOop_EJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Drake

unread,
Jul 27, 2012, 11:07:49 AM7/27/12
to google-a...@googlegroups.com

This shouldn’t increase your number of instances in most cases. The threading will mean that you prioritize the other threads by putting wait states in for the less important ones. There is some overhead, but not much.

 

And if you only insert small waits through out the app, you just give the other threads a chance to run 10ms becomes a minimum time to wait, and if you put it each 3rd of the way through your code, you add 30ms minimum to a low priority user, and you guarantee that your high priority user gets opportunities to barrel through.

 

 

hyperflame

unread,
Jul 27, 2012, 3:03:28 PM7/27/12
to Google App Engine
Correct me if I'm on the wrong track, but I thought two applications
could share the same datastore via the Remote API:
https://developers.google.com/appengine/docs/java/tools/remoteapi

Drake

unread,
Jul 27, 2012, 3:10:23 PM7/27/12
to google-a...@googlegroups.com
It works, it is painfully slow. And it makes Race States really dangerous.
It is really meant for local sandboxing with the real datastore.
Reply all
Reply to author
Forward
0 new messages