LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > Swap Folder Cleanup

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2010, 05:47 PM
Tony Tony is offline
Senior Member
 
Join Date: Dec 2008
Posts: 133
Default Swap Folder Cleanup

I'd really like to see some sort of cleanup of the swap folder. It stores a few things in there so I'll address these in separate points.

1) The gzip files data stored should have some sort of cleanup of old files mechanism. It seems like it just grows over time so it hits 500MB of gzip files then 2 weeks it's 1GB. I'm sure we could put it in a partition with 100GB and eventually we'd fill it. So some sort of cleaning up mechanism that is used to clean up files not used or written x amount of time ago. I'd obviously say based on access time but not sure if that data would be available to LSWS or not or how it handled it.


2) Cleaning up of partially uploaded files. This does not seem to be happening. So over time it can grow quite large due to this. So I'd like to have it say remove attempted uploaded files after a period of time and there is no connection using it. There is no point in having a bunch of 20MB uploaded files that are not used by anything.



Right now we wipe the swap folder every few weeks but I don't think that's a great solution. We'd rather see LSWS pro actively cleaning up unused files in this folder. There is no point in keeping gzipped files that were last accessed a week and a half ago. There is also no point in keeping partially uploaded files either.
__________________
Hawk Host
Frog Host
Reply With Quote
  #2  
Old 06-04-2010, 07:22 PM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
I'll second this one.
Reply With Quote
  #3  
Old 06-06-2010, 03:37 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
OK, we will do something about it.
Actually, those files can be safely removed with "cd swap_dir; rm -rf *".
Reply With Quote
  #4  
Old 07-07-2010, 08:27 PM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
Quote:
Originally Posted by mistwang View Post
OK, we will do something about it.
Actually, those files can be safely removed with "cd swap_dir; rm -rf *".
So basically we can just rm -rf all the folders under the swap dir and LSWS will just recreate the structure? Does LSWS need to be down when we do that?
Reply With Quote
  #5  
Old 07-07-2010, 08:40 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
that's correct, not need to bring down LSWS.
Reply With Quote
  #6  
Old 07-31-2010, 05:20 PM
Tony Tony is offline
Senior Member
 
Join Date: Dec 2008
Posts: 133
Quote:
Originally Posted by mistwang View Post
OK, we will do something about it.
Actually, those files can be safely removed with "cd swap_dir; rm -rf *".

Looks like it's part of 4.0.16. Any more details on what exactly the cleanup does?
__________________
Hawk Host
Frog Host
Reply With Quote
  #7  
Old 08-01-2010, 06:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
It calls lsws/admin/misc/cleancache.sh once a day. The behavior can be customized via the shell script. Default is to remove file more than one day old based on modified time. Can be changed to based on last access time, but some system may use "noatime" option when mount the partition.
Reply With Quote
  #8  
Old 08-07-2010, 03:05 PM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
How does it get called (cron etc.) because it's doing nothing on at least one server.
Reply With Quote
  #9  
Old 08-07-2010, 03:14 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
It was called by LSWS server daemon when server check for new update. So, you should let LSWS check for update daily instead of monthly in order for daily cleanup.
Reply With Quote
  #10  
Old 08-07-2010, 03:54 PM
ffeingol ffeingol is offline
Senior Member
 
Join Date: Jul 2007
Location: /dev/null
Posts: 290
check for updates is already set to daily. Is the execution logged anywhere so we can see why it's not working (or maybe not even running)?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:51 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.