Open Closed

Problem with Redis cache #3565


User avatar
0
dev3.advantiss created

I have got problem with Redis cache Many values cache in Redis and get after load any page or refesh page...

  • ABP Framework version: v5.3.3
  • UI type: Angular
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes

All languages, permissions and settings are cached I need to cache some entities only.

Is it possible to separate ways of storing data?

  • ABP data (for the entire site) was stored in memory as before
  • Сached data only for users

What do I need to do with this problem?

.................... 15:26:01.917 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpValidation_en" "1200"15:26:01.957 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpUi_en" "absexp" "sldexp" "data"15:26:01.998 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpUi_en" "1200"15:26:02.038 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpUi_en" "absexp" "sldexp" "data"15:26:02.079 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpUi_en" "1200"15:26:02.119 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpExceptionHandling_en" "absexp" "sldexp" "data"15:26:02.159 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpExceptionHandling_en" "1200"15:26:02.200 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpExceptionHandling_en" "absexp" "sldexp" "data"15:26:02.240 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.LanguageManagement.Texts,k:AbpExceptionHandling_en" "1200"15:26:02.338 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:02.379 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Themes" "1200"15:26:02.427 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:R,pk:admin,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:02.468 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:R,pk:admin,n:Dibl.Themes" "1200"15:26:02.515 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:C,pk:Dibl_App,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:02.556 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:C,pk:Dibl_App,n:Dibl.Themes" "1200"15:26:04.963 [0 188.163.21.143:58665] "info"15:26:05.312 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:05.352 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Themes" "1200"15:26:05.401 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:R,pk:admin,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:05.443 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:R,pk:admin,n:Dibl.Themes" "1200"15:26:05.462 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Cases" "absexp" "sldexp" "data"15:26:05.490 [0 188.163.21.143:59037] "HMGET" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:C,pk:Dibl_App,n:Dibl.Themes" "absexp" "sldexp" "data"15:26:05.502 [0 188.163.21.143:59037] "EXPIRE" "Dibl_c:Volo.Abp.PermissionManagement.PermissionGrant,k:pn:U,pk:2fba660d-c3af-ac4f-4d14-3a058fdf586f,n:Dibl.Cases" "1200" ....................

Best Regards Advantiss.


7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://github.com/abpframework/abp/issues/5023#issuecomment-687854205

  • User Avatar
    0
    dev3.advantiss created

    Hi

    I have some problem with performance after enabled Redis. I use Redis in Azure.

    After click refresh my site's pages opening very slowly.

    I created new project and enable Redis on it - I have the same problems: Refresh Home page takes 15 seconds

    I run website locally, but if website from Azure use Redis from Azure litle bit faster than locally but very slow for users.

    I save video with that problem and some code where I config Redis: https://drive.google.com/drive/folders/1RebzN9I4zrZ1DSq_qHjN4YGjahRUCP2B?usp=sharing

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I guess it's slow because they connect to remote Redis. Can you try with local Redis for the test?

  • User Avatar
    0
    dev3.advantiss created

    hi

    I guess it's slow because they connect to remote Redis. Can you try with local Redis for the test?

    Local redis works fine. But I get some error messages as


    [17:38:48 DBG] Not found in the cache: pn:U,pk:1e0b14a2-a29f-d3cd-58d6-3a05c4c8341a,n:Dibl.Cases [17:38:48 DBG] Getting all granted permissions from the repository for this provider name,key: U,1e0b14a2-a29f-d3cd-58d6-3a05c4c8341a [17:38:48 DBG] Setting the cache items. Count: 107 [17:38:48 WRN] ERR Error running script (call to f_3915ee22fda531a1d5661f2523d0443fd35ff0a4): @user_script:2: @user_script: 2: Wrong number of args calling Redis command From Lua script StackExchange.Redis.RedisServerException: ERR Error running script (call to f_3915ee22fda531a1d5661f2523d0443fd35ff0a4): @user_script:2: @user_script: 2: Wrong number of args calling Redis command From Lua script at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.SetManyAsync(IEnumerable1 items, DistributedCacheEntryOptions options, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.<>c__DisplayClass54_0.<<SetManyAsync>g__SetRealCache|0>d.MoveNext() [17:38:48 DBG] Finished setting the cache items. Count: 107 [17:38:48 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Dibl.Cases [17:38:48 DBG] Not found in the cache: pn:R,pk:admin,n:Dibl.Cases [17:38:48 DBG] Getting all granted permissions from the repository for this provider name,key: R,admin [17:38:48 DBG] Setting the cache items. Count: 107


    What is it?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    [17:38:48 WRN] ERR Error running script (call to f_3915ee22fda531a1d5661f2523d0443fd35ff0a4): @user_script:2: @user_script: 2: Wrong number of args calling Redis command From Lua script StackExchange.Redis.RedisServerException: ERR Error running script (call to f_3915ee22fda531a1d5661f2523d0443fd35ff0a4): @user_script:2: @user_script: 2: Wrong number of args calling Redis command From Lua script at Volo.Abp.Caching.StackExchangeRedis.AbpRedisCache.SetManyAsync(IEnumerable1 items, DistributedCacheEntryOptions options, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.<>c__DisplayClass54_0.<<SetManyAsync>g__SetRealCache|0>d.MoveNext()

    Try to add this to your startup project.

    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.5" />
    
  • User Avatar
    0
    dev3.advantiss created

    Try to add this to your startup project.

    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.5" /> 
    

    Hi I have added but it did not fix this problem Do you have any another ideas?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What's the version of your Redis server?

    https://github.com/abpframework/abp/issues/13702

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07