GCF on GCP auto-scales (as does GAE & GCR). Each instance only supports one
request at a time. Additional instances will be spun up to support other
concurrent requests. If your function (or app or container) "goes viral,"
GCP automatically handles the traffic for you. However, not everyone has
unlimited budget, so there's a way you can control the max # of instances
spun-up. To learn more about concurrent requests, check out this page in
our documentation: https://cloud.google.com/functions/docs/concepts/exec

On Sun, Aug 16, 2020 at 12:57 AM Vishnu U <vish0...@gmail.com> wrote:

> Thanks a lot. Now I got an idea on how to proceed. Also please explain to
> me in case there are multiple requests how GCP will handle them - is there
> any load balancer? This is because the project is time-critical.
>
> On Sunday, August 16, 2020 at 1:56:44 AM UTC+5:30, Wesley C (Google) wrote:
>>
>> Ah, great. That was good to know, and yes, you can do it the easiest with
>> Cloud Functions... since you're only serving a model, you don't need an
>> entire app (App Engine). I've not done it myself, but start with this
>> post
>> <https://blog.tensorflow.org/2018/08/training-and-serving-ml-models-with-tf-keras.html>
>> on how to serve models w/tf.keras. Then follow-up with this post
>> <https://cloud.google.com/blog/products/ai-machine-learning/how-to-serve-deep-learning-models-using-tensorflow-2-0-with-cloud-functions>
>> about a year later on how it can be done with Cloud Functions.
>>
>> To quickly learn Cloud Functions, I'll refer to the advice I gave in my
>> 1st response: "You can get started immediately by going to the Cloud
>> console's Cloud Functions dashboard
>> <https://console.cloud.google.com/functions> where you can create, code,
>> deploy, and test your function, all from your browser. The Quickstart
>> sample <https://cloud.google.com/functions/docs/quickstart-python> code
>> is already dropped into the editor and ready for you to modify."
>>
>> Good luck!
>> --Wesley
>>
>>
>> On Fri, Aug 14, 2020 at 11:37 PM Vishnu U <vish...@gmail.com> wrote:
>>
>>> My aim is like i want to perform prediction using a Keras saved model.
>>> So I receive two sensor inputs from raspberry pi to Google Cloud and
>>> perform the prediction on the cloud and return that result back to
>>> raspberry pi to make necessary changes. Will cloud functions be suitable
>>> for this?
>>>
>>> On Saturday, August 15, 2020 at 11:59:13 AM UTC+5:30, Wesley C (Google)
>>> wrote:
>>>>
>>>> It's best if you describe your entire architecture then, because I was
>>>> only going on what you stated in your OP... you "have to send data from
>>>> Raspberry Pi to Google Cloud, process it, and receive the result back to
>>>> the same Raspberry Pi." I answered that your use case looks like it fits
>>>> Cloud Functions better than either App Engine or Cloud Run. There was no
>>>> mention of GCS (Cloud Storage) nor Cloud Datastore. As mentioned, you *can*
>>>> use App Engine to get the RaspPI data, process it, and return it, but it
>>>> seems like it would be easier to use Cloud Functions instead to do the same
>>>> thing.
>>>>
>>>> Cloud Functions can take the data, do some processing and return it,
>>>> just like App Engine, but easier. However, if the code that processes this
>>>> data is more complex and is an entire *app* where you have many components
>>>> or need to persist, provide a web UI, etc., then yes, App Engine would then
>>>> be better. Cloud Functions is for serverless unction-hosting in the cloud,
>>>> App Engine is for serverless app-hosting in the cloud, and Cloud Run is for
>>>> serverless container-hosting in the cloud.
>>>>
>>>>
>>>> On Fri, Aug 14, 2020 at 6:22 PM Vishnu U <vish...@gmail.com> wrote:
>>>>
>>>>>
>>>>> But my source of data is not any cloud storage or cloud data store.
>>>>> Suppose I received data on app engine from raspberry pi and I perform some
>>>>> calculation and want to return that data. Is this possible?
>>>>> On Sat, 15 Aug 2020 at 6:45 AM, wesley chun <wes...@gmail.com> wrote:
>>>>>
>>>>>> While App Engine will serve your needs, based on what you asked,
>>>>>> perhaps Google Cloud Functions <http://cloud.google.com/functions>
>>>>>> would be a simpler solution. You can get started immediately by going to
>>>>>> the Cloud console's Cloud Functions dashboard
>>>>>> <https://console.cloud.google.com/functions> where you can create,
>>>>>> code, deploy, and test your function, all from your browser. The 
>>>>>> Quickstart
>>>>>> sample <https://cloud.google.com/functions/docs/quickstart-python>
>>>>>> code is already dropped into the editor and ready for you to modify.
>>>>>> Alternatively, if you already have that app you want to call in a Docker
>>>>>> container, then you should use Google Cloud Run
>>>>>> <http://cloud.google.com/run> instead. App Engine is best suited for
>>>>>> normal web apps like Flask or Django.
>>>>>>
>>>>>> Hope this helps!
>>>>>> --Wesley
>>>>>>
>>>>>> On Fri, Aug 14, 2020 at 7:28 AM Vishnu U <vish...@gmail.com> wrote:
>>>>>>
>>>>>>> I am working on a project where I have to send data from Raspberry
>>>>>>> Pi to Google Cloud, process it, and receive the result back to the same
>>>>>>> Raspberry Pi. Is this possible using Google App Engine?. If not is there
>>>>>>> any other service in GCP that can do this functionality?
>>>>>>>
>>>>>> --
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> "A computer never does what you want... only what you tell it."
>>     wesley chun :: @wescpy <http://twitter.com/wescpy> :: Software
>> Architect & Engineer
>>     Developer Advocate at Google Cloud by day; at night...
>>     Python training & consulting : http://CyberwebConsulting.com
>>     "Core Python" books : http://CorePython.com
>>     Python blog: http://wescpy.blogspot.com
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/d87a0aec-444b-4409-852f-ff1761ddc940o%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/d87a0aec-444b-4409-852f-ff1761ddc940o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A computer never does what you want... only what you tell it."
    wesley chun :: @wescpy <http://twitter.com/wescpy> :: Software
Architect & Engineer
    Developer Advocate at Google Cloud by day; at night...
    Python training & consulting : http://CyberwebConsulting.com
    "Core Python" books : http://CorePython.com
    Python blog: http://wescpy.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAB6eaA7eWaL9xxcif%2B0uqkvOEXVLrVm2B%3Duu9fdmXLXsOtLVRw%40mail.gmail.com.

Reply via email to