On Wed, Sep 21, 2011 at 8:06 AM,  sauer wrote:
>
>  Any suggestions?  Having to restart the process daily is a tad inconvenient.

Until you get this resolved, I suggest you configure cf-agent to
restart cf-monitord if cf-monitord's memory exceeds a certain
threshold.

Here is a related example I use in my 3 day course:

[cfengine00  practical_examples]# more
2840_Process_Selection._Graceful_restart_of_bloated_apache_httpd.cf
# Scenario: you have a memory leak in your Web app
# that causes "bloat" in httpd processes.
#
# Issue a graceful restart command to the httpd
# if any apache httpd processes exceed vsize limit
# (vsize = total Virtual Memory size in kb).

bundle agent example {

    processes:

         ".*"

             process_select  => vsize_exceeds("apache", "httpd", "30000"),
             process_count => set_class("big_apache_httpd_procs");

    commands:
        big_apache_httpd_procs::
             "/usr/sbin/httpd -k graceful";


}

########################################################

body process_select vsize_exceeds(process_owner, command, vsize_limit) {

    process_owner => { "apache" };  # username of process owner

    command => "/usr/sbin/httpd.*";  # username of process owner

    vsize => irange("$(vsize_limit)","inf"); # vsize is over
                                             # $(vsize_limit)
    process_result => "process_owner&command&vsize";
}

########################################################

body process_count set_class(classname)

{
match_range => "1,inf"; # Integer range for acceptable number of
matches for this process
                      # (In this case, one or more processes


in_range_define => { "$(classname)" }; # List of classes to define if
the matches are in range.

}

[cfengine00  practical_examples]#
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to