LAMP Memory Usage

I have been working on tuning my Linode for use as a LAMP server. As part of this process I created a small spreadsheet to help. I thought I would share this with the community in hopes it may help others and also to get feedback on where my assumptions may be wrong.

The spreadsheet is at http://dl.dropbox.com/u/4986351/LAMP.ods and in the spirit of open-source it is in ODF Spreadsheet format.

Here is a how-to guide for this spreadsheet:

The yellow boxes are values you need to enter. Next to each of these is a Linux command you can use to get the appropriate value. I am using PHP APC for opcode caching so that all PHP code is cached all the time, thus lowering the apache2 per process RAM.

After entering the values for the 1st 21 rows, you should enter your guess for apache2 max clients and then look in row 34 for the min free RAM to make sure it is not negative.

5 Replies

Well, I can't view your spreadsheet (Excel 2007 doesn't read ODS, Google Documents spits out server errors, ironically ODS has very little support while Excel documents are widely supported), but… 21 rows to figure out memory usage? Yikes!

If it's so complicated, I should suggest considering dropping Apache for something like nginx/lighttpd/litespeed/cherokee/etc that takes mots of the effort out of this…

Determining memory usage for lighttpd, for example, involves basically using the stock lighttpd config, deciding how many fcgi PHP processes you want (8 can probably handle anything most sites throw at it, at an estimated RAM usage of ~150MB), and then grab the MySQL sample config appropriate for your machine (probably my-medium.cnf?) and you're good to go.

Looks pretty useful for a beginner - it looks at more than just Apache (looks like what, four numbers from Apache?).

![](" />

@Guspaz:

Well, I can't view your spreadsheet (Excel 2007 doesn't read ODS, Google Documents spits out server errors, ironically ODS has very little support while Excel documents are widely supported)

Ok, I added an excel version.

http://dl.dropbox.com/u/4986351/LAMP.xls

Well, that does look like it could be useful, but I think it might confuse somebody figuring this stuff out for the first time. For them, it's probably easier (as I said earlier), for MySQL at least, to grab one of the pre-made config files (lest they disable something like query caching or starving MySQL some other way) and then concentrate on configuring Apache without worrying about tweaking MySQL.

Do you have an option to use nginx or some other lighter alternative to apache? If you are going to have to worry about 40 connections you should have significantly less memory consumption worries.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct