Discover apache performance tuning linux, include the articles, news, trends, analysis and practical advice about apache performance tuning linux on alibabacloud.com
cannot be used will use the kernel as the cache of the file system
(5) When more memory is needed, the Linux system uses swap. For example, it requires more memory than the physical memory. It switches the smallest page in the memory from the physical memory to the disk.
(6) Too many exchanges may cause performance problems because the disk is much slower than the physical memory, and it takes time to swit
size of the data, if the number of times, but the small amount of data, in fact, the IO will be very small. If the data is large, the IO data will be highIostat-c 1 2 # View CPU Status Idle less than 70% io pressure is larger, the general reading speed has more wait.Vmstat 2 1 # 2 seconds sampled, 1 times b indicates the number of processes waiting for the resource; WA indicates the percentage of CPU time that IO waits for, higher than 30% when IO pressure is highImprove IO
1. Apache
Download the source code package of Apache for Linux on the following page
Http://www.apache.org/dist/httpd /;
Save to the/home/XX directory. XX is a self-built folder. I created a WJ folder.
command list: Cd/home/WJ tar-zxvf httpd-2.0.54.tar.gz music httpd-2.0.54 apache Cd
1.apache
Download the Apache for Linux source package on the following page
http://www.apache.org/dist/httpd/;
Save to/home/xx directory, XX is a self-built folder, I built a WJ folder.
List of commands:
Cd/home/wj
TAR-ZXVF httpd-2.0.54.tar.gz
MV httpd-2.0.54 Apache
CD Apache
queue for the SYN packet. Default 1024. For heavy-duty servers, it is obviously beneficial to increase this value.can be adjusted to 2048.$/proc/sys/net/ipv4/tcp_retries2TCP failed retransmission, the default value of 15, meaning to focus on 15 times to completely discard. Reduce to 5 to release kernel resources as early as possible .$/proc/sys/net/ipv4/tcp_keepalive_time$/PROC/SYS/NET/IPV4/TCP_KEEPALIVE_INTVL$/proc/sys/net/ipv4/tcp_keepalive_probesThese 3 parameters are related to TCP keepaliv
packets.
1000
2000
/proc/sys/net/core/somaxconn
Defines the length of the maximum listening queue for each port in the system, which is a global parameter.
128
2048
/proc/sys/net/core/optmem_max
Represents the size of the maximum buffer allowed for each socket.
20480
81920
/proc/sys/net/ipv4/tcp_mem
Determine how the TCP stack should reflect memory usage, and each value is in a memory page (usually 4KB). The
Basic linux memory knowledge and related tuning SolutionsMemory is one of the important components in the computer and serves as a bridge to communicate with the CPU. All programs in the computer run in the memory, so the memory performance has a great impact on the computer. Memory is used to temporarily store computing data in the CPU and data exchanged with ex
Find bottlenecksThe system aspect that you are most interested in in metrics should be CPU usage and memory utilization.It is possible that the CPU will not be sufficient to handle the workload even after full tuning, in which case the CPU upgrade is required. Similarly, if the program is running in an environment that does not provide enough memory after tuning, you must increase the memory capacity.If a
Concurrency Performance test
1 Purpose of testing
According to the test results of Apache and Nginx concurrency performance, the advantages and disadvantages of concurrency model are analyzed.
Performance evaluation items include: RPS (number of processing requests per second), CPU utilization, memory usage, maximum co
resources. See Tcp_max_orphans.net.ipv4.tcp_timestamps=0Timestamp , 0 off, 1 on, in (refer to RFC1323The TCP header increases by 12 bytes, about the configuration's impact on time_wait and possible problems: http://huoding.com/2012/01/19/142, timestamps used in some other things, can guard against those forged sequence numbers. A 1G broadband line may re-encounter the old sequence number with out-of-line value (if it was due to the last generation). Timestamp will let it know it's an ' old bag
queues1954[[email protected] ~]# Cat/proc/sys/kernel/msgmax maximum single message queue size, per byte65536Pdflush: Adjust the memory usage space, clear the memory of the chapter page to disk up[[email protected] ~]# Cat/proc/sys/vm/nr_pdflush_threads shows how many Pdflush are currently started by default0[[email protected] ~]# Cat/proc/sys/vm/dirty_background_ratio equivalent to the total memory, chapter page accounted for a large proportion of the beginning of the write-up[[email protected]
platforms, including Win32, OS/2, BeOS, Darwin, Linux, and more. In order to achieve this goal, APR developers must create a series of feature macros (FEATURE MACROS) for those features that cannot be run on all platforms to differentiate between the various platforms. These feature macro definitions are very simple and usually set with the Apr_has_feature parameter:If a platform has this feature, the macro must be set to true, such as
Linux I/O subsystem monitoring and tuning (1)
Linux I/O subsystem optimized
As a server host, the maximum two IO types are:
1. Disk IO
2. Network I/O
This is the most adjusted part.
How is disk I/O implemented?
During memory optimization, we have been talking about caching files on slow devices on disks to the memory to accelerate
few tests, it was found that only set to 1 to effectively protect the DMA zone is not occupied,:(! After setting to 1, the video no longer appears black screen, but other problems occur quickly, because the system available memory is reduced, the memory recovery algorithm is frequently executed, the performance drops sharply.5. Final planSince the total memory of the product is too small and the DMA zone reserved is too large, you need to adjust the
"isanunknownkeyerror:" net.netfilter.nf_ Conntrack_tcp_timeout_fin_wait "Isanunknownkey This error may be that your firewall does not open or automatically handle the loaded module Ip_conntrack not automatically loaded, the solution is two, one is to open the firewall, and the second is to automatically handle the loaded module Ip_conntrackModprobe Nf_conntrackecho "Modprobe nf_conntrack" >>/etc/rc.localOn version 3 and 6.4Error: "Net.bridge.bridge-nf-call-ip6tables" Isan unknown Keyerror: "Net
First, ask for no more framing netfilter!. Although it has some inherent performance loss, but please do not equate iptables and netfilter, if you want to catch the culprit, please speak directly iptables, and not to say netfilter!Iptables really is a weak explosion! Its ipt_do_table is one of the five main culprits, if the rule exceeds 7000, then it is the first (the other culprit is the Nf_conntrack function, they are also netfilter hook). Iptables
. Prior to CentOS 6 The name of this service was syslog.3 "Network: When the system starts, you should consider turning on this service if you want to activate/deactivate each of these interfaces.4 "Crond: This service is used for periodic execution of the system and User configuration of the task plan, have to periodically perform tasks, it is necessary to open.5 Sysstat: is a package that contains a set of tools for detecting system performance and
of conditions # turning off the netfilter will not get the status, causing each request to be checked from beginning to end, affecting performance: # For example, this default rule (usually written in 1th or very forward position):-A input-m State--state established,related-j ACCEPTDisable step1, finishing confirm that the module will not affect the function after closing#1#Find related Modulessudo lsmod | Egrep"Ip_table|iptable|nat|conntrack"#2#kill
of the graph. The performance test steps are the same as the stress tests, and you need to make a few tests by modifying the parameters in the Console menu and finally finding the best option for your Apache server. Press the Apply Change button to save the settings.
The Zend performance Suite is a package that can dramatically improve the efficiency of
dynamic request (that needs the server to perform certain operations to respond to the request), Nginx is inferior to Apache;Experience and feelSince the server was set up, it was found that the more memory was used, the more it was until the database was down and the server had to be restarted. While the time to wait for each visit is particularly long, viewing the network latency is only 500ms, which means that the server is processing the request
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.