Re: Webserver Redundacy
On Wed, Feb 28, 2007 at 04:55:28PM +0000, Andy wrote:
> Craig Sanders wrote:
> >the easiest ways to do this is with a shared or network filesystem
> >(be careful of file locking), or in a database (let the db handle
> >locking issues).
> We are looking an an LVS system as discussed in this thread, with a
> centralised file-system exported over NFS.
> Our sessions are all PHP sessions from /var/lib/php4. If we just NFS
> export this are we going to have horrible locking problems?
it depends on how well written your code is :-)
also, i haven't worked extensively with NFS for several years now, but
it has ALWAYS had a terrible reputation for locking issues. there are
particular ways of doing NFS-safe locking (see, for example the way that
mail servers like postfix do it), and many ways of doing unsafe locking.
> Any suggestions?
my recommendation would be to avoid locking issues entirely and use
either a database or, if you dont want to install postgresql or mysql or
whatever, use memcached and store your session data in the shared memory
memached is packaged for debian.
# apt-cache show memcached php4-memcache
Maintainer: Jay Bonci <firstname.lastname@example.org>
Depends: libc6 (>= 2.3.2.ds1-4), libevent1 (>= 1.0b), perl
Description: A high-performance memory object caching system
Danga Interactive developed memcached to enhance the speed of LiveJournal.com,
a site which was already doing 20 million+ dynamic page views per day for 1
million users with a bunch of webservers and a bunch of database servers.
memcached dropped the database load to almost nothing, yielding faster page
load times for users, better resource utilization, and faster access to the
databases on a memcache miss.
memcached optimizes specific high-load serving applications that are designed
to take advantage of its versatile no-locking memory access system. Clients
are available in several different programming languages, to suit the needs
of the specific application. Traditionally this has been used in mod_perl
apps to avoid storing large chunks of data in Apache memory, and to share
this burden across several machines.
Tag: devel::profiler, interface::daemon, network::server, role::program, special::not-yet-tagged, special::not-yet-tagged::m
Maintainer: Pierre Habouzit <email@example.com>
Depends: debconf (>= 0.5) | debconf-2.0, phpapi-20050606+lfs, php4-common
Description: memcache extension module for PHP4
Memcached is a caching daemon designed especially for dynamic web applications
to decrease database load by storing objects in memory.
This extension allows you to work with memcached through handy OO and
procedural interfaces in your php4 applications.
documentation on: http://fr.php.net/memcache/
> PS) I also have similar questions about maildir over NFS.
maildir isn't too bad, it avoids most locking issues by having one file
per message....and most maildir capable programs are well aware of NFS
craig sanders <firstname.lastname@example.org>
Currently listening to: Chris Organic - The Shaman
Why does man kill? He kills for food. And not only food: frequently
there must be a beverage.
-- Woody Allen, "Without Feathers"