Netty tuning for Data Grid 8

Solution Verified - Updated

Environment

  • Red Hat Data Grid
    • 8.x

Issue

  • how to tune Data Grid 8's netty?
  • Options for Netty configuration in Data Grid 8

Resolution

Options

Setting whereOptions
Client Hot Rod-Dio.netty.eventLoopThreads=5 -Dio.netty.allocator.useCacheForAllThreads=false -Dio.netty.allocator.maxOrder=6
Client Quarkus-Dio.netty.allocator.useCacheForAllThreads=false -Dio.netty.allocator.maxOrder=3 -Dio.netty.eventLoopThreads=n (CPU*2)
Server-Dio.netty.allocator.useCacheForAllThreads=false -Dio.netty.allocator.maxOrder=9

Quarkus client

Client QuarkusSettings
-Dio.netty.allocator.useCacheForAllThreads=falseThat set the cache per thread for false
-Dio.netty.allocator.maxOrderThe default maxOrder is 3.
-Dio.netty.eventLoopThreads=n (CPU*2)The default eventLoopThreads is CPU*2.

Root Cause

This solution discussed caching for Netty in Data Grid 8.

To prevent a high memory scenario inside a container (high heap usage because of Netty caching) set io.netty.allocator.useCacheForAllThreads to false consequently, it won't have a new cached pool for each thread and avoid such a high heap consumption.
Note that setting io.netty.allocator.type=unpooled is not recommended, and as it will have a performance hit as every new request will have to create a block of memory to handle the request.

Major footprint differences occurred with Data Grid 8.3 to 8.4, see Differences between Data Grid 8.3 vs Data Grid 8.2.

Product(s)
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.