Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am planning on renting a VPS.

How much memory is required for a base setup of Debian, Apache, Mysql, PHP?
By base, I mean not considering traffic (which will be below 1k hits a day). No complicated databases or memory eating scripts.

For reference, I would consider 512MB more than I need. (But i'm unsure of how right I am.)


Possible duplicate: How much VPS ram would I need to run Wordpress, Apache, SVN & MySQL?

The difference would be, I am specifically asking about Debian, Apache, Mysql and PHP by default Debian configuration. No memory tweaking or replacing Apache with a lighter daemon.

The other question also has wildly inconsistent answers.

share|improve this question

1 Answer 1

There are two primary factors:

  1. Size of your MySQL database.
  2. Number of simultaneous Apache sessions.

Ideally you would have enough memory for your entire MySQL db to be held in memory. On top of that, you need enough memory for (size of a single Apache/PHP process) * (number of simultaneous Apache requests). When I was doing this calculation, our tests indicated assuming 25MB / Apache+PHP5 process was a reasonable number. Combine the calculated size of your MySQL DB and estimated Apache memory requirements and add 25% more for some head room.

EDIT: I misread your question. I thought it said 1K requests per minute. So a bit more reasonable requirements:

If your DB is big enough that speed is a concern, you still want it to fit in memory. Otherwise your gut is correct, a 512M instance will be just fine.

EDIT #2: However, bear in mind that if you end up with a slow DOS or just a small traffic burst that pushes you much past 15-20 simultaneous Apache sessions, you'll end up in swap. And a swapping box is a useless, mostly dead box. So be sure to cap your MaxClients below that. I would suggest 10 - 15 for a 512M box.

share|improve this answer
    
IME, the nature of the operations is as important as the volume –  symcbean Jan 13 '12 at 11:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.