# Very high CPU usage on some projects

**URL:** <https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177>\
**Category:** APM\
**Tags:** php\
**Created:** [February 22, 2023, 12:25pm UTC](https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177 "2023-02-22T12:25:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandro.silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandro.silva/32/117231_2.png) [@leandro.silva](https://discuss.elastic.co/u/leandro.silva)\
**Post date:** [February 22, 2023, 12:25pm UTC](https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177/1 "2023-02-22T12:25:10Z")

</div>

I installed elastic apm on some projects, a front in PHP and some APIs. The front doen not use any database directly only through the APIs and the CPU went crazy for all front instances. We revert the version, which in turn disabled the elastic php agent and the CPU went down.

Today, I selected an instance (from the front and from another high requested API), installed the agent again and the CPU immediately went up. After a few minutes, I disabled it.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/5/f59ae16cb4d0c1192cd1a856dbd6c80ed1f034f2.png)

There are other people with the same problem as posted on [github](https://github.com/elastic/apm-agent-php/issues/839) but no response yet.

We'd love to use Observability on all our APIs and fronts but the cost to maintain high CPU usage is too high.

Any suggestions?  
Regards,  
Leandro

---

<div class="post-metadata">

**Author:** ![leandro.silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandro.silva/32/117231_2.png) [@leandro.silva](https://discuss.elastic.co/u/leandro.silva)\
**Post date:** [February 23, 2023, 2:36pm UTC](https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177/2 "2023-02-23T14:36:25Z")

</div>

I installed the agent on a new instance and disabled all instrumentations (curl,db,http-client,pdo) and the CPU went up from 10% to 30%.

Then, I enabled db and pdo and the CPU went up from 35% to 60%. Then I disabled the agent and CPU wen to 10% again.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df84753ebc02b48f78e051558c1c11b59a4ab999.jpeg)

---

<div class="post-metadata">

**Author:** ![leandro.silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandro.silva/32/117231_2.png) [@leandro.silva](https://discuss.elastic.co/u/leandro.silva)\
**Post date:** [March 9, 2023, 10:40am UTC](https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177/3 "2023-03-09T10:40:02Z")

</div>

Updating the issue. The Elastic team released the 1.8.1 version and I believe it's fixed.

At 7:15, I installed the agent on 2 instances, one with 1.8.0 (blue line) and one with 1.8.1 (yellow). The CPU with 1.8.0 immediately went up. Ten minutes later I upgraded the blue to 1.8.1 and CPU went down.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/9/c9cf381c206ccfc959f3aad19996258591669a05.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 30, 2023, 6:40am UTC](https://discuss.elastic.co/t/very-high-cpu-usage-on-some-projects/326177/4 "2023-03-30T06:40:50Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
