skip to Main Content

Hi I currently have a magento 1.9 site which i use session storage as files as i find that using the database is very slow.

I currently have about 16 gig of session files which i want to delete.

If I run:

find . -name ‘sess*’ -mtime +7 -exec rm -f {} ;

The site grinds to a halt and then kills the database attached.

I then looked at garbage collection I changed:

session.gc_probability = 1
session.gc_divisor = 100

When I did this and restarted apache the site crashed too?

What would be the best way to remove these files?

2

Answers


  1. You can delete the whole folder, from your Magento Root with the following

    rm -rf var/session/*
    

    Also, if you have enought RAM, you should consider using Redis to store session. Here is a nice tuto for Magento 1.

    Login or Signup to reply.
  2. first go to the var/session folder of the magento root directory

    find . -name "*" -print | xargs rm -rf
    

    This command will delete all the data in the current folder without prompting you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search