List&Label 28 .net pdf export Slow Execution on EC2 Server

Hi.
We are generating pdfs in a .net 6 web api hosted in IIS. When ran locally on the developers machine the pdf’s are generated in ~ 1 - 5 seconds, depending upon the complexity and amount of data passed to the report. However running the same application on an EC2 server, the execution times increase by a factor of ~4. This makes the PDF generation process unusable by our customers.

We are trying to find an explanation and a fix to this situation.

Here’s the details of our environment.
We are generating pdf’s using the GeneratePdfFromJson method.
Our data structures are simple collections and not deep hierarchies. See example below.
There’s no images or anything complex in the report.
The EC2 instance is a standard windows server running IIS.
The CDS files are read from disk on each generation request
We have tried with both t2.mediun and t2.large server sizes, with no real difference in times.

Thanks in advance.

Example of POCO used to serialize into Json.

public class PeriodTracking : IReportRequest
{
    public HeaderFooter HeaderFooter { get; set; }
    public List<Analysis> Analysis { get; set; }
    public List<Detail> Details { get; set; }
    public GrandTotals GrandTotals { get; set; }
}

public class Analysis
{
    public int DetailType { get; set; }
    public string DetailTypeDesc { get; set; }
    public string AnalysisType { get; set; }
    public string Name { get; set; }
    public string ShiftTimes { get; set; }
    public double SalesAmt { get; set; }
    public double SalesPct { get; set; }
    public double SalesPctIncr { get; set; }
    public int TransAmt { get; set; }
    public double TransPct { get; set; }
    public double TransPctIncr { get; set; }
    public double AverageChequeAmt { get; set; }
    public double AverageChequePctIncr { get; set; }
}

public class Detail
{
    public int DetailType { get; set; }
    public string DetailTypeDesc { get; set; }
    public string BusinessDate { get; set; }
    public string LineTitle { get; set; }
    public double SalesLastYear { get; set; }
    public int SalesProjected { get; set; }
    public double SalesActual { get; set; }
    public double SalesPctIncr { get; set; }
    public int TransActual { get; set; }
    public double TransPctIncr { get; set; }
    public double AverageCheque { get; set; }
    public double WasteRawPct { get; set; }
    public double WasteCompletedPct { get; set; }
    public double WasteTotalPct { get; set; }
    public double WasteRawCost { get; set; }
    public double WasteCompletedCost { get; set; }
    public int VariationCost { get; set; }
    public string LabourHoursProjectedHhmm { get; set; }
    public string LabourHoursActualHhmm { get; set; }
    public double SPMHProjected { get; set; }
    public double SPMHActual { get; set; }
    public double CrewLabourPct { get; set; }
    public double CrewAHR { get; set; }
    public double CrewTPMH { get; set; }
}
public class GrandTotals
{
    public double NetSales { get; set; }
    public double LeviableSales { get; set; }
    public double CashOverShortAmt { get; set; }
    public int CashOverShortPct { get; set; }
    public int LabourExtraCrew { get; set; }
    public double LabourOther { get; set; }
    public double LabourCombined { get; set; }
    public int PrevYrSalesIncr { get; set; }
    public int PrevYrTransIncr { get; set; }
}

public class HeaderFooter
{
    public string ReportTitle { get; set; }
    public string StoreName { get; set; }
    public string PeriodName { get; set; }
    public string PrintName { get; set; }
    public string OptionName { get; set; }
    public string SoftwareVersion { get; set; }
    public string LeviableName { get; set; }
    public string SalesTaxName { get; set; }
}

Here’s the details

Hi Bruce, welcome to our community :slight_smile:. This sounds like a good fit to get in touch with our support team. We’d probably need more details and a log file both from a “normal” workstation and the EC2 instance. These logs contain timestamps which should help to troubleshoot the issue. Of course you can also have a first look yourself - the procedure is documented here:

Troubleshooting Guidance - combit Reporting Forum

Hi!

Sometimes enabled debug output can slow down your system.

HP

A follow up to this query (I’m another developer on the same team): Running Debwin4 and logging on the server is showing the following issue:

It is constantly attempting to access ‘log.text’ and failing which is slowing it right down (about 10x slower). At times for an unknown reason it doesn’t make this ‘log.text’ attempt and so runs well. Is there a setting somewhere that turns this off?

Hi Daniel,

Strange issue indeed. I was unable to find any reference to log.text in our sources. Basically, the output will happen if LlSetDebug is called with the LlDebug.LogToFile flag. You should check your source code for this call. The file name is probably set via LlSetOptionString with the LlOptionString.LogFilePath enum value.

You should avoid calling LlSetDebug altogether, as @Hans_Peter_Reische pointed out this will slow down processing considerably. If you can’t find the options in your code, also check the config file of your app. The options might have been set there using these settings.