# Chart connection lost to database intermittently

**URL:** <https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259>\
**Category:** Ignition\
**Created:** [September 6, 2017, 8:14am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259 "2017-09-06T08:14:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 6, 2017, 8:14am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/1 "2017-09-06T08:14:29Z")

</div>

Chart becomes red & disconnects from database intermittenlty. It becomes normal after 4-5 seconds. What may be the reason. Is it java problem??? It happens in Linux as well as WIndows Clients. We have the Ignition 7.9 version running on Linux Ubuntu Server with Postgres database.

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [September 6, 2017, 12:14pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/2 "2017-09-06T12:14:41Z")

</div>

How many queries/sec are you running? I have seen charts disconnect from my database before and it basically came down to the database connection faulting because the gateway was trying to push too much data into the alarm events table (a fault on my setup by the way).

Check to see if you see any error messages on the gateway console.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 6, 2017, 12:43pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/3 "2017-09-06T12:43:51Z")

</div>

Are you charting from the tag historian, or other data (transaction groups or other sources)? If not from the tag history system, it’s extremely important to create useful indices on the columns of your data that are used in the WHERE and ORDER BY clauses of the chart’s queries.

---

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 13, 2017, 11:02am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/4 "2017-09-13T11:02:15Z")

</div>

Ofcourse I am charting from the tag historian…

---

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 13, 2017, 11:03am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/5 "2017-09-13T11:03:21Z")

</div>

Is there any limit on queries/sec???

---

<div class="post-metadata">

**Author:** ![accyroy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/accyroy/32/3386_2.png) [@accyroy](https://forum.inductiveautomation.com/u/accyroy)\
**Post date:** [September 13, 2017, 11:09am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/6 "2017-09-13T11:09:13Z")

</div>

In theory you are only limited by your hardware!  
You probably need to tune your database installation, if you’ve just installed it and kept the default settings it’s performance will most likely be poor.  
Check this site out for more details: [https://wiki.postgresql.org/wiki/Tuning\_Your\_PostgreSQL\_Server](https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server)

---

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 13, 2017, 11:16am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/7 "2017-09-13T11:16:28Z")

</div>

Thank you it is a very useful link…

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [September 13, 2017, 12:20pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/8 "2017-09-13T12:20:16Z")

</div>

There is not a hard set limit. The more you are running, the harder your gateway has to work. I think Inductive has told me they have ran over 100 queries/sec without any problems.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [September 13, 2017, 5:31pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/9 "2017-09-13T17:31:54Z")

</div>

Ever since I realized the power of Transaction Groups I never looked back… I still don’t use tag historian 🕶 not even once ( is that bad? 😛)  
Only time I’ve seen issues with chart connection was either there was an issue with my internet connection or there was a DB connection issue or if the query doesn’t return the result that works with the chart and therefore it freaks out and turns red out of shame of not being able to handle the data ( sarcasm lol).

---

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 14, 2017, 5:29am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/10 "2017-09-14T05:29:05Z")

</div>

ThanQ for reply… I will try with Transaction Group…

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [September 14, 2017, 4:10pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/11 "2017-09-14T16:10:09Z")

</div>

I feel like we still haven’t figured out whats going on with the chart acting up like that because if it is connection issue, using Transaction groups won’t fix the issue. Don’t get me wrong it will make your life so much easier but still need to figure out why the chart is losing connection.  
does it happen often? or just once a while?

---

<div class="post-metadata">

**Author:** ![BHASKAR](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BHASKAR](https://forum.inductiveautomation.com/u/BHASKAR)\
**Post date:** [September 15, 2017, 11:19am UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/12 "2017-09-15T11:19:50Z")

</div>

It happens frequently… But one thing I have observed data is not lost… I could able to get the data during that time interval…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 15, 2017, 12:39pm UTC](https://forum.inductiveautomation.com/t/chart-connection-lost-to-database-intermittently/15259/13 "2017-09-15T12:39:49Z")

</div>

This sort of problem is often an overloaded or poorly optimized database, where the slug of data for the chart sometimes exceeds the timeout in the client configuration. It is critically important to add useful indices to all tables, especially on t\_stamp columns.
