How to improve the performance of the Java platform

Source: Internet
Author: User

The first is to improve from three aspects, application level, server-side level, database level.  
first, the application level
1, the use of freemaker or velocity to do the page static, improve the speed of website access.  

second, server- side
1, for some infrequently deleted and changed data to do the cache, such as Memcached,redis,mongodb
2, for the picture, the use of Fastdfs to do the image of the distributed server, to speed up the storage and reading of pictures.  
3, for the security aspect, uses the database transaction to guarantee the data security performance.  
4, can use the lock to handle as little as possible, because the lock sometimes brings a series of chain reaction.  
5, do load balancing, through the Nginx+tomcat combination to the server-side shunt.  
6, through the queue to do some data staging, to slow down the thread to the server pressure.  
7, the use of concurrent collection classes, such as Concurrenthashmap,copyonwritearraylist.  
8, consider the scalability and portability of the program.  
9, data consistency issues, need to consider the Java concurrent package
10, appropriate use of some high-efficiency algorithms.  
11. Memory Consistency: Happen-before relationship of memory operations (such as read and write of shared variables). Only a write operation Happen-before read operations guarantees that the result of one thread's write is visible to the other thread's read. Synchronized and volatile tectonic happen-before relationships, Thread.Start () and Thread.Join () methods form happen-before relationships.  
12, the JVM's memory model and the JVM garbage collection mechanism, has been the rational use of garbage collector, the new generation and the old era of reasonable zoning.  

third, the database level
1, to the Database field index, can speed up the query speed, not all indexes can speed up the query speed, if the query more than adding and deleting data.  
2, table partitioning for the database table, can speed up the query.  
3, sub-database sub-table, through the Division table can speed up the query.  
4, according to the explain command for the SQL statement interpretation Execution Plan analysis.  
5, partition the table, the partition query will speed up the
6, Oracle words. You need to choose the right selector, choose a cost-based selector based on your actual needs, or based on a rule -based optimizer
7, in and exists, as well as the usage differences between not and not exists, and where applicable
8, do master-slave, read and write separation, to the database through the shunt to reduce pressure.  
9. Optimized for SQL statements.

How to improve the performance of the Java platform

Related Article

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.