Roxen.git / server / base_server / global_variables.pike

version» Context lines:

Roxen.git/server/base_server/global_variables.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS. - // $Id: global_variables.pike,v 1.113 2008/09/25 20:40:14 mast Exp $ + // $Id: global_variables.pike,v 1.114 2008/09/29 15:57:33 mast Exp $      // #pragma strict_types   #define DEFVAR mixed...:object   #define BDEFVAR mixed...:object      #define IN_ROXEN   #include <module.h>   inherit "read_config";   inherit "basic_defvar";   #include <version.h>
Roxen.git/server/base_server/global_variables.pike:24:   // are not used. This makes the user-interface clearer and quite a lot   // less clobbered.      private int(0..1) cache_disabled_p() { return !query("cache"); }   private int(0..1) syslog_disabled() { return query("LogA")!="syslog"; }   private int(0..1) ident_disabled_p() { return [int(0..1)]query("default_ident"); }      protected void cdt_changed (Variable.Variable v);   void slow_req_count_changed();   void slow_req_timeout_changed(); + void slow_be_timeout_changed();      #ifdef SNMP_AGENT   private int(0..1) snmp_disabled() { return !query("snmp_agent"); }   private string snmp_get_cif_domain() {    //return(Standards.URI(roxenp()->configurations[0]->get_url()||"http://0.0.0.0")->host);    return("");   }   #endif      // And why put these functions here, you might righfully ask.
Roxen.git/server/base_server/global_variables.pike:634:    set ("slow_req_bt_count", -1);    else if (query ("slow_req_bt_count") < 0)    set ("slow_req_bt_count", 0);    });       v = Variable.TmpInt (    0, 0,    LOCALE(0, "Logging: Dump threads for slow requests"),    LOCALE(0, #"\   <p>This enables a monitor that dumps all the threads in the debug log - whenever any request or background job has been running for more than - a set number of seconds, which is configured with the \"Slow request - timeout\" setting.</p> + whenever any request, background job or the backend thread has been + running for more than a set number of seconds, which is configured + with the \"Slow request timeout\" and \"Slow backend timeout\" + settings.</p>      <p>This setting is a counter: A positive number stops the monitor   after that many thread dumps have been made, -1 enables the monitor   permanently, and zero disables it. Positive numbers aren't persistent,   so will be reset to zero whenever the server is restarted.</p>      <p><b>Warning:</b> If you set the timeout too low, combined with a   high or no limit, then the debug log can fill up very quickly and the   server become very slow due to the amount of logging. If that happens   and it gets difficult to change back the value then you can force the
Roxen.git/server/base_server/global_variables.pike:661:   <p>Enabling this creates a dedicated thread.</p>"));    defvar ("slow_req_bt_count", v);    v->set_range (-1, Variable.no_limit);    v->set_changed_callback (    lambda (Variable.Variable v) {    int count = v->query();    set ("slow_req_bt_permanent", count < 0);   #ifndef NO_SLOW_REQ_BT    slow_req_count_changed();   #else -  v->set_warning ( -  LOCALE(0, "Feature disabled by NO_SLOW_REQ_BT define.")); +  v->set_warning (LOCALE(0, "Feature disabled by NO_SLOW_REQ_BT define."));   #endif    });       v = defvar ("slow_req_bt_timeout", 10.0,    LOCALE(0, "Logging: Slow request timeout"),    TYPE_FLOAT,    LOCALE(0, #"\ - <p>The timeout in seconds for the slow request monitor. See the \"Dump - threads for slow requests\" setting for details.</p>")); -  v->set_range (1e-3, Variable.no_limit); + <p>The timeout in seconds for requests or background jobs to trig a + thread dump. Zero disables monitoring of those. See the \"Dump threads + for slow requests\" setting for details.</p>")); +  v->set_range (0.0, Variable.no_limit);    v->set_precision (3);   #ifndef NO_SLOW_REQ_BT    v->set_changed_callback (lambda (Variable.Variable v) {    slow_req_timeout_changed();    });   #endif    -  +  v = defvar ("slow_be_bt_timeout", 0.05, +  LOCALE(0, "Logging: Slow backend timeout"), +  TYPE_FLOAT, +  LOCALE(0, #"\ + <p>The timeout in seconds for the backend thread to trig a thread + dump. Zero disables monitoring of it. See the \"Dump threads for slow + requests\" setting for details.</p> +  + <p>The backend thread is a special thread that manages most I/O and + directs the incoming requests to the handler threads. It should never + be occupied for a significant amount of time since that would make the + server essentially unresponsive. Therefore this timeout should be + small.</p> +  + <p>Note that a good value for this is very dependent on hardware. The + default setting here is conservative and probably should be lowered to + be of real use.</p>")); +  v->set_range (0.0, Variable.no_limit); +  v->set_precision (3); + #ifndef NO_SLOW_REQ_BT +  v->set_changed_callback (lambda (Variable.Variable v) { +  slow_be_timeout_changed(); +  }); + #endif +    #ifdef THREADS    defvar("numthreads", 15, LOCALE(150, "Number of threads to run"),    TYPE_INT,    LOCALE(151, "The number of simultaneous threads Roxen will use.\n"    "<p>Please note that even if this is one, Roxen will still "    "be able to serve multiple requests, using a select loop based "    "system.\n"    "<i>This is quite useful if you have more than one CPU in "    "your machine, or if you have a lot of slow NFS accesses.</i></p>"    "<p>Do not increase this over 20 unless you have a "