Home > Backend Development > PHP Tutorial > Detailed explanation of PHP big data, large concurrency and large traffic

Detailed explanation of PHP big data, large concurrency and large traffic

小云云
Release: 2023-03-21 08:04:01
Original
3320 people have browsed it


What is a large website? A large website must meet the following standards.

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

Problems caused by large websites

Big Concurrency

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)

Large Storage

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

Common solutions for large websites

Methods for handling large concurrency (architecture layering + load balancing + clustering)



##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.

## Common solutions for Da Storage


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
#                                                               

Engines generally come with static pages

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 concurrency

Linux modifies the maximum number of concurrent connections in Mysql

The 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template