# API taking more than 3s for a simple contact search

**URL:** <https://forum.mautic.org/t/api-taking-more-than-3s-for-a-simple-contact-search/21376>\
**Category:** Product Support\
**Created:** [October 22, 2021, 9:15pm UTC](https://forum.mautic.org/t/api-taking-more-than-3s-for-a-simple-contact-search/21376 "2021-10-22T21:15:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulo.maia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulo.maia/32/1100_2.png) [@paulo.maia](https://forum.mautic.org/u/paulo.maia)\
**Post date:** [October 22, 2021, 9:15pm UTC](https://forum.mautic.org/t/api-taking-more-than-3s-for-a-simple-contact-search/21376/1 "2021-10-22T21:15:27Z")

</div>

**Your software**  
My Mautic version is: 4.0.1  
My PHP version is: 7.4.3  
My Database type and version is: 5.7

**Your problem**  
My problem is:  
Currently i only have 3k contacts and using the API for a simple search, each request is taking more than 3s. Using the web interface it only takes milliseconds. I easly reach 100% CPU percentage executing multiple searchs at the same time, like 5 requests.  
I’m using php-fpm and basic auth.  
My server has 2 CPU and 4 GB of RAM.

If someone is facing the same issue or has any idea in how to solve this situation, i would really appreciate the help.

---

<div class="post-metadata">

**Author:** ![paulo.maia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/paulo.maia/32/1100_2.png) [@paulo.maia](https://forum.mautic.org/u/paulo.maia)\
**Post date:** [October 25, 2021, 10:41am UTC](https://forum.mautic.org/t/api-taking-more-than-3s-for-a-simple-contact-search/21376/2 "2021-10-25T10:41:55Z")

</div>

The problem seems to be related with the “Basic auth”. I have implemented the oAuth2.0 and the response times reduced to under 1s.

---

<div class="post-metadata">

**Author:** ![rene.w](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@rene.w](https://forum.mautic.org/u/rene.w)\
**Post date:** [March 14, 2024, 8:00am UTC](https://forum.mautic.org/t/api-taking-more-than-3s-for-a-simple-contact-search/21376/3 "2024-03-14T08:00:50Z")

</div>

I would like to confirm that there seems to be a problem with Basic Auth.

A simple GET on /api/contacts/20 with Basic Auth runs 0.7 seconds on my system. With OAUTH2 in some ms.

The mautic php process has high cpu usage in that 0.7 seconds.

Mautic 5.0.2
