Concurrency Solutions for Large Distributed Websites

Large distributed website:

1 Increase the cache to reduce the number of disk accesses. Set an index for the stored data, and speed up and reduce the amount of disk access by addressing the index.

2 Web front-end tuning: reduce the number of network interactions (multiple requests merge).

Reduce the size of the amount of data transmitted over the network (compression)

Minimize encoding (try to convert characters to bytes in advance, or reduce the conversion process from characters to bytes)

Use browser cache

Reduce cookie transmission

Reasonable layout of pages, using page compression, lazy loading of pages, CSS at the top, js at the bottom, CDN, reverse proxy, static page, off-site deployment

3 Service degradation: Denial of service and shutdown of service

4 Failover: If any server in the database cluster goes down, all read and write operations of the application to this server need to be rerouted to other servers.

5 Performance optimization: 1. Web front-end performance optimization:

Browser access optimization: reduce http requests; use browser caching; enable compression; put css at the top of the page and javaScript at the bottom of the page; reduce cookie transmission

CDN acceleration, reverse proxy 2, application server performance optimization: distributed cache (Redis, etc.), asynchronous operation (message queue), using cluster (load balancing) code optimization 3 Storage performance optimization, mechanical hard disk vs SSD, B+ tree vs

LSM tree, RAID vs HDFS

6 Code optimization

Multithreading (Q: How to ensure thread safety? What are the lock-free mechanisms?)

Resource reuse (singleton mode, connection pool, thread pool)

data structure

garbage collection

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325123934&siteId=291194637