deploying CPU intensive web service on cloud
I have an application which I want to expose as a web service (SaaS). The application is CPU intensive and is a multithreaded application which takes good amount of time for the execution(on an average 15-20secs). Since, I want to expose it as a SaaS and want to use existing cloud services available in the market like Amazon, Google App Engine etc. so that the cost involved and the work involved while scaling my service is not much. I have couple of questions in my mind like: 1.) Since the application is multithreaded and the number of threads invoked depends on the number of results thrown by the service(so basically number of threads is a dynamic entity). Right now I have a 6 core processor so I have kept the threadpool size to be 6 but since I am moving onto the cloud, how can I optimally use the cloud infrastructure? 2.) Do the cloud service providers(which?) give the option to select number of CPU cores required for each request (or something similar to serve my purpose)? 3.) What changes are needed in the code (related to the threads)? 4.) Any other specific area which I should give a sight for moving to the cloud?
In Amazon EC2 you are basically paying for different types of instances - you are free to pick one with only single core and one with sixteen. You get what you pay for. how can I optimally use the cloud infrastructure? Your approach is fine, if your task is CPU-intenstive, have a thread pool with the same number of threads as CPU cores/CPUs. select number of CPU cores required for each request No, at least not Amazon. You run your application on a given instance and that's all you get. You have to pick instance type in advance, but of course you are free to switch between them, add new, etc. at any time. The cloud! In Google App Engine you can't create threads, so it's a no-option for you. See also: Why does Google App Engine support a single thread of execution only? 3.) What changes are needed in the code (related to the threads)? None. It's a standard PC, after all. 4.) Any other specific area which I should give a sight for moving to the cloud? Well, see above, some services are completely useless for you, like GAE. Make some research before you actually pay for something.
QThread emitted signal to connect to multiple UI classes
Clojure, atoms and refs
NUMA systems, virtual pages, and false sharing
GCD with runloops and background refresh of app, iOS7
Threads in application server and connections in HttpServer
Temporary managed objects are not properly merged from child context to main context
Delphi: Speed up loading of interfaced plugins (DLL)
How to call thread on button click and release button
Difference in multithreaded program on multprocessor and uniprocessor
Duplicate a ColdFusion Session so Threads Live On After Sign Out
The “this” pointer and message receiving in D
InfiniBand: transfer rate depends on MPI_Test* frequency
How to manage same CUDA kernel call from multiple CPU threads?
Not able to set processor affinity
Using Google map objects within a web worker?