When web applications face a large amount of data at the same time with a large concurrency, performance is a particularly important issue. In the face of performance optimization, what should we do and what aspects should we optimize?

Source: Internet
Author: User

Data Structure Design:

Establish a proper data structure for business logic needs.

 

Intermediate optimization and network environment deployment:

Intermediary and network environment are also important factors.

 

Database:

1. indexes or associated indexes are used, but the more indexes, the better. Too many indexes will degrade cud performance and occupy a large amount of space.

2. Eliminate link queries for big data tables and process big data tables:

(1) You can add redundant fields to some tables. These redundant fields are frequently obtained from other tables.

(2) cache, with low changes and high data consistency requirements

(3) directly Delete associated fields

(4) split into multiple queries

3. SQL statement Optimization

 

Application Layer:

1. use of cash: cache can be used for high-frequency and infrequently changed operations (that is, reading, writing, and less), such as detecting user permission operations, for each operation, you must check whether the user has the permission for the operation. You can save the user's permission in the cache to avoid frequent operations on the database.

Cache Technology: memcached, JBoss cashe, oscashe, ehcache .......

2. statistical query of data: fuzzy query is commonly used for data queries of large data volumes. fuzzy query is not required if possible, and full-text search function is provided in the database, however, it has some limitations in terms of data accuracy. You can also use open-source search engines, such as Lucene under Apache.

3. Asynchronous Operation:

(1) asynchronous presentation layer: Ajax technology, common frameworks such as DWR and dojo

(2) Background business logic layer Asynchronization: JMS and MQ Technology

 

Web layer performance optimization:

1. Reduce HTTP requests

2. cache Ajax

3. Delayed Loading

4. Advance Loading

5. Reduce IFRAME

6. Avoid Error 404

7. Specify the expires or cache-control file header.

8. gzip compressed webpage

9. Use get to complete Ajax requests

10. Reduce cookie volume

11. Place the JS script at the bottom of the page

12. Use external JS and CSS

13. Put forward repeated steps

14. Replace @ import with <link>

15. Avoid using Filters

16. Image Optimization

17. No Image Scaling

 

HTTP server performance optimization policy:

Three working modes of Apache:

1. prefork

2. Worker

3. Event

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.