You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by phrocker <gi...@git.apache.org> on 2018/01/16 11:33:20 UTC

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

GitHub user phrocker opened a pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/242

    MINIFICPP-374: Commit Linux power management service that enables the…

    … threadpools to reduce the number of threads
    
    and throttle active tasks using linux powr constructs.
    
    MINIFICPP-374: Add readme entry
    
    Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
         in the commit message?
    
    - [ ] Does your PR title start with MINIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [ ] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
    - [ ] If applicable, have you updated the LICENSE file?
    - [ ] If applicable, have you updated the NOTICE file?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/phrocker/nifi-minifi-cpp MINIFICPP-374

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi-minifi-cpp/pull/242.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #242
    
----
commit 9c5cddd117b5a244a87f98f008228e55544dc27b
Author: Marc Parisi <ph...@...>
Date:   2018-01-13T17:19:11Z

    MINIFICPP-374: Commit Linux power management service that enables the threadpools to reduce the number of threads
    and throttle active tasks using linux powr constructs.
    
    MINIFICPP-374: Add readme entry

----


---

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/242#discussion_r161791698
  
    --- Diff: README.md ---
    @@ -609,6 +609,21 @@ Additionally, a unique hexadecimal uid.minifi.device.segment should be assigned
     	  	class: ControllerServiceClass
     	  	Properties:
     
    +### Linux Power Manager Controller Service
    +  The linux power manager controller service can be configured to monitor the battery level and status ( discharging or charging ) via the following configuration.
    +  Simply provide the capacity path and status path along with your threshold for the trigger and low battery alarm and you can monitor your battery and throttle
    +  the threadpools within MiNiFi C++. Note that the name is identified must be ThreadPoolManager.
    +
    +   Controller Services:
    +    - name: ThreadPoolManager
    +      id: 2438e3c8-015a-1000-79ca-83af40ec1888
    +      class: LinuxPowerManagerService
    +      Properties:
    +          Battery Capacity Path: /path/to/battery/capacity
    +          Battery Status Path: /path/to/battery/status
    --- End diff --
    
    Yeah, for linux I think there is a small(ish) enough set that we can do that. Good idea. 


---

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

Posted by minifirocks <gi...@git.apache.org>.
Github user minifirocks commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/242#discussion_r162174433
  
    --- Diff: README.md ---
    @@ -609,6 +609,21 @@ Additionally, a unique hexadecimal uid.minifi.device.segment should be assigned
     	  	class: ControllerServiceClass
     	  	Properties:
     
    +### Linux Power Manager Controller Service
    +  The linux power manager controller service can be configured to monitor the battery level and status ( discharging or charging ) via the following configuration.
    +  Simply provide the capacity path and status path along with your threshold for the trigger and low battery alarm and you can monitor your battery and throttle
    +  the threadpools within MiNiFi C++. Note that the name is identified must be ThreadPoolManager.
    +
    +   Controller Services:
    +    - name: ThreadPoolManager
    +      id: 2438e3c8-015a-1000-79ca-83af40ec1888
    +      class: LinuxPowerManagerService
    +      Properties:
    +          Battery Capacity Path: /path/to/battery/capacity
    +          Battery Status Path: /path/to/battery/status
    --- End diff --
    
    overall looks good. One question I have is why we implement using a controller service instead of a processor. It looks like more like processor to monitor the standard pro filesystem and perform some user config actions


---

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi-minifi-cpp/pull/242


---

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/242#discussion_r161790548
  
    --- Diff: README.md ---
    @@ -609,6 +609,21 @@ Additionally, a unique hexadecimal uid.minifi.device.segment should be assigned
     	  	class: ControllerServiceClass
     	  	Properties:
     
    +### Linux Power Manager Controller Service
    +  The linux power manager controller service can be configured to monitor the battery level and status ( discharging or charging ) via the following configuration.
    +  Simply provide the capacity path and status path along with your threshold for the trigger and low battery alarm and you can monitor your battery and throttle
    +  the threadpools within MiNiFi C++. Note that the name is identified must be ThreadPoolManager.
    +
    +   Controller Services:
    +    - name: ThreadPoolManager
    +      id: 2438e3c8-015a-1000-79ca-83af40ec1888
    +      class: LinuxPowerManagerService
    +      Properties:
    +          Battery Capacity Path: /path/to/battery/capacity
    +          Battery Status Path: /path/to/battery/status
    --- End diff --
    
    Is it feasible to detect these paths automatically if they aren't specified by the user? I.e. use heuristics to check some standard locations, but still allow the user to override if they're set manually.


---

[GitHub] nifi-minifi-cpp pull request #242: MINIFICPP-374: Commit Linux power managem...

Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/242#discussion_r162190115
  
    --- Diff: README.md ---
    @@ -609,6 +609,21 @@ Additionally, a unique hexadecimal uid.minifi.device.segment should be assigned
     	  	class: ControllerServiceClass
     	  	Properties:
     
    +### Linux Power Manager Controller Service
    +  The linux power manager controller service can be configured to monitor the battery level and status ( discharging or charging ) via the following configuration.
    +  Simply provide the capacity path and status path along with your threshold for the trigger and low battery alarm and you can monitor your battery and throttle
    +  the threadpools within MiNiFi C++. Note that the name is identified must be ThreadPoolManager.
    +
    +   Controller Services:
    +    - name: ThreadPoolManager
    +      id: 2438e3c8-015a-1000-79ca-83af40ec1888
    +      class: LinuxPowerManagerService
    +      Properties:
    +          Battery Capacity Path: /path/to/battery/capacity
    +          Battery Status Path: /path/to/battery/status
    --- End diff --
    
    Controller services provide a shared service. In this case the evaluation of information to make a determination of whether or not we should reduce threads. It has been discussed that we can move gathering of this information into a Processor, but then we have to transfer it somewhere. In that flow we need to build logic and feed that to elements such as the thread executor, power management, etc. We would need to create a pipeline of logic that flows beyond the processors into structural elements of MiNiFi C++. This is better suited for a controller service. Controller services, by way of the ControllerServiceProvider, are already designed to be part of the thread pools ( scheduling agents ) amongst other structural components. 
    
    This allows a single shared state to make an informed decision. While I can see the case where we feed the controller service by way of the processor output, we'd have to do so at the cost of incurring FlowFile management ( we could have a single processor, but what's the point of that? ). 


---