Home >Backend Development >PHP Tutorial >Detailed explanation of PHP big data, large concurrency and large traffic
pv(page views) value, page views, a website’s The total number of times all pages have been viewed within 24 hours, generally in the tens of millions.
uv(unique visitor) Unique visitor: How many users visit a website within 24 hours This website generally has a value of 100,000
ip, which is how many IPs visit a website within 24 hours. Without considering the intranet and LAN, uv is equal to ip. If considered, the uv value is slightly larger than ip. Generally speaking, it reaches 100,000
Overview: At the same point in time, a large number of customers visit our website. If the number of visits is too large, it may cause the website to be paralyzed.
# Overview: When the website is large, there are a lot of pictures, videos, and flash Larger bandwidth. (Spend money)
Overview: Your data volume will become a massive amount of data. If our data is put into A table cannot cope with it. There may be problems with data storage and query
##Q
You can enable Apache’s own data compression mechanism (gzip, deflate).
Use cdn (content delivery network) content distribution network
#Q, try to use JPG (resolution bottom) without affecting viewing, do not use high resolution.
Use cache technology (memory cache [Redis, MySQL database (Memory engine)], page cache (page staticization of page staticization )
# Optimized database
) The design of the table should be reasonable (satisfying 3NF) atomicity, uniqueness, split table
add indexes (Primary key index | Full text index | Unique index | Ordinary index | Spatial index)
Optimize sql statement
Table splitting (horizontal sharding, vertical sharding), partitioning since the
#
Use ob cache
When the PHP program is running, there is a program cache. This cache must exist and is beyond the control of the programmer.
When the PHP program is running, we can turn on the ob cache (before php5.2, ob is turned off by default, and it is turned on by default in later versions). There are two ways to turn on the ob cache
a) Modification php.ini output_buffering = 4096,
is put into ob, and the header information is put into the program cache
When the php file is executed, the ob cached data will be refreshed to the program cache, and then apache will package it and return it to the browser device.
related recommendations:
qp big data plus method qp use redis to implement Methods to prevent secondary writing under large concurrencyLinux modifies the maximum number of concurrent connections in MysqlThe above is the detailed content of Detailed explanation of PHP big data, large concurrency and large traffic. For more information, please follow other related articles on the PHP Chinese website!