Performance Optimization
Performance optimization: profiling, caching, lazy loading, pagination, connection pooling, DB indexing
1What is HikariCP in the context of Spring Boot?
What is HikariCP in the context of Spring Boot?
Câu trả lời
HikariCP is the default connection pool manager in Spring Boot since version 2.0. It offers exceptional performance through an optimized implementation (low overhead, efficient concurrency management) and is widely considered the fastest connection pool on the market. Spring Boot uses it automatically when spring-boot-starter-data-jpa or spring-boot-starter-jdbc is present in dependencies.
2Which HikariCP parameter defines the maximum number of connections in the pool?
Which HikariCP parameter defines the maximum number of connections in the pool?
Câu trả lời
The maximumPoolSize parameter defines the maximum number of connections (active and idle) that HikariCP will maintain in the pool. The recommended value by HikariCP is generally based on the formula: connections = ((core_count * 2) + effective_spindle_count), often between 10 and 20 for typical applications. A value too high can saturate the database, while a value too low can cause connection waits.
3What is the difference between maximumPoolSize and minimumIdle in HikariCP?
What is the difference between maximumPoolSize and minimumIdle in HikariCP?
Câu trả lời
maximumPoolSize defines the total maximum number of connections (active and idle) in the pool, while minimumIdle defines the minimum number of idle connections that HikariCP maintains permanently. HikariCP recommends not setting minimumIdle and letting maximumPoolSize manage the pool (default behavior: minimumIdle = maximumPoolSize), as the pool automatically adjusts based on load to optimize performance.
What is the formula recommended by HikariCP to calculate maximumPoolSize?
Which HikariCP parameter controls the maximum wait time to obtain a connection from the pool?
+27 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Spring Boot khác
Spring Core - IoC & DI
Spring Boot Auto-Configuration
Spring Boot Starters
Application Properties & YAML
Logging with SLF4J & Logback
Spring Boot DevTools
Spring MVC Basics
Spring REST Controllers
Request & Response Handling
Exception Handling
Bean Validation
Spring Data JPA Basics
JPA Entities & Relationships
JPA Queries
Spring Data Repositories
Spring Security Basics
Spring Boot Actuator
Unit Testing with JUnit & Mockito
Spring Boot Testing
Profiles & Environment
RestTemplate & WebClient
Async & Scheduling
Caching with Spring
Spring WebFlux (Reactive)
Spring Transactions
Advanced Authentication & Authorization
JWT & Stateless Security
OAuth2 & Authorization Server
Spring Boot & Docker
Microservices with Spring
Spring Cloud Config
GraalVM Native Images
Nắm vững Spring Boot cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí