Date:  06/19/2008 12:39:02 AM Msg ID:  003758
From:  jc clerc Thread:  003750
Subject:  Re: Cleaning the _fwsession table ?
Thanks a lot for this reply.
The safest way will be to simply restart foxweb service at night everyday using the basic command : net stop "Foxweb" then net start "Foxweb" thru a automated  .bat file.
Thanks again.
 
JC 
 
 
 
Sent by FoxWeb Support on 06/18/2008 12:22:53 PM:
Hi JC,
 
FoxWeb uses an intelligent algorithm to re-use records in the _fwsession table and also packs this table on startup.
 
Session variables are stored in memo fields in _fwsession.  Each user's session is stored in a separate record and all session variables are stored in a single memo field, using the SAVE MEMO statement.
 
As you may know, in VFP, whenever the contents of a memo field are altered, the space occupied by the previous contents in the FPT file is not released, but rather, additional space is allocated for the new contents.  The old space is simply left in the file and marked as unused.  This space is not reclaimed, until the table is packed.
 
What this means is that, if even a single session variable is changed in a particular request, the entire memo field, holding all session variables for the current user, is affected and the space occupied by the memo field is doubled.  In general this should not be much of a problem with regard to performance, but it does cause the consumption large amounts of hard-drive space.  I recommend the following:
 
  • Never use session variables for information that is page-specific.  Session variables should only contain information that applies to the whole session.  Page-specific information should be transferred via form fields, or the query string.  Keeping page-specific information in session variables will cause problems in situations where the user moves around with the browser's Back/Forward buttons.
  • Write a separate VFP program that attempts to pack _fwsession during periods of low activity.   Call this program with the Windows Scheduler.  Make sure that the program opens the table exclusively (required in order to use the PACK statement) and then closes it immediately.  Include error trapping code, so that the program does not get stuck if the table is in use.
FoxWeb Support Team
support@foxweb.com email
Sent by jc clerc on 06/17/2008 12:14:12 AM:
Hello,
Is there a way to kill definitly terminated session from the _fwsession files, I end up with 400 MB even 1 Giga !!! with only 20-25 users connnected to my application. Once I restart the service I go back to a normal 10 to 50 Meg. 
The session life is set at 4 hours they should die after that ?
When I go look at the _fwsession table I see many sessions that are not valid anymore. 
 
Also is there a way to get real time list of "session + user" connected ? 
 
Thanks
JC