Two machines are mainly used to run Nginx and PHP, the memory is 8G and 4G, a period of time after the output of the free command cached values will be more and more large,
Self-search a few laps later learned that cached is mainly responsible for cache file use, log file too large cause cached area memory increase memory occupied.
Buffer and cache in free: (They are all memory-intensive):
Buffer: Memory as buffer cache, which is the read and write buffer of the block device
Cache: As the page cache memory, the file system cache
If the cache has a large value, it indicates that the cache has a high number of files.
But there are still two questions:
1. What does the memory usage (cached occupancy) of the two machine used to run PHP have to do with the number of PHP requests? For example, these two stations, is not the number of visits, the cached value will be greater?
2. Does the sync command, after writing the cached to disk, have any impact on subsequent access?
I rookie, please the big God pointing ...
Reply content:
Two machines are mainly used to run Nginx and PHP, the memory is 8G and 4G, a period of time after the output of the free command cached values will be more and more large,
Self-search a few laps later learned that cached is mainly responsible for cache file use, log file too large cause cached area memory increase memory occupied.
Buffer and cache in free: (They are all memory-intensive):
Buffer: Memory as buffer cache, which is the read and write buffer of the block device
Cache: As the page cache memory, the file system cache
If the cache has a large value, it indicates that the cache has a high number of files.
But there are still two questions:
1. What does the memory usage (cached occupancy) of the two machine used to run PHP have to do with the number of PHP requests? For example, these two stations, is not the number of visits, the cached value will be greater?
2. Does the sync command, after writing the cached to disk, have any impact on subsequent access?
I rookie, please the big God pointing ...
Where is it too big? Cached and buffers occupy the majority of the available part is normal. You say your memory, free is useless, but you think those parts do not need to power, refresh it?
Cached usually belongs to the available section (which is provided after the data 3.14 kernel, and procps-ng is also shown in newer versions), which is available memory . When the program needs to be used, when to take it. Not needed for the moment? Then I'm going to keep the data from the slow-to-dead guy in the disk, which means the user has to use it.
Interested to be able to echo 3 to what file to /proc/sys/vm/drop_caches
clear these parts, and then Ls/usr/lib try. And then execute it again immediately, is there a cache after it is much faster?
As for the sync command. It's about cached, but it's not what you think it is. Its function is to write the dirty page back to the disk, that is, the modified data is not written to the disk data written to disk. Because the kernel delays commits, it accumulates more data per commit to increase efficiency and reduce latency. No need to use, will only let the system card a bit. Bold text and bold text
Cached occupies a lot of no relationship ah, when necessary, the system will automatically recycle the file cache, and then assigned. If the cache needs to be written to disk, the filesystem will do it by itself, and there's no need to sync.
You can look at memory_limit=xxx in the PHP configuration file. May be able to help the landlord!