Linux concurrency and competition (1)

Linux concurrency and competition Before talking about Linux concurrent operations, let’s first understand the difference between concurrency and parallelism. Both terms refer to multiple operations being executed at the same time. However, these two concepts are very different, and they are often confused. Concurrency emphasizes that there can only be one object that performs multiple […]

Redis principles cache expiration, consistent hashing, avalanche, penetration, concurrency, blooming, cache update strategy, cache database consistency

redis expiration policy The expiration policy of redis can be configured through the configuration file 1. Regular deletion Redis will put the keys with expiration time set in a separate dictionary, and periodically traverse to delete the expired keys. 1). Randomly select 20 keys from the expired dictionary every 100ms and delete the expired keys; […]

How to successfully design a high-concurrency Java flash killing system

When designing a highly concurrent Java flash killing system, you need to consider the following aspects: Database Optimization: Use a high-performance database, such as Redis or Memcached, to store data such as inventory information of flash sale items in memory to improve read and write performance. Caching technology: Use caching technology to reduce the pressure […]

Java NIO high concurrency development

Java NIO high concurrency development Foreword Compared with traditional Java I/O (BIO), Java NIO (New I/O) has the following advantages in high-concurrency development: Non-blocking mode: Java NIO uses non-blocking I/O operations, allowing one thread to manage multiple channels (Channel), and will not block the thread when there is no data to read or write. This […]

Multi-thread concurrency in python

Foreword Today, I want to talk to you about multi-threaded concurrency in Python. Without further ado, let’s get straight to the topic. 1. Thread execution Python’s built-in modules provide two built-in modules: thread and threading. Thread is a source module and threading is an extension module. It is encapsulated and improved on the basis of […]

Use Hystrix to implement request merging and reduce server concurrency pressure

1. Introduce Hystrix <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependency> 2. Enable Hystrix function on the startup class @EnableHystrix 3. Request to merge the implementation code import com.bzcst.bop.oms.orm.model.po.Product; import com.bzcst.bop.oms.orm.service.ProductService; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCollapser; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; import com.netflix.hystrix.contrib.javanica.conf.HystrixPropertiesManager; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.concurrent.Future; /** * @author Xiang Zhenhua * @date 2023/10/26 14:37 */ […]

SpringBoot + Disruptor implements extremely fast and high-concurrency processing, supporting 6 million orders per second without any pressure!

1Background I encountered a project at work that used Disruptor as a message queue. You read that right, it is not Kafka or rabbitmq. The biggest advantage of Disruptor is that it is fast, and it is open source. Let’s make a simple record. 2Disruptor introduction Disruptor is a high-performance queue developed by LMAX, a […]

Concurrency tool class for Java threads

Concurrency utility class for Java threads. 1. fork/join 1. Fork-Join principle If necessary, split (fork) a large task into several small tasks, and then summarize (join) the results of each small task. Applicable scenarios: large data volume statistical tasks. 2. Job theft In the implementation of Fork/Join, small tasks split from large tasks will be […]