{"id":895,"date":"2012-08-02T15:30:29","date_gmt":"2012-08-02T07:30:29","guid":{"rendered":"http:\/\/rmohan.com\/?p=895"},"modified":"2012-08-02T15:30:29","modified_gmt":"2012-08-02T07:30:29","slug":"kernel-tuning-apache-performance","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=895","title":{"rendered":"kernel tuning Apache performance"},"content":{"rendered":"<p>Source:<\/p>\n<p>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&#8217;m just the only data is transferred.<\/p>\n<p>References<br \/>\nhttp:\/\/www.apache.org\/docs\/misc\/perf-tuning.html<br \/>\nweb performance tunning &#8211; O&#8217;Reilly<\/p>\n<p>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.<\/p>\n<p>? Apache Web Server Tuning<\/p>\n<p>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.<\/p>\n<p>1) source-level<br \/>\nHARD_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.<\/p>\n<p>2) the configuration file<br \/>\nA. KeepAliveTimeout<br \/>\nIf 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&#8217;s request for a timeout value . Base increased to 30 seconds from 15 seconds.<br \/>\nOr. MaxKeepAliveRequests<br \/>\nWeb server process, while maintaining continuous connectivity is the number of requests that can be processed.<br \/>\nSet to 100 and increased to 10000.<br \/>\nAll. StartServer, Min \/ MaxSpareServer<br \/>\nThe 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.<br \/>\n(D) MaxRequestsPerChild<br \/>\nWeb server processes to handle client requests a certain number of figures is terminated, and increased to 1000.<br \/>\nE. MaxClients<br \/>\nThat can be run concurrently and to limit the maximum number of processes, the default is set to 256. This increased to 512.<br \/>\nBar. The creation of log files<br \/>\nUsers 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.<\/p>\n<p>Soft-level tuning ?keoneol<\/p>\n<p>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.<\/p>\n<p>1) The file system-related<br \/>\n&#8211; Linux kernel maximum number of files that can be assigned: 4096 -&gt; 32768<br \/>\n&#8211; Linux kernel can allocate the maximum number of inode number: 16384 -&gt; 65536<br \/>\n&#8211; Root for the user to allocate the maximum number of files: 1024 -&gt; 32768<br \/>\n&#8211; A process that can be open at the number of files: 256 -&gt; 512<\/p>\n<p>2) related to network resources<br \/>\n&#8211; TCP Keep Alive message to the sending time intervals: 7200 -&gt; 1200<br \/>\n&#8211; Final FIN before the socket is always time to wait for a CLOSE: 180 -&gt; 30<br \/>\n&#8211; TCP connection requests for a response to the retransmission count: 7 -&gt; 2<\/p>\n<p>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.<\/p>\n<p>? hard kernel-level tuning<\/p>\n<p>By directly modifying the kernel source to adjust the limit. To do this, it is essential to compile the kernel, cautious approach is needed.<\/p>\n<p>&#8211; The number of files open<br \/>\n&#8211; The number of processes that can handle<\/p>\n<p>Note **<\/p>\n<p>A. Apache Web Server Tuning<br \/>\n&#8211; Apache \/ src \/ include \/ httpd.h:<br \/>\nHARD_SERVER_LIMIT 256 -&gt; 1280<br \/>\n&#8211; Apache \/ conf \/ httpd.conf:<br \/>\nMaxKeepAliveRequests 100 -&gt; 10000<br \/>\nKeepAliveTimeout 15 -&gt; 30<br \/>\nMinSpareServers 5 -&gt; 20<br \/>\nMaxSpareServers 10 -&gt; 40<br \/>\nStartServers 5 -&gt; 20<br \/>\nMaxClients 256 -&gt; 1024<\/p>\n<p>Two. Tuning the kernel level software<br \/>\n&#8211; Ulimit-n 32768<br \/>\n&#8211; \/ Proc \/ sys \/ fs \/ file-max: 4096 -&gt; 32768<br \/>\n&#8211; \/ Proc \/ sys \/ fs \/ inode-max: 16384 -&gt; 65536<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_keepalive_time: 7200 -&gt; 1200<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_fin_timeout: 180 -&gt; 30<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_sack: 1 -&gt; 0<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_timestamps: 1 -&gt; 0<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_syncookies: 0 -&gt; 1<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_retries1: 7 -&gt; 2<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_max_syn_backlog: 128 -&gt; 8192<br \/>\n&#8211; \/ Proc\/sys\/net\/ipv4\/tcp_window_scaling: 1 -&gt; 0<\/p>\n<p>Three. Hard kernel-level tuning<br \/>\n&#8211; \/ Usr \/ src \/ linux \/ include \/ linux \/ fs.h:<br \/>\nNR_FILE 4096 -&gt; 32768<br \/>\nINR_OPEN 1024 -&gt; 32767<br \/>\n&#8211; \/ Usr \/ src \/ linux \/ include \/ linux \/ tasks.h:<br \/>\nNR_TASKS 2560 -&gt; 3192<br \/>\nMAX_TASKS_PER_USER 2048 -&gt; 3192<br \/>\n&#8211; \/ Usr \/ src \/ linux \/ include \/ linux \/ limits.h:<br \/>\nNR_OPEN 1024 -&gt; 32767<br \/>\n&#8211; \/ Usr \/ src \/ linux \/ include \/ net \/ tcp.h:<br \/>\nTCP_TIMEWAIT_LEN (60 * HZ) -&gt; (15 * HZ)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source:<\/p>\n<p>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&#8217;m just the only data is transferred.<\/p>\n<p>References http:\/\/www.apache.org\/docs\/misc\/perf-tuning.html web performance tunning &#8211; O&#8217;Reilly<\/p>\n<p>Keep in mind, however, have some points. In order to improve website performance, rather than the [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/895"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=895"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/895\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/895\/revisions\/897"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}