multithreading


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.

Related Links

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
QWebFrame::evaluateJavaScript(scriptSource) leads to “SyntaxError: Parse error” when not executed in main Thread
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?

Categories

HOME
xamarin
pypi
mfc
relayjs
at-command
google-oauth
microservices
ezpublish
pivotal-cloud-foundry
datastax-java-driver
paradox
autotools
iggrid
session-variables
facebook-php-sdk
spring-kafka
kentor-authservices
rascal
spring-tool-suite
hapi
carthage
dynamics-crm-online
connection-string
code-review
visual-composer
conemu
captiveportal
android-widget
minitab
maquette
elasticsearch-ruby
assistant
jspm
socialengine
media-queries
binary-data
http-status-code-503
uisplitview
jspresso
commit
disassembling
xcode-extension
lto
space-complexity
hilbert-curve
mesos-chronos
g-code
reportingservices-2005
strptime
komodoedit
prolog-setof
worksheet
pebble-watch
aurelia-validation
np-complete
bonobo
database-optimization
adxstudio-portals
file-writing
thrust
fuzzy-search
qgraphicsview
pickadate
oauth2client
freelancer.com-api
rtbkit
r-tree
qtableview
libressl
rgeo
jsapi
fpml
html-helper
castle
ceil
uitouch
p4java
doskey
terminal-services
dataservice
sharp-repository
typoscript2
cisco-jtapi
broken-links
twrequest
netbeans-6.9
code-cleanup
php-parser
deobfuscation
winbugs14
celltable
gdlib
w3wp.exe
gallio
.nettiers
mirah
msdev
misv

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App