# Gateway-tags-eventscripts

**URL:** <https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306>\
**Category:** Ignition\
**Created:** [August 17, 2018, 3:00pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306 "2018-08-17T15:00:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [August 17, 2018, 3:00pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/1 "2018-08-17T15:00:04Z")

</div>

Hi everyone

We are extensively using tag change value script. Thoses script does a lot of thing and are very usefull because they can be coded in UDT. So when we create a new instance of a UDT, all the scripts are automaticly created.

Now the problem is when many tags change values at the same time, we experiment some lags in the script execution.

We look in the threads page and the is 3 threads that seem to execute all the change values script:  
gateway-tags-eventscripts-3,  
gateway-tags-eventscripts-2,  
gateway-tags-eventscripts-1

Is there a way to increase the number of threads that are responsible to execute thoses scripts?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 17, 2018, 3:17pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/2 "2018-08-17T15:17:28Z")

</div>

Add an override for `ignition.tags.scriptthreads` to the `ignition.conf` file, in the `wrapper.java.additional` settings, then restart the gateway.  
`wrapper.java.additional.<x>=-Dignition.tags.scriptthreads=5`

Try to keep the changes _sane_ - giving yourself a hundred event script threads is _not_ going to help performance, and is actually a terrible idea. There’s often a better way to structure things to avoid bogging the event executors down (ie, using async threads spawned from event scripts _can_ be the better approach; it depends entirely on what these scripts are doing)

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [October 20, 2018, 4:08pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/3 "2018-10-20T16:08:23Z")

</div>

I’m trying to increase the maximum thread number to 5 using the syntax you gave but it does not work…

Is that syntax correct?  
wrapper.java.additional.\<7\>=-Dignition.tags.scriptthreads=5

I also tried:  
wrapper.java.additional.\<7\>=-Ignition.tags.scriptthreads=5

Still no more than 3 threads…

Thanks.

---

<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:** [October 20, 2018, 4:14pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/4 "2018-10-20T16:14:28Z")

</div>

> [@Vince](#):
>
> Is that syntax correct?wrapper.java.additional.\<7\>=-Dignition.tags.scriptthreads=5

You don't put the angle brackets. Follow the lead of the other parameters in your config file.

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [October 20, 2018, 4:25pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/5 "2018-10-20T16:25:00Z")

</div>

Still does not work.  
Here is the complete option block:

```auto
# Java Additional Parameters
wrapper.java.additional.1=-XX:+UseConcMarkSweepGC
wrapper.java.additional.2=-XX:+CMSClassUnloadingEnabled
wrapper.java.additional.3=-Ddata.dir=data
wrapper.java.additional.4=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
#wrapper.java.additional.5=-Xdebug
#wrapper.java.additional.6=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
wrapper.java.additional.5=-Dignition.tags.scriptthreads=5

```

What am I missing?

---

<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:** [October 20, 2018, 4:37pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/6 "2018-10-20T16:37:12Z")

</div>

> [@Vince](#):
>
> wrapper.java.additional.5=-Dignition.tags.scriptthreads=5

The last line should look like this:

`wrapper.java.additional.7=-Dignition.tags.scriptthreads=5`

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [October 20, 2018, 4:41pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/7 "2018-10-20T16:41:00Z")

</div>

The “D” in “Dignition” is not a typo?

---

<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:** [October 20, 2018, 4:45pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/8 "2018-10-20T16:45:34Z")

</div>

No, it’s supposed to be there.

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [October 20, 2018, 4:59pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/9 "2018-10-20T16:59:03Z")

</div>

> [@Vince](#):
>
> scriptthreads

Hum... Ok I'm trying the exact line wou gave me and it's not working.

---

<div class="post-metadata">

**Author:** ![Vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Vince](https://forum.inductiveautomation.com/u/Vince)\
**Post date:** [December 17, 2018, 1:45pm UTC](https://forum.inductiveautomation.com/t/gateway-tags-eventscripts/19306/10 "2018-12-17T13:45:52Z")

</div>

Just to let everyone know…

Finally we had to update our gateway to make it work. We were using 7.9.3 and now we use 7.9.9. I think it is impossible to have more than three threads until 7.9.5.
