# Elastic Machine learning, Datafeed has missed xxx documents due to ingest latency

**URL:** <https://discuss.elastic.co/t/elastic-machine-learning-datafeed-has-missed-xxx-documents-due-to-ingest-latency/332870>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning\
**Created:** [May 9, 2023, 6:17am UTC](https://discuss.elastic.co/t/elastic-machine-learning-datafeed-has-missed-xxx-documents-due-to-ingest-latency/332870 "2023-05-09T06:17:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonREC](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JasonREC](https://discuss.elastic.co/u/JasonREC)\
**Post date:** [May 9, 2023, 6:17am UTC](https://discuss.elastic.co/t/elastic-machine-learning-datafeed-has-missed-xxx-documents-due-to-ingest-latency/332870/1 "2023-05-09T06:17:27Z")

</div>

Hi,

I currenly have a APM server which running on cloud and receiving my php app transaction log.  
Basiclly, request will keep sending to my php api endpoint.

And, I am using the APM generated index pattern log to feed my machine learning but no matter how long I set the delayed query, it still saying that there is docs missing due to injest laterncy.

I have no clue how I can fix this issue since I was hoping to have a real time datafeed, but now even I delay the query to 30 minutes and still having this issue.

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e6f98167d8d63f39776e60f27740db25e4f74f0c.png)  
 ![2](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f0b4659879929ab010e0932d7eb6a925edafe96.png)  
 ![3](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbc532e0cd6328a742978b898e1f631581103ee4.png)

**update**  
I increased the query delay to 50mimutes, and still facing the same issue.  
I wonder if this could be due to the spec of instance which use to do machine learning job  
Here is some config indetails:

 ![4](https://us1.discourse-cdn.com/elastic/original/3X/1/9/19a39ae929c68a13f864315b56c5f1c40efcef07.png)  
 ![5](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b29c102b91b1060f56225db9b9680bd0eaf64ad7.png)

---

<div class="post-metadata">

**Author:** ![valeriy42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valeriy42/32/82758_2.png) [@valeriy42](https://discuss.elastic.co/u/valeriy42)\
**Post date:** [May 15, 2023, 8:25am UTC](https://discuss.elastic.co/t/elastic-machine-learning-datafeed-has-missed-xxx-documents-due-to-ingest-latency/332870/2 "2023-05-15T08:25:44Z")

</div>

Hello @JasonREC ,

to troubleshoot, consider running the query from your datafeed and observe the difference between `@timestamp` and `ingest_time`. This will give you the feeling of what `query_delay` should be on your system.

---

<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:** [June 12, 2023, 8:25am UTC](https://discuss.elastic.co/t/elastic-machine-learning-datafeed-has-missed-xxx-documents-due-to-ingest-latency/332870/3 "2023-06-12T08:25:56Z")

</div>

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