Cannot load objects to Redis Session State Provider on Asp.net

463 views Asked by At

I'm testing different session state providers on a simple Asp.Net MVC project.

When I plug Redis into the project, it works ok if I load a few hundred objects. However, when I push a few thousand; I get the following error which I cannot find any solution for.

[RedisServerException: ERR Error running script (call to f_59249e4f506be114e0a7fb8654a9b761f1b3b34e): @user_script:5: user_script:5: too many results to unpack ]

1

There are 1 answers

0
Liviu Costea On

The error details leads me to lua scripting limitations (script and unpack keywords are related to lua).
There seems to be a limitation LUAI_MAXCSTACK which is 8000, more details here: How to avoid Redis calls in Lua script limitations?
But do you really need thousands of items in a single Session? You will have performance problems, the session items are loaded and saved on each request. If you need so many items think about using a separate cache layer.