Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Excel export takes too much time when using Redis. #11829


User avatar
0
[email protected] created

After activated redis cache, all excel exports took longer time to run. It is same when I tried with 3 different excel libraries. The problem is clearly visible with 1000+ records.


9 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you also share your AspNet Zero version ?

  • User Avatar
    0
    [email protected] created

    Hi,

    Currently running v13.0.0 with Angular UI.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks, we are investigating this issue and we will get bakc to you soon.

  • User Avatar
    0
    rickfrankel created

    @ismcagdas I also had problems with this. We were looking at moving TempFileCacheManager to use our storage provider instead of using Redis. When you want to export a grid with quite a bit of data in it, the redis cache just blows up with timeouts.

  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi,

    To solve the delay, please try using Per Request Cache Document. This document will solve your problem.

    Thanks.

  • User Avatar
    0
    rickfrankel created

    Hi @oguzhanagir,

    We are already running the per request cache setup. The error comes from the MiniExcelExcelExporterBase.cs line 39 where is does the _tempFileCacheManager.SetFile

    If you have a large amount of data the stream.ToArray can be quite large, this can timeout the save to Redis. We had it with a grid that had around 1000 rows to export and probably 10 columns.

    I also just generally don't think redis is the best choice when dealing with temporary files. It's better than the local file system (which doesn't load balance) but we are likely to update the tempfilecachemanager to use Azure Storage (which we've already got an implementation for in our binaryobjectstore.

    Thanks Rick

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @rickfrankel

    We will take a look at this again but I think stream.ToArray shouldn't be the problem here. If it was, it would be a problem with memory cache as well. The serialization of the data in AbpRedisCache class might be a problem.

  • User Avatar
    0
    [email protected] created

    Hi,

    To solve the delay, please try using Per Request Cache Document. This document will solve your problem.

    Thanks.

    Thank you @oguzhanagir. Per Request Redis Cache solved my problem.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @omur.bagci

    It is great to hear that. We will still test this with more items and see if we can enhance any parts.