{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/96","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/96/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/96/events","html_url":"https://github.com/dotnet/orleans/issues/96","id":56917632,"number":96,"title":"Support for custom (default) placement strategies","user":{"login":"hstuart","id":113535,"avatar_url":"https://avatars.githubusercontent.com/u/113535?v=3","gravatar_id":"","url":"https://api.github.com/users/hstuart","html_url":"https://github.com/hstuart","followers_url":"https://api.github.com/users/hstuart/followers","following_url":"https://api.github.com/users/hstuart/following{/other_user}","gists_url":"https://api.github.com/users/hstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/hstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hstuart/subscriptions","organizations_url":"https://api.github.com/users/hstuart/orgs","repos_url":"https://api.github.com/users/hstuart/repos","events_url":"https://api.github.com/users/hstuart/events{/privacy}","received_events_url":"https://api.github.com/users/hstuart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-07T17:01:14Z","updated_at":"2015-02-09T07:25:41Z","closed_at":null,"body":"Currently the default placement strategy is rather hardwired and limited and it is only possible to tweak it using the built-in placement strategies. I'd like to propose that we open up PlacementDirectorsManager, PlacementStrategy, and PlacementDirector so grain solutions can opt to create their own placement strategies for more specialised setups. Simultaneously, it would be beneficial to be able to specify a custom default placement strategy in the configuration and have that take effect globally rather than having to go through all the grains and add attributes to them.\r\n\r\nSome of the custom placement strategies that might be of interest could be to limit new activations to not overwhelm a fixed machine setup (e.g. in a non-cloud/non-virtual setup), place activations according to expected communication coherence, etc."},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/73467125","html_url":"https://github.com/dotnet/orleans/issues/96#issuecomment-73467125","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/96","id":73467125,"user":{"login":"gabikliot","id":10171207,"avatar_url":"https://avatars.githubusercontent.com/u/10171207?v=3","gravatar_id":"","url":"https://api.github.com/users/gabikliot","html_url":"https://github.com/gabikliot","followers_url":"https://api.github.com/users/gabikliot/followers","following_url":"https://api.github.com/users/gabikliot/following{/other_user}","gists_url":"https://api.github.com/users/gabikliot/gists{/gist_id}","starred_url":"https://api.github.com/users/gabikliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabikliot/subscriptions","organizations_url":"https://api.github.com/users/gabikliot/orgs","repos_url":"https://api.github.com/users/gabikliot/repos","events_url":"https://api.github.com/users/gabikliot/events{/privacy}","received_events_url":"https://api.github.com/users/gabikliot/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T07:25:41Z","updated_at":"2015-02-09T07:25:41Z","body":"@hstuart Perhaps you scenario can be solved with one generic placement policy which can be parameterized by the application? For example, look at https://github.com/dotnet/orleans/blob/master/src/OrleansRuntime/Placement/ActivationCountPlacementDirector.cs.\r\nIt balances by the number of activation, but it would be easy to balance by some undefined RESOURCE and allow the application to specify this resource. The resource will be specified in the PlacementStrategy attribute (something like GeneralResourcePlacement[\"Resource\"]) and in addition silos will be configured to report this resource periodically as part of periodic stats publishing (DeploymentLoadPublisher).\r\n\r\nWould that solve your problem?\r\nI think that conceptually it is easy to do. The hard part is that not all resources require the same balancing logic. For example, for CPU you need to smooth it. For other resources it may be something else. So the trick would be to come up with a unified balancing algorithm that can work across a wide range of resources. This might be hard, but maybe possible.\r\n\r\nIf you can come up with such an implementation, it would be very interesting."}}