Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance of creating a contact #120

Open
Benema3000 opened this issue May 23, 2022 · 3 comments
Open

Performance of creating a contact #120

Benema3000 opened this issue May 23, 2022 · 3 comments

Comments

@Benema3000
Copy link

Benema3000 commented May 23, 2022

Hello Everyone!

First: Thanks to everyone involved in creating AlexaCRM! Awesome work.

I have a question/issue regarding the performance. I created a really simple example based on your tutorial, where I create a client and then create a contact. The client is created immediately, but it takes around 1 minute to create the contact.

I simply run:
$contact = new \AlexaCRM\Xrm\Entity( 'contact' );
$contact['firstname'] = 'testX';
$contact['lastname'] = 'testX';
$contact['emailaddress1'] = 'test@example.com';
$contactId = $client->Create( $contact );

and the $client->Create call takes 62 seconds. Is this normal? Do I have to do something differently?

Best and thanks!
Ben

Edit: just tried to retrieve a contact, same there. It takes super long.

@georged
Copy link
Contributor

georged commented May 24, 2022

Hey Ben,

one-off hits are not unheard off due to metadata retrieval but 1 minute is quite a lot.

is that on prem or online? If online, I would strongly recommend switching to https://github.com/AlexaCRM/dynamics-webapi-toolkit that uses Web API. (Technically you can use it on-premises as well but I don't believe authentication is implemented yet for this scenario).

  • What about consequent operations, e.g. a create followed by a retrieve?
  • Where is the web server and where's CRM server?
  • Attach the logging to the client - that should give you more details about operation timing, specifically if it's the actual request is taking that long.

HTH
George

@Benema3000
Copy link
Author

It's online, I will try the Web Api then. Thanks!

Should I still test the logging? If so how to do it?

@georged
Copy link
Contributor

georged commented May 24, 2022

I'd say the most probable cause of the poor performance is the latency between your server and Dataverse.

See https://github.com/AlexaCRM/dynamics-webapi-toolkit/wiki/Tutorial regarding the client set up for Web API. Any PSR-3 compliant logger can be wired in. You can also provide cache implementation for better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants