the head, this can be set according to your system paging size, generally a request header size will not exceed 1k, but because the general system paging is greater than 1k, so this is set to paging size. The paging size can be obtained with the command getconf pagesize.
Open_file_cache max=102400 inactive=20s;
This will specify the cache for the open file, which is not enabled by default, max Specifies th
example, when the PHP environment is not configured, Nginx is not resolved, at this time, the browser to access the PHP file will appear in the Download window.
The following code implements the setting of the log format:
12345678
Log_format Main ' $remote _addr-$remote _user [$time _local] "" $request "$status $bytes _sent" "$http _referer" "$http _ User_agent "" "$gzip _ratio" '; Log_format download ' $remote _addr-$remote _user [$time _local] "$request" $status $bytes
your Nginx version. if not, you only need to add autoindex off in the location block of the configuration file.
4. disable ssi (server-side reference) on the server ). You can add ssi off in the location block ;. (Script school www.jbxue.com)
5. disable the server tag. If it is enabled (by default), all error pages will display the server version and information. Add the server_tokens off; declaration to the Nginx configuration file to solve this problem.
6. set custom cache in the configuratio
The following form rules are available:
/index.php?m=searchc=indexs=1t=1k= keywords
You want to forward the path to a pseudo-static form
/search?s=1t=1k= keywords
Only one parameter value can be obtained using the following methodRewritecond%{query_string} ^k= (. +) $Rewriterule ^search$/index.php?m=searchc=index...k=%1
If you use the following method to get multiple parameters, the order of the parameters
960992 105415 855577 11%/
Tmpfs 63946 1 63945 1%/dev/shm
Filesystem 1K-blocks Used Available Use % Mounted on
/Dev/sda1 15118728 2747612 11603116 20%/
Tmpfs 255784 0 255784 0%/dev/shm
The preceding command allows you to view the number of blocks and inode changes in the system in real time.
We recommend that you do not use the deumpe2fs and tune2fs commands. if you use them to view them, it will be very depressing-you will find that no matter how you
Nginx Gzip Compression ConfigurationWith the development of Nginx, more and more websites use Nginx, so nginx optimization becomes more and more important, today we look at Nginx gzip compression in the end is how to compress it?Gzip (Gnu-zip) is a compression technique. After gzip compression, the page size can be changed to 30% or smaller, so users can browse the page at a much faster speed. Gzip Compression page requires both browser and server support, in fact, server-side compression, uploa
5 16:47 testfile
976-rw-r-. 2 root 0 Apr 5 16:47 testfile. hard
978 lrwxrwxrwx. 1 root 8 Apr 5 testfile. soft-> testfile
After checking the properties of the file and directory, we can find that after creating a hard link, the inode count of testfile is added. In addition, the Inode numbers testfile and testfile. hard are the same. This hard link re-creates a file name corresponding to the Inode of the original file. In essence, a new ing is added to Directory. In this example, do you know more
caused the memory growth is not small. So I feel that life is not the direction, and then suspect that the file cache has taken up virtual memory, commented out the code of all read and write log code, virtual memory is still increasing, excluding this possibility.
2. An epiphany
Later, I began to reduce the number of thread to start testing, when the test accidentally found a very strange phenomenon. That is, if a process creates a thread and allocates a very small amount of
Find all 7 days before the log end of/xusx and move files larger than 10k to/tmpThe first step[[email protected] xusx]# Find/-type f-name "*.log"-mtime +7-size +1k./d.log./passwd.logView time:[[Email protected] ~]# DateMonday, October 10, 2016 01:21:07 CSTStep Two[[email protected] xusx]# Find/-type f-name "*.log"-mtime +7-size +1k-exec MV {}/tmp \;-mtime +7 (7 days ago)-size +
*worker_connections per nginx server.6. Keepalive_timeout60;KeepAlive time-out period.7. client_header_buffer_size4k;Client request the buffer size of the head, this can be set according to your system paging size, generally a request header size will not exceed 1k, but because the general system paging is greater than 1k, so this is set to paging size.The paging size can be obtained with the command getcon
if the SendMail service is installed.cenos5.8 is installed by default sendmail,centos6.6 is not sendmail by default.Block related knowledge:1) The disk read data is read by block.2) A file may occupy more than one block and consumes disk I/O once per block read.3) If you want to improve disk IO performance, then try to4) A block can only hold the contents of a single file, regardless of the size inside. If block 4 K, that store 1K of files, the remai
1.{} and there is a space between2.find. There are also spaces between-name3.exec is a follow-up command, and the contents of {} represent the files found earlierHow to bulk delete empty files (Files of size equal to 0) under LinuxFind " * " Xargs 1 RM -FYou can also delete a file of the specified size, as long as you modify the corresponding-size parameter, for example:Find " * " Xargs 1 RM -Fis to delete files of 1k size. (but be careful not to use-
du Introduction to Commands: Calculate the disk usage for each file, and the directory will take the total amount.1 . Command format:Usage: du [options] ... [File] ...Or: du [options] ...--files0-from=f2 . Command function:Calculate the disk usage for each file, and the directory will take the total amount.3 . Command parameters:-A, --all The disk usage of all files, not just the directory--apparent-size Displays surface dosage, not disk usage, although surface dosage is usuallySmaller, bu
parameter, for example:The code is as follows Find. -name "*"-type f-size 1024c | Xargs-n 1 rm-fis to delete files of 1k size. ( but be careful not to use -size 1k, this gets to occupy space 1k, not file size 1k ).If you just delete the folder or the name of the connection, you can change the -type parameters, specif
malloc () Request memory, free () frees memory, because memcached based on memory data management, usually its cache data is relatively large, so it will cause memcached frequently to Linux (Kernel) to initiate applications, Release of the request, while the performance of the Linux malloc () and free () is inefficient, in order to solve this problem, memached based on the slab allocator mechanism to request and release the data.On the mechanism of slab allocator, memcached apply for a Memory p
", Sendbuflen);Sendbuflen = 10240;SetSockOpt (Clientsocket, Sol_socket, So_sndbuf, (void*) sendbuflen, Len);GetSockOpt (Clientsocket, Sol_socket, So_sndbuf, (void*) sendbuflen, len);printf ("now,sendbuf:%d\n", Sendbuflen);It is important to note that although the send cache is set to 10k, in fact, the stack expands it by 1 time times and sets it to 20k.-------------------Instance Analysis---------------In real-world applications, if the sender is non-blocking, due to network congestion or slow p
-may-2010) inodesize: 256[[emailprotected]~]#dumpe2fs/dev/sda1|grep-i "Inode size "dumpe2fs1.41.12 (17-may-2010) inodesize: 128[[emailprotected]~]#df-hFilesystem SizeUsedAvailUse%Mountedon/dev/sda3 9.2G5.0G3.7G58%/tmpfs 242m0242m0% /dev/shm/dev/sda1194m29m155m 16%/bootMy system is CentOS 6.5, as you can see, the default inode size for the/boot partition is still 128, and the root partition (regular partition) is 256.4. Size of blockIn ext3 or EXT4 file systems, the block size is generally
Inode/block. the Inode record block number region is defined as 12 direct, 1 indirect, 1 double indirect, 1 three indirectly. What do you mean? 12 directly referred to by the inode point to the 12 blocks directly used to record the file data, 1 indirectly refers to the Inode pointed to the block is not directly stored in the file data, instead of the block stored in the other block number, These block numbers correspond to blocks where the actual file data is stored. If it's double-indirect, t
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.