@@ -310,6 +310,71 @@ sudoers file:
310310 cloudstack ALL=NOPASSWD: /usr/bin/cloudstack-setup-agent
311311 Defaults:cloudstack !requiretty
312312
313+ Limit Resources For the Agent Service
314+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
315+
316+ #. Edit the cloudstack-agent.service file at:
317+
318+ .. code :: bash
319+
320+ /usr/lib/systemd/system/cloudstack-agent.service
321+
322+ #. You can set the following resource controls in the cloudstack-agent service:
323+
324+ - Limit the number of file descriptors
325+
326+ Default configuration is usually higher, set to lower number explicitly when required. It is observed
327+ that the average FDs for a host with 40 VMs was 380, we can reserve +20% based on the requirement.
328+
329+ Example:
330+ .. code :: bash
331+
332+ LimitNOFILE=1500
333+
334+ - Limit the memory usage
335+
336+ You can limit the memory usage. For example, set to 2500MB (2500 * 1024 * 1024 bytes) as shown below.
337+
338+ .. code :: bash
339+
340+ MemoryMax=2500M
341+
342+ - Limit the CPU quota
343+
344+ You can control the CPU allocation. For example,set to allow 2 full cores worth of CPU time as shown below.
345+
346+ .. code :: bash
347+
348+ CPUQuota=200%
349+
350+ #. Reload and restart the cloudstack-agent service after changing any of the controls:
351+
352+ .. code :: bash
353+
354+ sudo systemctl daemon-reload
355+ sudo systemctl restart cloudstack-agent
356+
357+
358+ Disable Omit Stack Trace
359+ ^^^^^^^^^^^^^^^^^^^^^^^^
360+
361+ JVM by default stop printing some stack traces in the logs. To enable print stack traces always:
362+
363+ #. Edit the cloudstack-agent.service configuration file at:
364+
365+ .. code :: bash
366+
367+ /etc/default/cloudstack-agent
368+
369+ #. Add the command-line parameter -XX:-OmitStackTraceInFastThrow to disable omit stack trace flag in JVM so that all
370+ the stack traces are always printed on the logs. This flag is enabled by default in JVM to omit the stack traces
371+ for certain exceptions that are thrown frequently. Printing of the stack traces might impact performance, and is not
372+ recommended for production, so it's better to disable this flag for troubleshooting or debugging purposes when required.
373+
374+ .. code :: bash
375+
376+ JAVA_OPTS=" ... -XX:-OmitStackTraceInFastThrow"
377+
313378
314379 Configure CPU model for KVM guest (Optional)
315380^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments