Re: Reducing load for LAMP app?
- From: Jeremy <jeremy@xxxxxxxxxxx>
- Date: Fri, 04 Jan 2008 17:28:56 -0800
Gilles Ganault wrote:
Hello,
I'm no LAMP expert, and a friend of mine is running a site which is a
bit overloaded. Before upgrading, he'd like to make sure there's no
easy way to improve efficiency.
A couple of things:
- MySQL : as much as possible, he keeps query results in RAM, but
apparently, each is session-specific, which means that results can't
be shared with other users.
Is there something that can be done in that area, ie. keep the maximum
amount of MySQL data in RAM, to avoid users (both logged-on and
guests) hitting the single MySQL server again and again?
- His hoster says that Apache server is under significant load. At
this point, I don't have more details, but generally speaking, what
are the well-know ways to optimize PHP apps?
Thank you.
memcached: http://memcached.sf.net (for caching dynamic data in memory)
apc: http://us2.php.net/apc (caches script bytecode to reduce compilation overhead)
These two modules will help enormously. I guarantee it. Using apc is pretty much transparent, but memcached will require modifying your database abstraction layer using the memcached functions (http://php.net/manual/en/ref.memcache.php).
Also try connection pooling using PHP's persistent connections. These make life harder for you, but eliminate a lot of connection/tear-down overhead with the database. You need to be able to configure your own apache and mysql for this to really work.
(http://php.net/manual/en/features.persistent-connections.php)
Jeremy
.
- Follow-Ups:
- Re: Reducing load for LAMP app?
- From: Jerry Stuckle
- Re: Reducing load for LAMP app?
- References:
- Reducing load for LAMP app?
- From: Gilles Ganault
- Reducing load for LAMP app?
- Prev by Date: Re: PHP File Upload - image works, pdf does not
- Next by Date: Re: Reducing load for LAMP app?
- Previous by thread: Re: Reducing load for LAMP app?
- Next by thread: Re: Reducing load for LAMP app?
- Index(es):
Relevant Pages
|