Support #149

sessions directory is huge

Added by Brenda Butler over 2 years ago. Updated over 1 year ago.

Status:Closed Start:10/08/2009
Priority:Normal Due date:
Assignee:Brenda Butler % Done:

100%

Category:- Spent time: 4.75 hours
Target version:-
    Velocity: 0.00 beans per hour

Description

sessions directory is huge

doing a directory listing in it takes a long time (does it ever end? I just killed it - had to use kill -9 as plain kill didn't work)
doing a du -s * on the directory above also gets lost in a tarpit.

What's in it? can we clean it up? automatedly?

History

Updated by Brenda Butler over 2 years ago

cache delete.me pids sessions sockets
redmine@code:~/redmine/tmp$ cd sessions
redmine@code:~/redmine/tmp/sessions$ ls | wc
695155 695155 18769185
redmine@code:~/redmine/tmp/sessions$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 10562848 6896592 3129680 69% /
tmpfs 524288 0 524288 0% /lib/init/rw
udev 10240 28 10212 1% /dev
/dev/sda3 20642428 1573640 18020212 9% /repositories
redmine@code:~/redmine/tmp/sessions$

Updated by Brenda Butler over 2 years ago

  • run rake secret and note the output ...
  • edit redmine/config/environment.rb to contain:
config.action_controller.session = {
  :session_key => '_redmine_session',
  :secret      => 'the secret output by the rake secret command'
}
  • also in redmine/config/environment.rb, comment out anything like conf.action_controller.session_store = ??? (as rails defaults to cookie store)
  • restart the redmine server

Updated by Brenda Butler over 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Brenda Butler
  • % Done changed from 0 to 90

Updated by Brenda Butler over 2 years ago

got rid of about 95% of the files

with command like

find redmine/tmp/sessions -type f -ctime +15 -exec rm {} \;

It ran overnight ... but now an ls in that directory finishes in seconds rather than minutes or hours.

Will do this again once per week for another couple of weeks till the directory is empty. As the last few sessions become two weeks old, they will be cleaned up.

I suppose I should just erase it all in one shot, but it's almost done now.

If more session files were being created, a cron job would take care of it.

Updated by Brenda Butler over 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF