I have created a very basic Restful service in Spary. Locally it is all
working fine.
But when I deployed it onto the server (2 core), I am seeing CPU usage at
100%.
The usage peaks to 100% for a few seconds when I try to start the
application. An d when I post any request to the service end-point, the CPU
usage peaks to 100% for a few minutes.
Please see the below code
object Boot {
def main(args: Array[String]): Unit = {
implicit val system = ActorSystem("on-spray-can")
val service = system.actorOf(Props[AuditorServiceActor], "AuditorActor")
val config = ConfigFactory.load()
implicit val timeout = Timeout(120.seconds)
IO(Http) ? Http.Bind(service, config.getString("http.interface"),
config.getInt("http.port"))
}}
class AuditorServiceActor extends Actor with AuditorService {
def actorRefFactory = context
def receive = runRoute(myRoute)}
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.