Skip to content

Garnet crashes on large dataset ingestion (20K records) with high CPU spike #1811

@Saqibs575

Description

@Saqibs575

Describe the bug

GarnetServer Exception with Large Dataset (20K SQL Records) + High CPU Usage

I am running GarnetServer.exe (GarnetServer 1.1.6+c81684f5b216fb7e70e5f16e806842b54ae57ee9
)
on Windows, and I am encountering a critical exception when processing large datasets (~20,000 SQL records).

The issue does not occur with small datasets, but consistently appears when the payload size increases.

Additionally, CPU usage spikes significantly (up to ~87–89%) during retries and processing.


Error Logs

When processing large data, the server throws the following exception:

12::12::10 crit: Session[0] [127.0.0.1:58660] [02F36FD6] ProcessMessages threw an exception: Tsavorite.core.TsavoriteException: Entry does not fit on page at Tsavorite.core.TsavoriteLog.Enqueue[THeader,TInput,TEpochAccessor](THeader userHeader, SpanByte& item1, TInput& input, TEpochAccessor epochAccessor, Int64& logicalAddress) in //libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:line 1043 at Garnet.server.ObjectSessionFunctions.WriteLogRMW[TEpochAccessor](Byte[]& key, ObjectInput& input, Int64 version, Int32 sessionID, TEpochAccessor epochAccessor) in //libs/server/Storage/Functions/ObjectStore/PrivateMethods.cs:line 61 at Garnet.server.ObjectSessionFunctions.PostRMWOperation[TEpochAccessor](Byte[]& key, ObjectInput& input, RMWInfo& rmwInfo, TEpochAccessor epochAccessor) in //libs/server/Storage/Functions/ObjectStore/RMWMethods.cs:line 293 at Garnet.server.StorageSession.RMWObjectStoreOperation[TObjectContext](Byte[] key, ObjectInput& input, ObjectOutputHeader& output, TObjectContext& objectStoreContext) in //libs/server/Storage/Session/ObjectStore/Common.cs:line 31 at Garnet.server.StorageSession.ListPush[TObjectContext](Byte[] key, ObjectInput& input, ObjectOutputHeader& output, TObjectContext& objectStoreContext) in //libs/server/Storage/Session/ObjectStore/ListOps.cs:line 363 at Garnet.server.GarnetApi`3.ListLeftPush(Byte[] key, ObjectInput& input, ObjectOutputHeader& output) in //libs/server/API/GarnetApiObjectCommands.cs:line 258 at Garnet.server.RespServerSession.ListPush[TGarnetApi](RespCommand command, TGarnetApi& storageApi) in //libs/server/Resp/Objects/ListCommands.cs:line 45 at Garnet.server.RespServerSession.ProcessArrayCommands[TGarnetApi](RespCommand cmd, TGarnetApi& storageApi) in //libs/server/Resp/RespServerSession.cs:line 922 at Garnet.server.RespServerSession.ProcessMessages() in //libs/server/Resp/RespServerSession.cs:line 639 at Garnet.server.RespServerSession.TryConsumeMessages(Byte* reqBuffer, Int32 bytesReceived) in //libs/server/Resp/RespServerSession.cs:line 484

Environment Details

Garnet

  • Version: 1.1.6
  • OS: Windows (64-bit)
  • Command:
GarnetServer.exe --config-import-path garnet.conf

Redis Client

  • Library: redis-py
  • Version: 6.2.0
  • Connection: localhost:6379

Machine Details

  • OS: Windows 10
  • RAM: 32GB

Observations

  • Works fine for small datasets
  • Issue occurs when dataset size increases (~20K records)
  • Likely related to:
    • Tsavorite page size limitation
    • Large payload per RMW/List operation
    • Log segment overflow or serialization size constraints
    • CPU spikes heavily during retry logic loops

Additional Notes

  • I have implemented retry logic, but it increases CPU usage significantly during failures
  • Task Manager screenshots confirm Garnet CPU usage reaching ~87–89%

Request

Please advise on:

  • Maximum safe payload size per operation
  • Recommended batching strategy for large datasets
  • Any configuration tuning to avoid:
    • Entry does not fit on page exception
    • High CPU usage under bulk load

Steps to reproduce the bug

  1. Start Garnet server:
GarnetServer.exe --config-import-path garnet.conf
  1. Connect using redis client (redis-py)
  2. Insert ~20,000 SQL-derived records into a list using LPUSH / list operations
  3. Observe failure during bulk ingestion

Expected behavior

Garnet should handle large dataset inserts (20K SQL records) without:

  • Crashing sessions
  • Throwing TsavoriteException: Entry does not fit on page
  • Excessive CPU usage spikes

Screenshots

Task Manager CPU usage screenshots (Garnet process ~87–89%)

Image

Release version

No response

IDE

No response

OS version

No response

Additional context

Configuration Details
{
//
/
Garnet Configuration File /
/
/
/* Use this file to configure any values different from the defaults specified in libs/host/defaults.conf /
/
/
/
Example: /
/
"Port" : 1234, /
/
"Address" : "1.2.3.4", /
/
"MemorySize" : "32g", /
/
... /
/
/
/
In order to use this file, run GarnetServer with the --config-import-path command line argument /
/
(e.g. GarnetServer.exe --config-import-path /path/to/garnet.conf). /
/
*********************************************************************************************************/
"AuthenticationMode": "Password",
"Password": password",

"MemorySize": "16g",

"CheckpointDir": "checkPoinDir",

"EnableAOF": true,
"Recover": true,
"CommitFrequencyMs": 1000
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions