delayed until the threshold is reached. A value of zero restores the initial
setting.
-set profiling { tasks } { auto | on | off }
- Enables or disables CPU profiling for the indicated subsystem. This is
- equivalent to setting or clearing the "profiling" settings in the "global"
+set profiling { tasks | memory } { auto | on | off }
+ Enables or disables CPU or memory profiling for the indicated subsystem. This
+ is equivalent to setting or clearing the "profiling" settings in the "global"
section of the configuration file. Please also see "show profiling". Note
that manually setting the tasks profiling to "on" automatically resets the
scheduler statistics, thus allows to check activity over a given interval.
+ The memory profiling is limited to certain operating systems (known to work
+ on the linux-glibc target), and requires USE_MEMORY_PROFILING to be set at
+ compile time.
set rate-limit connections global <value>
Change the process-wide connection rate limit, which is set by the global
if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
return 1;
+ if (strcmp(args[2], "memory") == 0) {
+ return cli_err(appctx, "Memory profiling not compiled in.\n");
+ }
+
if (strcmp(args[2], "tasks") != 0)
- return cli_err(appctx, "Expects 'tasks'.\n");
+ return cli_err(appctx, "Expects etiher 'tasks' or 'memory'.\n");
if (strcmp(args[3], "on") == 0) {
unsigned int old = profiling;
qsort(tmp_activity, 256, sizeof(tmp_activity[0]), cmp_sched_activity);
chunk_printf(&trash,
- "Per-task CPU profiling : %s # set profiling tasks {on|auto|off}\n",
- str);
+ "Per-task CPU profiling : %-8s # set profiling tasks {on|auto|off}\n"
+ "Memory usage profiling : %-8s # set profiling memory {on|off}\n",
+ str, (profiling & HA_PROF_MEMORY) ? "on" : "off");
chunk_appendf(&trash, "Tasks activity:\n"
" function calls cpu_tot cpu_avg lat_tot lat_avg\n");
static struct cli_kw_list cli_kws = {{ },{
{ { "show", "profiling", NULL }, "show profiling : show CPU profiling options", NULL, cli_io_handler_show_profiling, NULL },
{ { "show", "tasks", NULL }, "show tasks : show running tasks", NULL, cli_io_handler_show_tasks, NULL },
- { { "set", "profiling", NULL }, "set profiling : enable/disable CPU profiling", cli_parse_set_profiling, NULL },
+ { { "set", "profiling", NULL }, "set profiling : enable/disable resource profiling", cli_parse_set_profiling, NULL },
{{},}
}};