6

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.

user606723
  • 544
  • 1
  • 4
  • 10

1 Answers1

3

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.

Insyte
  • 9,314
  • 2
  • 27
  • 45