homepage Welcome to WebmasterWorld Guest from 54.161.220.160
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Webmaster Hardware
Forum Library, Charter, Moderator: open

Webmaster Hardware Forum

    
PHP Sessions & Hard Drive integrity
Creating and unsetting many sessions; impact on hard drive
max4

5+ Year Member



 
Msg#: 3928003 posted 9:44 pm on Jun 6, 2009 (gmt 0)

Hello,

I've noticed that I'm using sessions quite a bit to keep track of data and plan on undertaking a project that will use even more sessions. From what I understand, when a session is created a file is also created on the server. My use of sessions involves creating them, and then unsetting them when I'm done with them; sometimes this unsetting occurs at the end of a page, sometimes soon after the session is created.

I'm concerned that all this session setting and unsetting will cause the hard drive to become heavily fragmented; especially with large amounts of traffic. Is there need for concern here or should I proceed with my project?

Thank you.

 

mcavic

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3928003 posted 2:51 am on Jun 7, 2009 (gmt 0)

If this is a Linux server, it won't be a problem at all. Linux is equipped to handle a large number of files, and fragmentation is rarely an issue, if ever.

Windows can choke on a folder with thousands of files, but if the overall site/server performance is good, the sessions really shouldn't make much of a difference.

max4

5+ Year Member



 
Msg#: 3928003 posted 3:26 am on Jun 7, 2009 (gmt 0)

Thank you mcavic. It will be a Linux server.

jkovar

5+ Year Member



 
Msg#: 3928003 posted 12:53 am on Jul 5, 2009 (gmt 0)

sometimes this unsetting occurs at the end of a page, sometimes soon after the session is created.

You might want to look into using memcache [php.net] (it provides a session.save_handler) , especially if you're creating and deleting sessions within the same request often.

Sessions don't have to be saved on disk.

lammert

WebmasterWorld Senior Member lammert us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3928003 posted 4:35 am on Jul 9, 2009 (gmt 0)

If there is no need to keep sessions during a server reboot, you can create a partition as an automatically sizing ramdisk with the tmpfs attribute in /etc/fstab and mount this partition at the location where you normally store your sessions. See man mount for more details.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Webmaster Hardware
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved