Base solution for your next web application

Activities of "ajayak"

Hi @ismcagdas,

Yes, it is the PK but in our case, we are probably sending a lot of notifications. And deleting hundreds of notifications by sending a seperate query for each delete operation is the problem. Instead of sending 100 queries, this can be optimized to send 1 query

  • What is your product version? 10.2
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

From Azure db analytics, the top resource consuming query for our DB is:

(@p0 uniqueidentifier)DELETE FROM [AbpNotifications]
WHERE [Id] = @p0

Looks like notifications are deleted 1 by 1. Is it possible to modify this query to use WHERE Id IN (1,2,3,...)

Prerequisites

  • What is your product version? 10.4.0 rc1
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

Hi @ismcagdas,

Is it ok if I delete records from AbpTenantNotifications table directly?

Prerequisites

  • What is your product version? 10.2
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? ,net core

Our AbpTenantNotifications table size has grown to 536.11 MB. How can we delete old notifications from this table directly from DB? Any SQL query?

Hi @ismcagdas,

We use Hangfire for all our background jobs and Hangfire handles the concurrency very well :) But these background jobs use framework's job processing. Where can I configure this? Which file? :)

Hi,

Our app runs on 6 instances and every instance sends subscription expiring emails to customers i.e. 6 emails at once. How to stop this?

Please share changelog. Can't see on github.

Hi @ismcagdas,

I found the problem. Our redis cache configuration was not configured correctly and was not in use. The issue was file was requested from different server where file was not cached. Completely my fault

Hi @ismcagdas,

I tried this but our customers are still facing this issue. I'm sharing the code and logs in more details.

Code:

protected void Save(XSSFWorkbook excelPackage, FileDto file)
{
    Logger.Log(LogSeverity.Info, $"Writing memory stream for file - {file.FileName}, token {file.FileToken}");

    using (var stream = new MemoryStream())
    {
        Logger.Log(LogSeverity.Info, "Writing to memory stream");
        excelPackage.Write(stream);
        _tempFileCacheManager.SetFile(file.FileToken, stream.ToArray());
        Logger.Log(LogSeverity.Info, "Saved to temp file");
    }

    try
    {
        var test = _tempFileCacheManager.GetFile(file.FileToken);
        Logger.Log(LogSeverity.Info, $"Verified by getting file - {file.FileToken}, bytes - {test.Length}");
    }
    catch (Exception)
    {
        Logger.Log(LogSeverity.Error, $"Verification failed for file - {file.FileToken}");
    }
}

Logs:

INFO  2020-10-27 12:36:04,170 [36   ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 GET https://service.primepenguin.com/api/services/app/InventoryReport/GetInventoryListToExcel?Sorting=&MaxResultCount=77&SkipCount=0  
INFO  2020-10-27 12:36:04,177 [36   ] pNetCore.Cors.Infrastructure.CorsService - CORS policy execution successful.
INFO  2020-10-27 12:36:04,199 [36   ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token.
INFO  2020-10-27 12:36:04,205 [36   ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'PrimePenguin.Technology.Reports.Inventory.InventoryReportAppService.GetInventoryListToExcel (PrimePenguin.Technology.Application)'
INFO  2020-10-27 12:36:04,214 [36   ] c.Infrastructure.ControllerActionInvoker - Route matched with {area = "app", action = "GetInventoryListToExcel", controller = "InventoryReport"}. Executing controller action with signature System.Threading.Tasks.Task`1[PrimePenguin.Technology.Dto.FileDto] GetInventoryListToExcel(PrimePenguin.Technology.Reports.Inventory.Dto.GetInventoryListInput) on controller PrimePenguin.Technology.Reports.Inventory.InventoryReportAppService (PrimePenguin.Technology.Application).
INFO  2020-10-27 12:36:04,797 [36   ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 GET http://service-eu.primepenguin.com/  
INFO  2020-10-27 12:36:04,799 [36   ] oft.AspNetCore.Rewrite.RewriteMiddleware - Request redirected to HTTPS
INFO  2020-10-27 12:36:04,800 [36   ] Microsoft.AspNetCore.Hosting.Diagnostics - Request finished in 3.8333ms 301 
INFO  2020-10-27 12:36:05,136 [36   ] y.Exporting.InventoryReportExcelExporter - Generating file - InventoryList.xlsx
INFO  2020-10-27 12:36:05,926 [36   ] y.Exporting.InventoryReportExcelExporter - Writing memory stream for file - InventoryList.xlsx, token 151e1d45333744f1a5725739dc01a4cc
INFO  2020-10-27 12:36:05,930 [36   ] y.Exporting.InventoryReportExcelExporter - Writing to memory stream
INFO  2020-10-27 12:36:06,114 [36   ] y.Exporting.InventoryReportExcelExporter - Saved to temp file
INFO  2020-10-27 12:36:06,116 [36   ] y.Exporting.InventoryReportExcelExporter - Verified by getting file - 151e1d45333744f1a5725739dc01a4cc, bytes - 9886
INFO  2020-10-27 12:36:06,136 [36   ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
INFO  2020-10-27 12:36:06,138 [36   ] c.Infrastructure.ControllerActionInvoker - Executed action PrimePenguin.Technology.Reports.Inventory.InventoryReportAppService.GetInventoryListToExcel (PrimePenguin.Technology.Application) in 1923.8685ms
INFO  2020-10-27 12:36:06,139 [36   ] ft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint 'PrimePenguin.Technology.Reports.Inventory.InventoryReportAppService.GetInventoryListToExcel (PrimePenguin.Technology.Application)'
INFO  2020-10-27 12:36:06,140 [36   ] Microsoft.AspNetCore.Hosting.Diagnostics - Request finished in 1970.2227ms 200 application/json; charset=utf-8
INFO  2020-10-27 12:36:25,175 [4    ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 GET https://primepenguinservice-eu.azurewebsites.net/Ui/Login  

Code:

public ActionResult DownloadTempFile(FileDto file)
{

    var fileBytes = _tempFileCacheManager.GetFile(file.FileToken);
    if (fileBytes == null)
    {
        AsyncHelper.RunSync(() => _errorReporter.CaptureAsync($"Error in getting file - {file.FileName}, token - {file.FileToken}"));

        // Optimistic retry
        Thread.Sleep(500);
        fileBytes = _tempFileCacheManager.GetFile(file.FileToken);

        if (fileBytes == null)
        {
            return NotFound(L("RequestedFileDoesNotExists"));
        }
    }

    return File(fileBytes, file.FileType, file.FileName);
}

Error:

{"result":"Requested file does not exist!","targetUrl":null,"success":true,"error":null,"unAuthorizedRequest":false,"__abp":true}

I checked redis cache and token was not available.

Showing 11 to 20 of 202 entries