Forums

Forums / Developing Portals / Ajax Form Submit takes very long time.

Ajax Form Submit takes very long time.

14 posts, 0 answered
  1. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    04 Jul 2023
    Link to this post
    Hello Dear TPC Team,

    We're having an issue on TPC v 6.2.144.101 / SF v 14.4.8100.0

    Sometimes submitting a form take up to 2 minutes. We tried different entities, forms and FormFlows, disabling plugins, etc.

    Looks like it's something related to configuration/performance, something like this, Also it's running on the SandBox Dynamics right now, may it be related?

    Could you please direct us to some tips for performance or maybe you know some checkboxes that we can try to toggle? Or maybe something in Azure App Service configuration?

    Thank you.


  2. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    04 Jul 2023 in reply to Dmitriy Razumov_2
    Link to this post
    Some additional Info: our Azure Plan is PremiumV2 (P3v2)
    SQL Database also in Azure in the same region, Subscription Microsoft Azure Sponsorship


  3. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    04 Jul 2023 in reply to Dmitriy Razumov_2
    Link to this post
    Or maybe there's a way to enable performance logs to see what exactly is causing it?
  4. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    05 Jul 2023
    Link to this post
    Hi Dmitriy,

    In the Application Settings in the Azure portal can you verify that the Platform Settings is set to 64-bit.

    Regards,
    Rawdon



    Last modified on 05 Jul 2023 13:07 by Rawdon Edghill
  5. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    05 Jul 2023 in reply to Rawdon Edghill
    Link to this post
    Hello Rawdon,

    Yes, it's 64, I've also tried to disable Cache Invalidation

    https://www.crmportalconnector.com/developer-network/documentation/setup-portal-connector/setup/disable-the-cache-invalidation-plugin

    Didn't seem to help :(
  6. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    05 Jul 2023
    Link to this post
    Hi Dmitriy,

    Thank you for confirming. 

    It was recommended to update your TPC build to the lates build 6.2.0.104.

    Please give this a try in your dev environment and let us know.

    Regards,
    Rawdon
  7. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    07 Jul 2023 in reply to Rawdon Edghill
    Link to this post
    Unfortunately looks like it's still happening on 6.2.0.104, although feels less frequent. Could you please ask what it could be related to? Some sort of caching of Contacts that happens from time to time? Maybe there is a way to control at which time it will happen?
  8. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    07 Jul 2023
    Link to this post
    Hi Dmitriy,

    Can you verify if the form that is being submitted has custom workflows attached to its submission?

    How are you measuring the time?

    How long does it take to submit?

    Is this being tested on a dev environment or a live production site? If the latter, how many concurrent users are on the site?

    Regards,
    Rawdon
  9. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    10 Jul 2023 in reply to Rawdon Edghill
    Link to this post
    Hi Rawdon,

    We were testing different entities including ones that have no plugins or workflows attached to them and they were also showing this issue.

    We're measuring time with visual observation, usually form submission is under 10 sec but in some cases it's 90-120 seconds and it seems to happen randomly. 

    We're testing on Dev portal with 1 user, it connected to Sandbox CRM, also this CRM has one more portal connected to it (Copy of Dev Portal for external testing) with not more than 10 concurrent users.

    We noticed that this slow submit happens after some idle time, so it looks like TPC reinitializing CRM connection and it takes this long.

    I will add tom tracing on ITpcPostMvcFormSubmitEvent and ITpcPreMvcFormSubmitEvent, maybe it will shed some light.

    Thank you, please let me know if you have any ideas.
  10. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    10 Jul 2023 in reply to Dmitriy Razumov_2
    Link to this post
    I've added this code to Global.asax.cs

    void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
    {
      if (e.CommandName == "Bootstrapped")
      {
        EventHub.Subscribe<ITpcPostMvcFormSubmitEvent>(PostFormSubmitEventHandler);
        EventHub.Subscribe<ITpcPreMvcFormSubmitEvent>(PreFormSubmitEventHandler);

      }
    }

    private void PreFormSubmitEventHandler(ITpcPreMvcFormSubmitEvent @event)
    {
                TracingHelper.Trace("PreFormSubmitEventHandler Start");
                if (@event.Connection == null)
                TracingHelper.Trace("Pre Connection is null");
                else TracingHelper.Trace("Pre Connection is NOT null");
    }

    private void PostFormSubmitEventHandler(ITpcPostMvcFormSubmitEvent @event)
    {
                TracingHelper.Trace("PostFormSubmitEventHandler Start");
                if (@event.Connection == null)
                    TracingHelper.Trace("Post Connection is null");
                else TracingHelper.Trace("Post Connection is NOT null");
    }

    I've submitted form on 8:30:26 AM, it was showing progress bar until 8:32:00 AM, the tracing shows this:

    ----------------------------------------
    ----------------------------------------
    Timestamp: 7/10/2023 8:31:54 AM
    Message: [f45643b5-2ee0-e911-a812-000d3af4363f] - PreFormSubmitEventHandler Start

    ----------------------------------------
    ----------------------------------------
    Timestamp: 7/10/2023 8:31:54 AM
    Message: [f45643b5-2ee0-e911-a812-000d3af4363f] - Pre Connection is NOT null

    ----------------------------------------
    ----------------------------------------
    Timestamp: 7/10/2023 8:31:56 AM
    Message: [f45643b5-2ee0-e911-a812-000d3af4363f] - PostFormSubmitEventHandler Start

    ----------------------------------------
    ----------------------------------------
    Timestamp: 7/10/2023 8:31:56 AM
    Message: [f45643b5-2ee0-e911-a812-000d3af4363f] - Post Connection is NOT null

    ----------------------------------------


    So it looks like even PreFormSubmitEventHandler fires at the end of the submission.
  11. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    10 Jul 2023 in reply to Dmitriy Razumov_2
    Link to this post
    One of our developers (recalling his conversations with Adam Benoit) thinks that it's caused by TPC losing connection to Dynamics and reinitializing it again, and it's taking some time. Is there a way to configure somehow TPC in order for it to hold this connection indefinitely instead of releasing it after some idle time?
  12. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    10 Jul 2023
    Link to this post
    Hi Dmitriy,

    If the portal site turns off due to inactivity, then its possible that it takes a long while to submit to the CRM as the site is warming up. But in a live production site, submission shouldn't exceed 10 seconds for 100 concurrent users if the web app is set to always be on and the submission doesn't depend on CRM workflows. 

    I've brought this to the attention of our QA rep and he will re-test the recent build to see if there any anomalies on 6.2.

    Regards,
    Rawdon
  13. Dmitriy Razumov_2
    Dmitriy Razumov_2 avatar
    31 posts
    Registered:
    20 Jul 2020
    11 Jul 2023 in reply to Rawdon Edghill
    Link to this post
    Thank you Rawdon, please let me know how it goes.

    Also, looks like this warmup is happening after like 10-15 minutes of idle time which seems too soon.
  14. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    13 Jul 2023
    Link to this post
    Hi Dmitriy,

    QA testing on 62/144 shows that Ajax submit for 100 concurrent users repeated over 5 minutes averaged 6-7 seconds. There may be a configuration on the app server where the portal site goes idle and that may be causing some issues.

    Regards,
    Rawdon
14 posts, 0 answered