Sponsored Content
Full Discussion: lamp performance
Top Forums Web Development lamp performance Post 302246673 by otheus on Tuesday 14th of October 2008 05:33:10 AM
Old 10-14-2008
1a. APC cache was the quickest way to get the most improvement in speed on my server. Memcached is also an option, but only has benefits above APC when you can distribute the caching load to backend servers or if you have multiple front-end servers.

1b. Squid. See Squid (software) - Wikipedia, the free encyclopedia. You put your LAMP server on another port, and proxy it using SQUID. Squid will cache as much as can be cached and fetch from your LAMP server. If most of your content is dynamic, this may not help much.

2a. You absolutely must minimize swap in such an environment. If you start going to swap, your system loses.

In sysctl.conf, change:
vm.swappiness = 1
and "tune" your swap to use a swap file that's about 80M. If you need more swap then that, your system will crash. Better to let Apache think it cannot get more memory and return 503 (server busy) errors than to wait forever.

2b. You can play around with the following:
  • MinSpareServers # keep this at least 5 or 10.
  • MaxSpareServers # no problem to set this 1/4th max.
  • ServerLimit # set to what your server can handle, memory-wise
  • MaxClients # Set to what your server can handle, memory-wise
  • KeepAlive # keep on
  • KeepAliveTimeout # keep to 30 seconds or less
  • HostnameLookups # set to OFF

2c. More tuning at the TCP level. See sysctl parameters such as:
  • net.core.somaxxconn
  • net.core.netdev_max_backlog
  • net.ipv4.tcp_keepalive_intvl
  • net.ipv4.tcp_tw_reuse
  • net.core.optmem_max
  • net.core.rmem_max
  • net.core.wmem_max
  • net.ipv4.tcp_rmem
  • net.ipv4.tcp_wmem
  • net.ipv4.tcp_congestion_control
Also, LOWER the amount of shared memory, to ensure you have more memory for HTTP. (Note: This may not work if you are running MySql or postgres on the same server!)
  • kernel.shmmax
  • kernel.shmall

2d. If you have the memory, put all your HTTP/PHP files onto a ramdisk. Otherwise, install everything on a FAST internal (or SAN) disk. When I say FAST, I mean hardware-RAID1 15k RPM SCSI Fiberchannel. Store all log files on a SEPARATE disk, which can be any junk drive.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

LAMP configuration

Hi there, I've got a debian 3.1r4 half working (no x yet :P) I need some pointers for installing a Apache - MySQL - PHP configuration on my box, and set them up to work together. I know to use vim a bit :) I would like something that is similar to tanguay.at, or even simpler, since I'm a real... (1 Reply)
Discussion started by: izua
1 Replies

2. UNIX for Advanced & Expert Users

LAMP Server Failover

How does everyone else handle this? My Setup: Server A: CentOS 5.x 10.0.0.1 Apache MySQL Master Server B: CentOS 5.x 10.0.0.2 Apache MySQL Slave My Domains: dom1.com A record: 10.0.0.1 A Record: 10.0.0.2 dom2.com A record: 10.0.0.1 A Record: 10.0.0.2 (3 Replies)
Discussion started by: Ikon
3 Replies

3. Web Development

LAMP - version updates and the impact!

Hello All, I have a LAMP server (CentOS 5.5) which has a lot of php scripts and the php pages runs fine. My question is if I have to allow the OS udpates regularly on the server, will there be any problems in running the existing php scripts? Please advise if my apache/mysql/php functionality... (3 Replies)
Discussion started by: ilan
3 Replies

4. Solaris

Need LAMP tutorial!

Hello Everybody, Does anybody know or recommend me a tutorial for LAMP server on Solaris 10 x86? (3 Replies)
Discussion started by: ahmedamer12
3 Replies

5. Web Development

Building LAMP server from scratch (build a server with compiled LAMP from CentOS mini)

Hello everyone, I would like to setup a lamp server from a minimal distro and to compile PHP, MySQL and Apache myself. I have chosen CentOS minimal for the OS and I am trying to build the stack by hand... But well, it appears I need some help! First: I am looking for good and recent... (3 Replies)
Discussion started by: freddie50
3 Replies

6. Programming

Lamp tutorial

Hello All, I need a good lamp(linux, apache, mysql, php) tutorial for web development. I searched in net but not finding suitable one. suggest me something. (3 Replies)
Discussion started by: amisubha
3 Replies

7. HP-UX

LAMP Installation On HP-UX

Dear Folks, How to Install LAMP on HP-UX system. Please Guide. Regards, KRISHNA (2 Replies)
Discussion started by: krishna.lu
2 Replies

8. Red Hat

Setting up LAMP environment

I wish to setup LAMP environment. Amongst, I have successfully installed Linux 6.1. I am looking fwd to install - Apace Web Server, My Sql Database & PHP environment. Say if I look for MySql, could see downloadable available in rpm format. But this must be copied over to Linux machine. As... (2 Replies)
Discussion started by: videsh77
2 Replies

9. UNIX for Advanced & Expert Users

LAMP Sever

How do I install a LAMP server on a new installation of Debian 9 using the lalest versions of AMP? Here is what I have. Corrections please. MYSQL apt-get install mysql-server mysql-client You can verify the MySQL server status using command: systemctl status mysql ------- PHP7... (0 Replies)
Discussion started by: Meow613
0 Replies
All times are GMT -4. The time now is 03:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy