GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/894

    Adds SetLimitsCustomizer for centos/rhel

    I tested this with the catalog item:
    ```
    brooklyn.catalog:
      id: my-nginx-node
      itemType: entity
    
      item:
        type: org.apache.brooklyn.entity.proxy.nginx.NginxController
    
        brooklyn.parameters:
        - name: ulimits
          type: java.util.List
          description: |
            Contents to add to the limits config file
          default:
            - "* soft nofile 16384"
            - "* hard nofile 16384"
            - "* soft nproc 16384"
            - "* hard nproc 16384"
     
        brooklyn.config:
          provisioning.properties:
            machineCustomizers:
              - $brooklyn:object:
                  type: io.cloudsoft.amp.cluster.customizer.SetLimitsCustomizer
                  brooklyn.config:
                    contents: $brooklyn:config("ulimits")
    
          nginx.sticky: false
          install.version: 1.12.1
    ```
    I deployed this to aws eu-west-1 using `imageId: eu-west-1/ami-5f76b626` 
(i.e. the official centos marketplace image).
    
    I then checked that the nginx process had the correct "max processes" and 
"max open files":
    ```
    ps aux | grep nginx
    aled     14120  0.0  0.0  43764  1672 ?        Ss   16:26   0:00 nginx: 
master process ./sbin/nginx -p 
/home/users/aled/brooklyn-managed-processes/apps/z810z6e23t/entities/NginxController_c4j33pu7ly/
 -c conf/server.conf
    aled     14241  0.0  0.1  47168  4784 ?        S    16:26   0:00 nginx: 
worker process
    aled     14428  0.0  0.0 112660   972 pts/0    S+   16:27   0:00 grep 
--color=auto nginx
    
    cat /proc/14120/limits 
    Limit                     Soft Limit           Hard Limit           Units   
  
    Max cpu time              unlimited            unlimited            seconds 
  
    Max file size             unlimited            unlimited            bytes   
  
    Max data size             unlimited            unlimited            bytes   
  
    Max stack size            8388608              unlimited            bytes   
  
    Max core file size        0                    unlimited            bytes   
  
    Max resident set          unlimited            unlimited            bytes   
  
    Max processes             16384                16384                
processes 
    Max open files            16384                16384                files   
  
    Max locked memory         65536                65536                bytes   
  
    Max address space         unlimited            unlimited            bytes   
  
    Max file locks            unlimited            unlimited            locks   
  
    Max pending signals       14996                14996                signals 
  
    Max msgqueue size         819200               819200               bytes   
  
    Max nice priority         0                    0                    
    Max realtime priority     0                    0                    
    Max realtime timeout      unlimited            unlimited            us      
  
    ```
    
    I also deployed a similar nginx without the customizer, and confirmed these 
had:
    ```
    Max processes             4096                 14996                
processes 
    Max open files            1024                 4096                 files   
  
    ```

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

    $ git pull https://github.com/aledsage/brooklyn-server 
add-SetLimitsCustomizer

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

    https://github.com/apache/brooklyn-server/pull/894.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 #894
    
----
commit 6ecbbf1b2901fbc25fd58c441c451be28ca173fb
Author: Aled Sage <[email protected]>
Date:   2017-11-13T16:12:29Z

    Adds SetLimitsCustomizer for centos/rhel

----


---

Reply via email to