Closed amenk closed 4 years ago
Hi @amenk. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
@amenk do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-Hotel
Thank you for verifying the issue. Based on the provided information internal tickets MC-30631
were created
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@sdzhepa what is the progress of the internal ticket? Can I check that in any way or is it private?
Hello @amenk
I do not see any progress in the internal ticket MC-30631
Jira ticket.
Unfortunately, it still in "Ready for Dev" status
I've noticed that in customer sessions too. I've had two websites in 2.3.1 and the sessions table reached 2.5m entries with none of them being cleared even though they were long past their expiration date.
After running a cleanup sql command to delete all sessions that the expiry timestamp had passed only 27 sessions were left. I think this is really important because the size of the DB increases really fast in popular eshops.
@ioweb-gr which cleanup command did you use? And how long did it run?
Also each and every crawling attempt seems to open a new session - is that normal?
@amenk I think it was pretty straightforward.
I went to https://www.unixtimestamp.com/index.php to get the timestamp for the date before which I wanted to clear the sessions. For example anything that should have expired 15 days ago e.g. 15/5/2020 = 1589500800
I then executed
DELETE FROM `session` where `session_expires` < 1589500800;
But yeah they do pile up really fast. I might have to create a cron job for this at some point.
https://github.com/weprovide/magento2-module-sessioncleaner This might help.
@mischabraam Thank you the module :)
I just realized that it might be an option to store the sessions in Redis as well ...
Was this fixed? What's the relevant pull request?
@sidolov @sdzhepa @gabrieldagama was this issue fixed?
@ihor-sviziev @ioweb-gr The issue was fixed by internal pull request and it is already merged, please let us know if you still face the issue on 2.4-develop branch.
Thanks.
So this will be in 2.4.2, right?
Correct @amenk
Fixed and delivered in https://github.com/magento/magento2/search?q=MC-30631&type=commits
Still happens on the latest Magento version, maybe we just switch to Redis...
Redis has it's own set of issues when heavy traffic on the site
@amenk: did you read the new documentation for the fix @sdzhepa mentioned before?
@hostep Good point. As mentioned in the docs, Ubuntu uses a gc_probability of 0 which was the case for us, so it did not work. We did a short test on staging now 1 / 1 / 10 seconds and sessions are deleted.
So this seems to work now I believe.
Preconditions (*)
Magento 2.2.x & 2.3.x & 2.4-develop
Steps to reproduce (*)
env.php
)Admin Session Lifetime
to 60s for examplesession
table(note the last added data about your session)Expected result (*)
Actual result (*)
Additional information
See also: https://magento.stackexchange.com/questions/300525/is-the-session-table-supposed-to-be-cleaned-up-automatically
Garbage collect is there, but seems to be never called:
https://github.com/magento/magento2/blob/0a1a283cd6a0cf4b98a051867f90150c9490fcec/lib/internal/Magento/Framework/Session/SaveHandler/DbTable.php#L154
shall we make a PR to add this to the core?