"PHP" website slow down Comprehensive problem summary

Source: Internet
Author: User
Tags vps vps server

Analysis of the reasons for the slow opening of the Php+mysql website, the main performance of the following several aspects of the set is reasonable

1, the database table structure is unreasonable

When you create a MySQL database table, the fields that are frequently used as query criteria are indexed, which improves the speed at which the data is queried, thus increasing the speed at which the site is opened.

2, database query statement is unreasonable

For Php+mysql Dynamic Web sites, database Select operations are frequently used. When using the select operation, avoid the use of the SELECT * from tablename, because such queries slow, and will occupy more memory, the overall speed of the PHP program, affecting the speed of the website. It is recommended to use SELECT query statements for specific fields, such as Select FieldName from TableName. This way of querying will reduce MySQL execution time and improve efficiency.

3, PHP program redundancy

When you build the Php+mysql website, you will find that there is a lot of redundancy in some programs, extending the program execution time. For example, repeated SQL query operations, repeated variable assignment, and so on. When this happens, it is best to find a professional to help you optimize the program, improve the overall running time of the program.

4. The PHP program reads and writes the disk extensively

Some Php+mysql website programs will perform a large amount of disk read and write operations, especially disk writes, will consume a large amount of disk IO, resulting in slow program operation. Serious situations can also cause the server to crash. When this happens, you should minimize unnecessary disk writes and optimize disk operations, such as disk grooming, to improve the overall efficiency of the disk operation.

5. Use static pages as much as possible

When using Php+mysql to build a website, try to use an open source program that can generate static pages, such as Dedecms. The time to open a static page is much less than the time to open a dynamic page because the 4-point reason mentioned above is not present in the static page. But it will make you consume more disk space, because the generated static pages will consume a lot of disk space.

6. There are lots of pictures or flash on the webpage.

If there is a large number of pictures or flash on the page, it can also affect the speed at which the site is opened. Reduce the picture or flash on the page, or optimize the size of the image to improve the speed of the page.

7. Server Software

Before meeting a friend on the VPS installed several firewalls, VPS server is safe, but the Web page is very slow to open. Try to avoid installing unnecessary software on VPS or standalone server, and prevent the server from running slowly, causing the website to open slowly.

8, there is a large number of JS code on the page

A large number of JS code is also caused by the slow opening of the Web site An important reason, especially some unknown affiliate AD code, the speed of the site opening is very obvious.

9, too many references to other site content

including pictures, video files that you refer to other websites, if you refer to other sites directly on the page, and that site is slow to open , or the page of that site does not exist, then you will be very slow to open.

"PHP" website slow down Comprehensive problem summary

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.