Forums / General Questions / What is the best practice to clear old session files from cache?

What is the best practice to clear old session files from cache?

Started by one_tall_man on 25 Sep 2012, 5:00 PM · Views: 2,352

Results 1 to 4 of 4
25 Sep 2012, 5:00 PM
#1
one_tall_man avatar

one_tall_man

Zen Follower

Join Date:
Feb 2009
Posts:
125
Plugin Contributions:
0

What is the best practice to clear old session files from cache?

I started noticing that my site was becoming slower and slower and finally found it was due to 6500+ sessions .log files sitting in the cache folder. Deleting them sped up the site dramatically. How can I make sure no more than a few days of sessions are stored?

My install: was Vanilla 1.3.9h, now 1.5.5b, Apache 2.4, PHP 7.0.6, MySQL 5.5.8 64b, Windows 7 64b, 8GB RAM, i3 3.3gHz
Modules: [Payment=Paypal] [Shipping=Canada Post 1.5.3 merged] [nonCAPTCHA]

25 Sep 2012, 5:05 PM
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: What is the best practice to clear old session files from cache?

they should flush automatically by default. i am not site what coupe stop the flushung. did you set the right folder permissions?

25 Sep 2012, 5:11 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: What is the best practice to clear old session files from cache?

No, the log files do not automatically purge themselves.
You can do a manual clearing of the log files via the Admin->Tools->Store Manager.

Also, if you upgrade to v1.5.1 the problem is mitigated by putting the logs elsewhere. Something to look forward to when you upgrade ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Sep 2012, 6:04 PM
#4
one_tall_man avatar

one_tall_man

Zen Follower

Join Date:
Feb 2009
Posts:
125
Plugin Contributions:
0

Re: What is the best practice to clear old session files from cache?

Design75:

they should flush automatically by default. i am not site what coupe stop the flushung. did you set the right folder permissions?

As it runs on Windows, I don't see any issues with access. If it was on Linux, could have been an issue.

DrByte:

You can do a manual clearing of the log files via the Admin->Tools->Store Manager.

Also, if you upgrade to v1.5.1 the problem is mitigated by putting the logs elsewhere. Something to look forward to when you upgrade ;)

I don't see this site ever being upgraded. We have modules and a bit of customization, which is a royal PITA to upgrade.

My install: was Vanilla 1.3.9h, now 1.5.5b, Apache 2.4, PHP 7.0.6, MySQL 5.5.8 64b, Windows 7 64b, 8GB RAM, i3 3.3gHz
Modules: [Payment=Paypal] [Shipping=Canada Post 1.5.3 merged] [nonCAPTCHA]