# Ignition Server Delay

**URL:** <https://forum.inductiveautomation.com/t/ignition-server-delay/52718>\
**Category:** Ignition\
**Created:** [November 4, 2021, 12:26pm UTC](https://forum.inductiveautomation.com/t/ignition-server-delay/52718 "2021-11-04T12:26:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bogdan](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Bogdan](https://forum.inductiveautomation.com/u/Bogdan)\
**Post date:** [November 4, 2021, 12:26pm UTC](https://forum.inductiveautomation.com/t/ignition-server-delay/52718/1 "2021-11-04T12:26:43Z")

</div>

Hi guys,  
Got here something and I don’t know how to approach it.  
Sort story long….

The basic usage of the gateway:  
pull data from PLC \>\> process data \>\> send it (database or API calls)

I have a problem that appears randomly, and I can’t find the root cause.  
Sometimes I’m getting a delay in reading / writing values to devices (Siemens PLCs).  
Most of our scripts are set up in tags \> value change event

Example of situation:  
We are testing a new project and the plc programmer is sending new values at a specific address.  
The value change event is triggered, data is processed and inserted into db.  
After few minutes of testing… I keep receiving new values from the PLC, in the designer interface the values are updated, but the data is not reaching database, after 5 minutes all the data appeared at once.

Any idea how to approach this?  
Do you think is more of a Ignition problem or something related to our network?

**Overview** :

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/9/798faa357dc3b091929c2fafaa35402996ec61d6.png)  
**Performance** :  
 ![2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/897005edadc7e6631380ca60f9c7a641bac5e6a1.png)  
**Database** :  
 ![3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/311395d4dae3fca18fcf0c1d7e558ee314fd4ad4.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [November 4, 2021, 12:31pm UTC](https://forum.inductiveautomation.com/t/ignition-server-delay/52718/2 "2021-11-04T12:31:06Z")

</div>

How are you inserting the data into the database? I assume a `system.db.runPrepUpdate` query in your tag change event somewhere. If that is failing, you should see logs in your gateway telling you that the query failed, and whatever database you’re using should send you an error message as to why.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 4, 2021, 12:31pm UTC](https://forum.inductiveautomation.com/t/ignition-server-delay/52718/3 "2021-11-04T12:31:23Z")

</div>

It’s possible that one or more of your tag event scripts are blocking doing IO or otherwise taking longer than you expect.

When you notice that things are backed up or delayed again try to get a thread dump from the gateway status \> threads page.

---

<div class="post-metadata">

**Author:** ![Bogdan](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Bogdan](https://forum.inductiveautomation.com/u/Bogdan)\
**Post date:** [November 4, 2021, 2:15pm UTC](https://forum.inductiveautomation.com/t/ignition-server-delay/52718/4 "2021-11-04T14:15:01Z")

</div>

I’m using system.db.runUpdateQuery(), but we didn’t receive any errors, the data arrived in the DB, but with huge delay, approx. 5 mins
