# Limit Perspective Sessions/Pages

**URL:** <https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 21, 2022, 5:01pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888 "2022-12-21T17:01:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 21, 2022, 5:01pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/1 "2022-12-21T17:01:13Z")

</div>

Is there a way for Ignition to internally limit & reject Sessions and/or Pages? During some benchmarking there were enough pages open that it crashed the gateway, and then went into a cyclic cycle of restarting, trying to handle all sessions, and then crashing again. I could put a script on session startup that checks for a session and page count and redirects to a view with no data (barring that session startup scripts occur before any of the "old" views are requested to be loaded again), but I'm wondering if it can be handled by Ignition before any of that, or if it's planned for a future release?

---

<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:** [December 21, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/2 "2022-12-21T17:14:44Z")

</div>

You can ask Sales for a limited license, which the platform will enforce.

---

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 21, 2022, 5:41pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/3 "2022-12-21T17:41:55Z")

</div>

Is the limit configurable in the gateway at all, or is it strictly from the license?

---

<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:** [December 21, 2022, 5:49pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/4 "2022-12-21T17:49:02Z")

</div>

No, mostly because I don't think anyone has ever asked us for it before. As of 8.1.23 you can terminate sessions from the gateway web UI: [Ignition 8.1.23: UDT Hierarchy Tool, System Cleanup Properties, IdP Password Reset Support | Inductive Automation](https://inductiveautomation.com/blog/ignition-8123-udt-hierarchy-tool-system-cleanup-properties-idp-password-reset-support)

That capability means there's some kind of hook in the backend. In theory, you could script something that would attempt to terminate sessions based on your criteria. Such a thing would be officially unsupported (the license parameter is the only currently supported mechanism) but doable.

---

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 21, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/5 "2022-12-21T18:05:46Z")

</div>

Understanding it would not be officially supported, are you able to point me in the direction where I could find that hook?

And I take it the license configuration limits sessions, not pages?

---

<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:** [December 21, 2022, 6:17pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/6 "2022-12-21T18:17:12Z")

</div>

PerspectiveContext has a `getSessionMonitor`: [PerspectiveContext](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.23/com/inductiveautomation/perspective/gateway/api/PerspectiveContext.html)  
Once you have it, you can find a session by ID: [PerspectiveSessionMonitor](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.23/com/inductiveautomation/perspective/gateway/session/PerspectiveSessionMonitor.html#findSession(java.util.UUID))  
Then the `InternalSession` can be asked to close (or to close a particular page, in theory): [InternalSession](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.23/com/inductiveautomation/perspective/gateway/session/InternalSession.html)

---

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 21, 2022, 8:35pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/7 "2022-12-21T20:35:33Z")

</div>

Found that Session Events + system.perspective.getSessionInfo(), closePage(), and closeSession() can do what I need.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [December 21, 2022, 8:47pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/8 "2022-12-21T20:47:55Z")

</div>

Are you able to share some of your benchmarking results ? Server spec and how many sessions/pages you had open etc ?

---

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 21, 2022, 9:45pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/9 "2022-12-21T21:45:21Z")

</div>

It would be hard to compare against my benchmarks because our views would vary, and I can't quite share the views I used.

But my steps to produce this were:

1. Picked a page with what we thought were the "heaviest hitters"
2. Duplicate that browser tab x times across multiple users
3. Watch gateway resources

I'm sure there are better/more consistent ways of doing this.

A note though: we are using Sepasoft, so after the Ignition service startup, the Sepasoft modules are starting. Incorporated system.mes.isProductionStarted() in Session Events/Startup and closing the session if production isn't started. I haven't tried putting the server into the "restarting loop" after implementing that, but I figure it's likely since x pages crashed the server, and they are going to try again once it starts back up.

YMMV

---

<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:** [December 21, 2022, 10:28pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/10 "2022-12-21T22:28:28Z")

</div>

Consider splitting your server into frontend/backend duties. I/O and production critical activities on the backend server, and general users on the frontend servers. Expose the I/O to the frontend via remote tag providers. Since Perspective has to run all customization on the gateway, it suffers much higher loads than Vision as numbers of users climb.

---

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [December 22, 2022, 7:12pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/11 "2022-12-22T19:12:10Z")

</div>

Felt like this was going to be necessary but this "discovery" is fast tracking that. I'd say it's vital for any system that is critical (MES, for example).

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 22, 2022, 7:37pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/12 "2022-12-22T19:37:49Z")

</div>

> [@paul-griffith](#):
>
> As of 8.1.23 you can terminate sessions from the gateway web UI

This was always\* available via scripting though. You can terminate sessions with system.perspective.closeSession

Edit: I see the OP already found this
