Re: Reducing load for LAMP app?



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
.



Relevant Pages

  • Re: VFP8 & MySQL
    ... > VFP functions like NVL to a MySQL one, definitely it made the switch very ... > About your connection problem, I have mine setup as default for 100 ... As for the server, we left it ... The server crashed and corrupted the database. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • MySQL on Win 98
    ... I'm just getting into MySQL and I'm trying to learn about it at home. ... and created a DSN connection for it. ... User: root ... ODBC Data Source Administrator and get a "success" result. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VFP8 & MySQL
    ... Main Location and 3 branches (these are remotely accessing MySQL at the main ... About your connection problem, I have mine setup as default for 100 ... As for the server, we left it alone. ... The server crashed and corrupted the database. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Java and MySql program example ?
    ... > I am trying to learn Java and need an example program with MySql ... > MySql database. ... Database connection established ...
    (comp.lang.java.programmer)