2

I am using Yii2 DbSession but after few days I am noticing that the session table now has even those rows whose expiry was few days ago. Currently it has 23376 rows and it is continuously increasing.

Gc Probability is 0 and Session Timeout is 1440

Is there something wrong?

--EDIT-- Actually I want to know that is the gcprobability value to 0 is causing not cleaning of expired session rows?

Future King
  • 3,819
  • 6
  • 28
  • 37
  • Possible duplicate of [Yii2 Session Storage in DB, too many rows? Performance?](https://stackoverflow.com/questions/34309946/yii2-session-storage-in-db-too-many-rows-performance) – Yupik Jul 11 '17 at 10:04
  • As @SilverFire said, all is okay, but im wondering why you set GcPropability to 0? – Yupik Jul 11 '17 at 10:05
  • I didn't set gcProbability to 0. It is the default setting server has. What should be its correct value? – Future King Jul 11 '17 at 10:06
  • Well, i thought you set `$gCProbability` property of `yii\web\DbSession`, otherwise it should be okay. – Yupik Jul 11 '17 at 10:07
  • For tests, you can change `gcPropability` do 50 (for 50%), create some new sessions (old sessions deleting is fired when new one comes) and check if it helps. Standard Yii2 value of `gcPropability` is 1. – Yupik Jul 11 '17 at 10:12
  • I set it to 1 and now my session table rows went to 340 from 23376. Thank you! – Future King Jul 11 '17 at 10:19

0 Answers0