These are chat archives for akkadotnet/akka.net

10th
Jun 2015
John Haigh
@haighis
Jun 10 2015 00:04
@Horusiath I have an AtLeastOnceDelivery actor that is responsible for writing to an external data store (for example a Product Service that inserts a product to an Oracle Database, etc.) and I want to confirm the right place in this actor that I should be calling the data access/business logic to insert to a MS SQL Server database? Right now I have this in the ReceiveCommand ( protected override bool ReceiveCommand(object message)) inside Persist and then Deliver and only if the Product Service return a boolean true will I return a Confirmable message. Here is the full code example that inserts to a MS SQL Server database https://github.com/haighis/TodoReference/blob/master/TodoActors/Actors/Persistence/TodoActor.cs
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 05:39
@haighis what I see right now:
  • the intent is not quite clear: I think that it's good to have one standard actor responsible for calling an external service and one using at-least-one-delivery semantics, working as retry proxy for the first actor. In your example DeliveryActor should be the one which is calling an external service when triggered with message from TodoActor.
  • when you can, try to get snapshot of the current undelivered messages using GetDeliverySnapshot and set them when received from SnapshotOffer in ReceiveRecover using SetDeliverySnapshot.
  • it's possible that delivered message will be send more than once, so it's up to your service to ensure that it won't insert the same data in new row on the each call (called actor/service must be idempotent)
Marc Piechura
@marcpiechura
Jun 10 2015 06:26
Hi, i would like to know if anyone is working on a persistence plugin for mongodb
Roger Johansson
@rogeralsing
Jun 10 2015 07:01
I havent heard of anyone so far.. @Horusiath do you know?
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 07:44
nope
Marc Piechura
@marcpiechura
Jun 10 2015 07:45
Alright then I will start working on it
Kamil Wojciechowski
@aph5nt
Jun 10 2015 08:00
Hi All
Are there any samples how to use persistance in / with F# way ?
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 08:04
unfortunatelly, persistence plugin for F# has to be updated. It's too limiting right now
Kamil Wojciechowski
@aph5nt
Jun 10 2015 08:05
ok, thx
Alexander Prooks
@aprooks
Jun 10 2015 09:03
hi all. Could anyone help me with logging configs?
http://prntscr.com/7f9nmg
Kjellski
@kjellski
Jun 10 2015 09:05
@aprooks try "loglevel" instead of "logLevel"
@aprooks and DEBUG instead of "DEBUG"
Alexander Prooks
@aprooks
Jun 10 2015 09:06
lol tnx
"loglevel" this one helped
Kjellski
@kjellski
Jun 10 2015 09:06
@aprooks this was working yesterday: https://gist.github.com/kjellski/b2c932f309a3230e1a58
Alexander Prooks
@aprooks
Jun 10 2015 09:07
docs need some review, there are all kinds of log configs
Kjellski
@kjellski
Jun 10 2015 09:07
@aprooks that's what I thought yesterday too, PRs incoming? ;)
Alexander Prooks
@aprooks
Jun 10 2015 09:08
yes, I'll check as well
Kjellski
@kjellski
Jun 10 2015 09:08
I find it particularly weird that the parser is just accepting everything, also stuff that could be identified as wrong in a context as a scheme... but that part is the hard one...
Alexander Prooks
@aprooks
Jun 10 2015 09:09
yes, had the same feeling
that there are no errors
quoted version is also working loglevel="DEBUG"
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 09:11
quotes are necessary when white chars are used
Alexander Prooks
@aprooks
Jun 10 2015 09:29
akkadotnet/getakka.net#82
didn't find other camel cased logLevel in docs
Raymen Scholten
@raymens
Jun 10 2015 13:24
@Horusiath Hey, is there any news on the Typed F# actors, like a release date?
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 13:40
@raymens we decided, that all experimental changes that could possibly break existing F# API, will be moved to the separate fork of Akka.FSharp (I called it Akkling) - most of the work there is finished and I'll try to publish a NuGet for it this weekend
since Akka.FSharp is already v1.0 and as officially supported plugin it should be possibly compatible with core Akka even in very long run (i.e. compatibility with akka-typed API when ported on C#). This way I want to be more flexible in releases and possible changes
Raymen Scholten
@raymens
Jun 10 2015 13:53
@Horusiath okay! Thanks for the info. So the idea is that new major releases of Akka.net will probably get an API similar to the one in the Akkling repo at that time?
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 14:02
this would be good, but akka.net 2.0 is so far away ATM, that this is not even a prediction, it's a prophecy ;)
Stuart Blackler
@sblackler
Jun 10 2015 14:56
Heya, I'm experiencing some problems with Akka. We are pulling from azure service bus in batches of 25 (for example). But we are often seeing processing hangs (so will process say 8, then hang for 1-3 seconds, then process the rest). Any idea where we can start looking to diagnose the problem?
cc/ @BenGale
Aaron Stannard
@Aaronontheweb
Jun 10 2015 15:54
@sblackler how many cores do you have for your Akka.NET processes?
i.e. what size are the instances?
Stuart Blackler
@sblackler
Jun 10 2015 15:56
happens when running locally in a console app. Im pretty new to akka. i've been taking stuff out to see if i can find the problem.
Marc Piechura
@marcpiechura
Jun 10 2015 15:56
I have a question about the persistence plugins, is there a point which is called once during system creation? Maybe the IExtension?
Stuart Blackler
@sblackler
Jun 10 2015 15:58
How many message/sec would be okay for a standard desktop pc? I'm guessing we track this via metrics produced from akka.monitoring?
Marc Piechura
@marcpiechura
Jun 10 2015 15:59
And one about the serialization strategie for the payloads, in the Cassandra plugin the complete message is serialized and stored as payload, but the sql-server plugin creates a list with a serializer per payload type, so I would like to know which I should use
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:00
@sblackler our PingPong client app can do something like 45 million messages / sec locally inside one console process on a decent dev machine
so you should have a lot of headroom
so are you seeing hangs when you're pulling messages off of azure service bus?
or in post-processing afterwards?
Stuart Blackler
@sblackler
Jun 10 2015 16:01
yeah that's alot more than what we are seeing. I think I know the reason why now. Doesn't look like akka fault (winning)
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:07
@sblackler :thumbsup:
glad to hear it
but yes, you can use Akka.Monitoring to monitor that stuff. @BenGale just sent me a PR for Azure insights support this morning
@Silv3rcircl3 the Akka.Persistence extension gets created the first time you initialize a PersistentActor
so it's done lazily
but Persistence plugins work much the same way
the entire message gets serialized
I've only used the Akka.Persistence.SQLServer and the default one myself
haven't looked at Cassandra yet
Marc Piechura
@marcpiechura
Jun 10 2015 16:12
@Aaronontheweb Perfect, just need a point which is called once if on system or actor creation doesn't matter.
Marc Piechura
@marcpiechura
Jun 10 2015 16:18
I mean Cassandra stores the hole IPersistanceRepresentation object as payload but sql-server stores the IPersistanceRepresentation.Payload as payload but needs a serializer per Payload type while Cassandra just uses the Context.System.Serialization.FindSerializerForType(PersistentRepresentationType);
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:19
seems like just an implementation difference
Marc Piechura
@marcpiechura
Jun 10 2015 16:20
So I can use which one I want? :-)
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:20
yessir
Marc Piechura
@marcpiechura
Jun 10 2015 16:20
Great
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:20
you don't have to configure any of those serializers
if we exposed that level of detail inside one of those plugins that would be a very leaky abstraction
Marc Piechura
@marcpiechura
Jun 10 2015 16:21
I'm writing a mongodb plugin that's the reason I'm asking ;-)
Aaron Stannard
@Aaronontheweb
Jun 10 2015 16:22
ahhhh
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 16:50
@sblackler are you able to recreate that service bus problem in some gist snippet? You could also show the code of an actor used for pulling messages - my guess is that is more implementation/design issue
also I remember that @rogeralsing created a blog post some time ago about akka/service bus integration
Ben Gale
@BenGale
Jun 10 2015 16:54
I think the issue we were having (I work with @sblackler) was that we were completing a lot of messages in one actor and it was backing up. We now maintain the collection of messages in an actor and have a router child that can be used to complete many messages in parallel.
We were looking at 200-300ms to complete a single message
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 16:56
did you measure how much of that time was spent in transport, actors and service bus?
Ben Gale
@BenGale
Jun 10 2015 16:57
We pass an id to the actor and it grabbed it from a list and called complete so not much going on
By it I’m refering to the brokeredmessage
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 17:13
I mean that maybe delays lay on the service bus side?
Ben Gale
@BenGale
Jun 10 2015 17:31
Oh yeah they do for sure, we just don’t want to wait for each message to complete and respond. We’d rather call complete on many of them.
I guess we could just call it and let it go, we’re not actually doing anything if it fails to complete.
I’ll take another look in the morning
hope you'll find it helpful
Ben Gale
@BenGale
Jun 10 2015 17:33
Thanks. I’ll take a lok
look
Kamil Wojciechowski
@aph5nt
Jun 10 2015 18:12
im trying to get the sql persistance to work, but I got
System.IO.FileNotFoundException : Could not load file or assembly 'Akka.Persistence.Sql.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
referenced
nuget Akka
nuget Akka.FSharp
nuget Akka.Persistence
nuget Akka.Persistence.SqlServer
nuget Akka.Persistence.Sql.Common
the last one was not found
by paket
F# is set to 4.3.1; framework 4.5
is that persistance plugin production ready ?
NeoDarque
@NeoDarque
Jun 10 2015 18:28
@aph5nt I ran into the same problem. That dll is missing from that nuget package it seems, but I just downloaded the akka.net source code, compiled it, and copied the Akka.Persistence.Sql.Common.dll file from there.
Kamil Wojciechowski
@aph5nt
Jun 10 2015 18:31
good to know! thx a lot
Kamil Wojciechowski
@aph5nt
Jun 10 2015 18:42
Aaron Stannard
@Aaronontheweb
Jun 10 2015 18:46
@aph5nt the persistence plugin is still in beta
apparently I forgot to add SQL.Common to our nuget list on the last release
I'll fix that when I get a chance - might not be until tomorrow
Kamil Wojciechowski
@aph5nt
Jun 10 2015 18:47
oki doki, thx
John Haigh
@haighis
Jun 10 2015 19:19
@Horusiath I see what you mean. I am calling an external service from the wrong actor. I created these actors straight from Persistence samples in akka.net source samples. I am going to start over with the design and get these actors to fail using the Persistence sample in akka.net source samples to understand before moving forward. Thanks for the information.
Stuart Blackler
@sblackler
Jun 10 2015 20:11
@Horusiath @BenGale the backup was actually caused by one of the monitors we had registered (both custom). One was using RX's buffer extension and I believe that this is the cause. Taking that monitor out and the processing speeds up no end. I've started taking a look at a custom buffer to improve performance. I'm guessing by the fact we are experiencing these pauses that the monitors are called synchronously. Personally, I feel that this should be asynchronous and should not impact the main actors. Thoughts?
Sorry for the slow update on that btw, other work things got in the way
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 20:13
@sblackler it's hard to speak without examples - akka monitors and loggers both work in fully async mode
Stuart Blackler
@sblackler
Jun 10 2015 20:16
hmm, any ideas on why taking the offending monitor out would cause a dramatic speed up? :/
Sean Gilliam
@sean-gilliam
Jun 10 2015 20:19
so in my ongoing quest to improve the api-docs i created a list based on sandcastle output and searching through the solution. A lot of the cross-reference stuff its complaining about is the protocol buffer stuff which we can prb ignore. I need to convert it to a spreadsheet for easier consumption, but here it is
(warning OMGHUGE)
https://gist.githubusercontent.com/sean-gilliam/434154a04935dd94fc6f/raw/gistfile1.txt
Bartosz Sypytkowski
@Horusiath
Jun 10 2015 20:21
@sblackler what monitor are you using?
Aaron Stannard
@Aaronontheweb
Jun 10 2015 21:27
@sblackler the current Akka.Montior.StatsD implementation does make a blocking write call to a UDP socket, but I actually perf tested that and got a 40% improvement in performance over using the async method: http://www.aaronstannard.com/tradeoffs-in-high-performance-software/
counter-intuitive, but the article explains why
Stuart Blackler
@sblackler
Jun 10 2015 21:28
@Horusiath two different ones writing data into azure storage/application insights.
@Aaronontheweb thanks, will read