6

I know Linux is built for multi-user / concurrent-process, but at the corporate level, many of them are used for single (but big) applications to support an internal service, of which serving only very few clients.

In such a use case, how should we tune the system or kernel (specifically Red Hat Linux, Fedora, CentOS) to optimize for the scenario? To minimize latency, reducing context-switch, with very few local disk I/O.

The session length could be persistent (as the number of client are just a few), data size interchange is small, but very frequent, like 1k to 2k of message per second, size from 40 to 100 byte.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
steveoreo
  • 61
  • 2
  • Can you tell us a bit more about the expected session lengths and type of data being transmitted (lots of little requests, a few big requests, mostly Tx or mostly Rx, etc.) – Joseph Kern Jun 14 '15 at 10:56

1 Answers1

6

Performance tuning is as much a black art as it is a science. Complete books have been written about it, include quite a bit as part of the vendor documentation

You start with good monitoring, add load, get a baseline and only then you start adjusting and observing if your adjustment did or did not have the intended result.
Rinse and repeat until you get the optimal result.

You don't mention your major RHEL or CentOS release but they all include automatic tuning as well, with for instance the tuned daemon. Predefined performance profiles can be selected from tuned-adm list and then activated with tune-adm profile <profile-name>.

For your use-case the RHEL 7 profile latency-performance sounds like the one you might benefit from:

latency-performance A server profile focused on lowering latency. This profile is recommended for latency-sensitive workloads that benefit from c-state tuning and the increased TLB efficiency of transparent huge pages. This profile favors performance over power savings by setting intel_pstate and max_perf_pct=100. It enables transparent huge pages, uses cpupower to set the performance cpufreq governor, and requests a cpu_dma_latency value of 1.

For more general Linux tuning Brandan Gregg has made a number of visual diagrams of which tool to use on what part of your system that make really nice cheat sheets:

Tools:

Performance Observability

Which options to use in sar to monitor:

<code>sar</code> options

And closely related:

Linux Benchmarking Tools

Translate observations into tuning with:

tuning tools

HBruijn
  • 72,524
  • 21
  • 127
  • 192