PHP and Linux performance tweaks

From: Date: Sat, 08 Sep 2001 20:49:18 +0000
Subject: PHP and Linux performance tweaks
Groups: php.install 
Request: Send a blank email to php-install+get-4249@lists.php.net to get a copy of this message
Hi all, I am helping someone to reconfigure PHP for a high-traffic site (well... high traffic for one PC to handle, at least). The server is hosted by Rackspace.com, running Linux kernel 2.2.19. I have done all the standard Apache/PHP/MySQL performance tweaks, and I have raised the filesystem and inode limits in /proc/sys/fs. I have read that one performance tweak for Linux is to mount the filesystem with the "noatime" option (meaning the kernel does not update the timestamp whenever files are accessed). The site relies highly on PHP sessions, and it seems to me that there would be trouble with the /tmp/ session files if I configure Linux to mount the filesystem with the "noatime" option. As I understand it, the PHP session mechanism runs a "stat" operation every time it evaluates whether to delete session files. This being the case, I guess the logical assumption here is that it reads the access timestamp to decide whether to delete the session file or not. Am I right here? Is there any way to use the default session mechanism if I mount the filesystem with noatime? If not, is my only option to create a custom session handler? Also, is there any problem using a RAMdisk partition for the directory to handle the session files. I suppose theoretically it would be possible to mount the main filesystem with "noatime", but to create a RAM partition which *does* update the access timestamp, and have PHP use that for the session files. Is there anyone with some experience in this area, who can point me in the right direction? Thanks, Rick Morris

« previous php.install (#4249) next »