Community Services Infrastructure Standards


Community Services Infrastructure Standards
1. CSI Introduction
1.1. Introduction
1.2. What to do
1.3. External Sources and References
2. Language and Terms
2.1. Introduction
2.2. External Sources and References
Web Services
1. ERROR
2. Introduction
2.1. About something
2.2. Prerequisites
2.3. Performance Tuning Introduction
2.3.1. httpd config settings
2.4. External Sources and References
3. ERROR

Community Services Infrastructure Standards



Chapter 1. CSI Introduction

1.1. Introduction

The Community Services Infrastructure standards or CSI standards are a group of documents designed to be implemented by the biggest set of technology users in the world. They focus entirely around Red Hat compatable operating systems (Red Hat Enterprise Linux, Fedora, and CentOS for example). Unlike most documentation, CSI aims to be standards based. Often checklists can be printed up and checked off one by one to ensure compliance. There are three typical target audiences. Administrators, end users and management / legal.
CSI is developed using open source methods. Any changes or suggestions should be directed to the CSI mailing list. Any questions regarding details on how to implement these changes or why should be directed to fedora-infrastructure-list@redhat.com.

1.2. What to do

You have been directed to read this document because it contains instructions and steps that you are now expected to follow. Read through the items below and make note of any confusing or less then clear steps. It is important that each step is followed carefully. Do not assume something is done just because it might be right. It is recommended to print up a copy of these checklists and mark off each one as they are completed. Should a time come that an item becomes uncomplaint, make note of that and work to become compliant once again.

Web Services



Chapter 1. ERROR

Chapter 2. Introduction

Mike McGrath

Fedora Infrastructure Team Lead
Fedora Project
Apache is the defacto standard in web servers. CSI focuses on using it whever possible.

2.1. About something

A little something about something.
Second para.

2.2. Prerequisites

The following things are needed for something:

2.3. Performance Tuning Introduction

Apache is the type of application that, during its lifetime as an application, can do the same thing millions of times over and over again. The result is that apache is an ideal application for tuning. When done properly tuning is as much science as it can be though its not perfect. This imperfection is where a skilled admin can make educated guesses. This art comes from things like not knowing when someone will /. you, or how many people will actually respond to the last mass mailing that was sent out.
This standard focuses not on getting every last drop out of a host until it crashes. Instead this standard focuses on setting values to a known max utilization. Once this utilization is hit, users will start to experience timeouts and slow connects or connection refused messages. Even at this fully utilized state the box will remain responsive. This has a few key benefits over letting the box get completely consumed and exiting on its own. The first of which is that administrators can still log in and examine the box while it is fully utilized allowing them to determine if something is configured incorrectly or if the number of resources assigned to this server are incorrect (for example, it needs more memory). The second advantage is that the box stays up and does continue to serve requests. The alternative is a box completely crashing turning all users away immediately. The theory being its better to have slow responses for a while then no responses for a while. It also gives the box better odds to recover from the load spike on its own.

2.3.1. httpd config settings

This section focuses on settings in /etc/httpd/conf/httpd.conf.

2.3.1.1. MaxClients - ServerLimit

MaxClients - Maximum number of simultaneous requests that will be served
ServerLimit - Upper limit on configurable number of processes
2.3.1.1.1. Usable Ram
To determine the proper values for MaxClients and ServerLimit first you need to understand that we're trying to limit MaxClients and MaxServers based on some given amount of memory. According to the Apache docs “The single biggest hardware issue affecting webserver performance is RAM.” The easiest way to determine usable ram is to stop httpd, then find how much free memory there is on the host excluding buffers. This value can be determined by free | awk '/buffers\/cache/ { print $4 }' This value is in kilobytes.
2.3.1.1.2. Buffer Size
We don't want apache to just take up whatever free memory there is because this would leave no room for buffers. Generally we'll leave 15% of UsableRam for buffers.
UsableRam * .15
Equation 2.1. BufferSize

.

Note

For many servers that don't do much disk IO you can leave less, like 10% (Like those servers reading and writing most of their information to a database. For servers that do a great deal of disk IO it is best to leave this a bit higher, at 20% or more.
2.3.1.1.3. Apache Ram
ApacheRam is the amount of ram we're going to target for Apache use.
UsableRam - BufferSize
Equation 2.2. ApacheRam

2.3.1.1.4. Average Httpd Size
Every httpd process takes up a certain amount of ram. Some of this memory is in shared memory, some of it is unique to each httpd process. To determine average httpd size we look at the size of each httpd process minus the shared memory size. To determine this size run echo $(($(for f in `pgrep httpd`; do awk '/Rss/ { rss+=$2 } /Shared/ { shared+=$2 } END { print rss-shared }' /proc/$f/smaps 2> /dev/null; done | awk '{ s+=$1 } END { print s }') / $(pgrep httpd | wc -l)))

Note

If stability is more important to you then performance. Add an additional 10% to this number.
AverageHttpdSize * 1.1
Equation 2.3. AverageHttpdSize

2.3.1.1.5. MaxClients
To determine how high to set MaxClients in the actual httpd.conf file use the ApacheRam size and divide it by AverageHttpdSize.
ApacheRam / AverageHttpdSize
Equation 2.4. MaxClients

2.3.1.1.6. ServerLimit
ServerLimit is more like a hard limit to MaxClients. This should be about 1% higher then MaxClients.
MaxClients * 1.1
Equation 2.5. ServerLimit

2.4. External Sources and References

Chapter 3. ERROR