Java Concurrency-Access volume

Source: Internet
Author: User
Tags dedicated server

There are a few common measures
1, set up the cache module for common functions. Try to use the cache, including user cache, information cache, etc., spend more memory to do the cache, can reduce the interaction with the database, improve performance. Statistical functions as far as possible cache, or according to a daily statistical or timing statistics related reports, to avoid the need for statistical functions.


2, the Web page as far as possible static. Use static pages wherever possible, reducing the parsing of containers (as much as possible to generate static HTML for dynamic content display).


3, using a separate picture server, reduce the pressure on the server, so that it will not be caused by the image load crash


4, using the image to solve different network access providers and different geographical user access differences


5. Database Cluster Chart Hash

Optimize database query statements to reduce direct generation statements using tools such as hibernate (only long-time queries are optimized).
Optimize the database structure, do more indexing, improve query efficiency.


6, strengthen the network layer hardware configuration, hard not to soft.


7. Ultimate Approach: Load balancing


Use tools such as Jprofiler to identify performance bottlenecks and reduce additional overhead.



Introduced

First, verify that the server hardware is sufficient to support the current traffic.

ordinary P4 server can generally support up to 100,000 independent IPs per day, if the traffic is larger than this, then you must first configure a more high-performance dedicated server to solve the problem, or how optimization can not completely solve the performance problem.

Second, optimize database access.

server load is too large, an important reason is that the CPU load is too large, reduce the load on the server CPU, can effectively break the bottleneck. Using static pages can minimize the load on the CPU. Full static at the front desk, of course, the best, can not access the database at all, but for frequently updated sites, static often does not meet certain functions.

Caching Technology is another solution, that is, the dynamic data stored in the cache file, dynamic Web pages directly call these files, and no longer access to the database, WordPress and Z-blog are heavily used this caching technology.

If you do not avoid access to the database, you can try to optimize query SQL for the database. Avoid using a statement like SELECT * from, each time the query returns only the results you want, avoiding a large number of SQL queries over a short period of time.

Third, prohibit the external hotlinking.

external Web site picture or file hotlinking often bring a lot of load pressure, so should strictly restrict the external to their own picture or file hotlinking, fortunately, can now simply through refer to control hotlinking, Apache can use its own configuration to prohibit hotlinking, and IIS has some third-party ISAPI that can do the same. Of course, forged refer can also be implemented by code to achieve hotlinking, but the current deliberate forgery refer hotlinking is not much, you can first not consider, or use non-technical means to solve, such as the image of the watermark added.

Four, control the download of large files.

Large file downloads can consume a lot of traffic, and for non-SCSI hard drives , a large number of file downloads can consume CPU, resulting in reduced responsiveness. Therefore, try not to provide more than 2M of large file download, if required to provide, it is recommended to put large files on another server. There are many free Web 2.0 sites that offer image sharing and file sharing, so you can upload pictures and files to these sharing sites as much as possible.

V. Use different hosts to divert the main flow

put the files on different hosts and provide different images for users to download. For example, if you feel that the RSS files occupy a large amount of traffic, then use services such as FeedBurner or Feedsky to put the RSS output on other hosts, so that others access to the traffic pressure is mostly concentrated on FeedBurner host, RSS does not occupy too much resources.

VI, using traffic analysis statistics software

Install a traffic analysis and statistics software on the website to instantly know which places are consuming a lot of traffic and which pages need to be optimized, so it is necessary to have accurate statistical analysis to solve the traffic problems. The recommended traffic analysis statistics software is Google Analytics. This software is very good oh!

Java Concurrency-Access volume

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.