Hi We have an app (Play Framework) which accepts files from different devices. Devices are logging some values into a file and send that file every 5 minutes. The app accepts the file, parses it and processes it.
Actual steps are 1. parse the file 2. recalculate values (we get values as 0-100%, so we need to go to database to read actually range for each value and recalculate it) 3. filter zero values (if each value is < X, then value = 0 where X is again obtained from database for each value) 4. calculate calculation values (we read formulas from database and create new calculated values from the uploaded values) 5. we store values to timeseries database (kairosdb) 6. every value belongs to different tag (tag is like pressure, temperature ..) so when we get a value, we activate the tag (update in database) 7. store last value for each tag (again, make an update in the database) 8. update device status (we update the last uploaded time for each device in the database) 9. check for alarms (for each alarm we fetch avg value from timeseries database and if it's >, < or == to alarm value, activate alarm and insert/update alarm log into database) To do all of this, it takes around 200ms-300ms on our production machine. Problems: 1. Should I actually split this into separate actors? Right now it's in one big actor which is calling injected services. 2. How to make sure each actor is called after another (to have sequential processing)? Should each actor pass the message to another actor or is there some better way (supervisor/parent? )? 3. What happens when I want to skip certain step (for example, to skip checking for alarms)? Should there be skipAlarms = true in the message or I should implement this somehow else? 4. Should there be any problems when I'm passing collection (in our case Set of values) between actors? Right now I'm inserting around 20k files and I'm noticing big memory consumption so I might even have a memory leak somewhere. One of the ideas that I had was to create one parent actor for each device. The parent actor passes the message to child actor (9 steps) and waits for an answer. When it gets it, pass the message to another step. There I could then have some kind of logic to skip certain steps. For any suggestions and comments I would be really grateful. -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
