Spring Boot

Performance Optimization

Performance optimization: profiling, caching, lazy loading, pagination, connection pooling, DB indexing

30 면접 질문·
Senior
1

What is HikariCP in the context of Spring Boot?

답변

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.

2

Which HikariCP parameter defines the maximum number of connections in the pool?

답변

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.

3

What is the difference between maximumPoolSize and minimumIdle in HikariCP?

답변

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.

4

What is the formula recommended by HikariCP to calculate maximumPoolSize?

5

Which HikariCP parameter controls the maximum wait time to obtain a connection from the pool?

+27 면접 질문

다음 면접을 위해 Spring Boot을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기