May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

kernel tuning Apache performance

Source:

Here all of the website is an example kernel tuning for improved performance. Try one of those boring study. (Actually, I do not know) I’m just the only data is transferred.

References
http://www.apache.org/docs/misc/perf-tuning.html
web performance tunning – O’Reilly

Keep in mind, however, have some points. In order to improve website performance, rather than the kernel only sondaejuneun OS, networking, programming, etc. that will be considered as a variety of conditions. In addition, blindly without consideration of the performance of the hardware change is to have problems. Services are also generally not an issue in static html, but where performance bottlenecks occur unless the network is often cgi one. Contained in the Apache ab, unix time, ping, netstat, and always use a variety of commands to try to monitor the status of the system will need to take your speed. In addition, the tuning at best, no matter how incredibly to put an image on a web page dundamyeon haneungeot yijiyo vain. As I do not know that eoseolkeuge haetdeoni Oracle tuning cpu 4 dogs, 2G of memory in the system rather than a traditional PC slower deogunyo Oracle. If you are not familiar even better to use the default itjiyo. For example, large sites such as keepalive option below if you have to lay off a lot better if you can. Quick as soon as the connection process and nothing is lost without bothering to put up just making fun of the process rather than anger.

? Apache Web Server Tuning

The tuning of the Apache web server can be briefly divided into two parts. The first is hard-coded into the source code to adjust the limit value, and second, the configuration file is to modify the limit values of each.

1) source-level
HARD_SERVER_LIMIT httpd.h, in the case of Linux, the default value is set to 256 and the server can accept this value implies a connection. This value is set to 1280.

2) the configuration file
A. KeepAliveTimeout
If the client contacts the server to connect to a Web server processes the transmission of multiple objects of the Web page without creating a new process while maintaining continuous connectivity is responsible for the client’s request for a timeout value . Base increased to 30 seconds from 15 seconds.
Or. MaxKeepAliveRequests
Web server process, while maintaining continuous connectivity is the number of requests that can be processed.
Set to 100 and increased to 10000.
All. StartServer, Min / MaxSpareServer
The default setting is 5, 5, 10 or so, and if the new connection to the Web server receives a request Standalone bangsikil existing Spare Child Process Child Process to create a new fork, so basically I Spare Process, the more quickly you can deal with congestion . StartServer 20, MinSpareServer 20, MaxSpareServer 40 increases.
(D) MaxRequestsPerChild
Web server processes to handle client requests a certain number of figures is terminated, and increased to 1000.
E. MaxClients
That can be run concurrently and to limit the maximum number of processes, the default is set to 256. This increased to 512.
Bar. The creation of log files
Users that are logged every time you connect once jeopsokdang access_log files, increasing approximately 85 bytes, and if there are a large number of hits, the size of this file is actually enormous. In this case, whenever access to the log file and load it takes considerable time to access the log files at regular intervals initialized by the need to always have a lighter. Provided by Apache using rotatelog.

Soft-level tuning ?keoneol

The kernel parameter values that provides the / proc file system using the boot is completed, the time change after. This mainly related to the file system and network resources are tuned for the content.

1) The file system-related
– Linux kernel maximum number of files that can be assigned: 4096 -> 32768
– Linux kernel can allocate the maximum number of inode number: 16384 -> 65536
– Root for the user to allocate the maximum number of files: 1024 -> 32768
– A process that can be open at the number of files: 256 -> 512

2) related to network resources
– TCP Keep Alive message to the sending time intervals: 7200 -> 1200
– Final FIN before the socket is always time to wait for a CLOSE: 180 -> 30
– TCP connection requests for a response to the retransmission count: 7 -> 2

This setup your system boots, the values should be set through a script, because the / etc / rc.d / rc.local file is defined at the end of.

? hard kernel-level tuning

By directly modifying the kernel source to adjust the limit. To do this, it is essential to compile the kernel, cautious approach is needed.

– The number of files open
– The number of processes that can handle

Note **

A. Apache Web Server Tuning
– Apache / src / include / httpd.h:
HARD_SERVER_LIMIT 256 -> 1280
– Apache / conf / httpd.conf:
MaxKeepAliveRequests 100 -> 10000
KeepAliveTimeout 15 -> 30
MinSpareServers 5 -> 20
MaxSpareServers 10 -> 40
StartServers 5 -> 20
MaxClients 256 -> 1024

Two. Tuning the kernel level software
– Ulimit-n 32768
– / Proc / sys / fs / file-max: 4096 -> 32768
– / Proc / sys / fs / inode-max: 16384 -> 65536
– / Proc/sys/net/ipv4/tcp_keepalive_time: 7200 -> 1200
– / Proc/sys/net/ipv4/tcp_fin_timeout: 180 -> 30
– / Proc/sys/net/ipv4/tcp_sack: 1 -> 0
– / Proc/sys/net/ipv4/tcp_timestamps: 1 -> 0
– / Proc/sys/net/ipv4/tcp_syncookies: 0 -> 1
– / Proc/sys/net/ipv4/tcp_retries1: 7 -> 2
– / Proc/sys/net/ipv4/tcp_max_syn_backlog: 128 -> 8192
– / Proc/sys/net/ipv4/tcp_window_scaling: 1 -> 0

Three. Hard kernel-level tuning
– / Usr / src / linux / include / linux / fs.h:
NR_FILE 4096 -> 32768
INR_OPEN 1024 -> 32767
– / Usr / src / linux / include / linux / tasks.h:
NR_TASKS 2560 -> 3192
MAX_TASKS_PER_USER 2048 -> 3192
– / Usr / src / linux / include / linux / limits.h:
NR_OPEN 1024 -> 32767
– / Usr / src / linux / include / net / tcp.h:
TCP_TIMEWAIT_LEN (60 * HZ) -> (15 * HZ)

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>