# Session table in database contains 600,000+ records and growing - negatively affecting performance

**URL:** <https://dev.lucee.org/t/session-table-in-database-contains-600-000-records-and-growing-negatively-affecting-performance/496>\
**Category:** google-group-archive\
**Created:** [January 6, 2017, 2:50pm UTC](https://dev.lucee.org/t/session-table-in-database-contains-600-000-records-and-growing-negatively-affecting-performance/496 "2017-01-06T14:50:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Repas](https://dev.lucee.org/user_avatar/dev.lucee.org/david_repas/32/506_2.png) [@David\_Repas](https://dev.lucee.org/u/David_Repas)\
**Post date:** [January 6, 2017, 2:50pm UTC](https://dev.lucee.org/t/session-table-in-database-contains-600-000-records-and-growing-negatively-affecting-performance/496/1 "2017-01-06T14:50:43Z")

</div>

Hi. I’m running Lucee 5 on Windows 2012 (EC2) connected to MySQL (RDS). I  
use sessions that are stored in that database. Over the last month the  
records in my sessions table has grown to over 600,000+ records. Nearly all  
of these records have a last visit of days or even weeks. My sessiontimeout  
in application.cfc is 90 minutes.

This has significantly affected performance. Using Pingdom, my response  
time is currently over 5,000 ms. If I clear the sessions table of all  
records, the response time goes down to ~500 ms.

It’s getting worse everyday. Any thoughts on what’s going on? What can I do  
to improve performance? Should there be a session record cleanup going on?

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![markdrew](https://dev.lucee.org/user_avatar/dev.lucee.org/markdrew/32/78_2.png) [@markdrew](https://dev.lucee.org/u/markdrew)\
**Post date:** [January 6, 2017, 3:07pm UTC](https://dev.lucee.org/t/session-table-in-database-contains-600-000-records-and-growing-negatively-affecting-performance/496/2 "2017-01-06T15:07:07Z")

</div>

Well, I think you should do the following:

1. add indexes if they are not in there
2. remove old sessions. You should implement your own cleanup (lucee doesn’t’ do it)

Mark Drew

CMD  
develop • deploy • deliver  
[http://cmdhq.io+44](http://cmdhq.io+44) 7971 852296\> On Jan 6, 2017, at 2:50 PM, David Repas \<@David\_Repas\> wrote:

> Hi. I’m running Lucee 5 on Windows 2012 (EC2) connected to MySQL (RDS). I use sessions that are stored in that database. Over the last month the records in my sessions table has grown to over 600,000+ records. Nearly all of these records have a last visit of days or even weeks. My sessiontimeout in application.cfc is 90 minutes.
> 
> This has significantly affected performance. Using Pingdom, my response time is currently over 5,000 ms. If I clear the sessions table of all records, the response time goes down to ~500 ms.
> 
> It’s getting worse everyday. Any thoughts on what’s going on? What can I do to improve performance? Should there be a session record cleanup going on?
> 
> Thanks,  
> David
> 
> –  
> You received this message because you are subscribed to the Google Groups “Lucee” group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [lucee+unsubscribe@googlegroups.com](mailto:lucee+unsubscribe@googlegroups.com)  
> .  
> To post to this group, send email to [lucee@googlegroups.com](mailto:lucee@googlegroups.com)  
> .  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/lucee/1b039da9-84f1-4665-b625-6f88427d1a20%40googlegroups.com](https://groups.google.com/d/msgid/lucee/1b039da9-84f1-4665-b625-6f88427d1a20%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout)  
> .
