14

I'm planning to buy a Raspberry Pi, a colleague of mine has a 256 MB left. But I don't know if 256 MB of memory can for fill the things I want to run.

I want to run an Apache web server (or some other web server that uses less ram and CPU) with PHP and MySQL, an FTP server and a SOCKS 5 proxy. On the web server I'm going to run:

  • a Vbulletin forum with 8 users
  • A game that I'm developing at the moment.

When the game is ready I could move the forum or the game to another raspberry when it is too heavy. I'm keeping the game as small and fast as possible. For example: I'm going to process all update jobs with C++. But when the game is big enough to gain money with it I want to buy a normal server if that gives a performance boost. But I want to experiment with the Pi for a while.

So my question is: should I buy a new 512 MB model B pi, or just buy the 256 MB version b of the colleague of mine?

0

1 Answer 1

13

There's no definite answer for that because it really depends on how much performance you need, how complicated your application would be, etc.

It's always better to have more memory, just to be safe. Remember that you wont ever get full 256MB of RAM to Linux, the best you can get is 240MB as rest will be allocated to GPU (and you really should use this split in your workload). 240MB is not that much but on the other hand there is a lot of VPS service providers which provide VPSes (which are virtualized private servers) with 256MB of RAM and people run quite big sites on this machines so it's definitely possible.

You can set a limit of memory available to PHP site and on many shared hosting services it is set to 8-16MB per site. And a lot of applications can run quite happy with that. MySQL has a lot of configuration options that can be used to limit it's memory usage and you can quite easily run it with 64MB (or even less) of memory. Apache webserver is not memory hungry too and there are even lighter alternatives. We can skip FTP and SOCKS server since they takes really small amount of memory (at least when used by only couple of users).

So database is the biggest issue here. Remember that the more memory database server has, the better performance it will get (it uses it mainly for caches to safe disk I/O). On really high traffic sites, database server has enough memory to keep (almost) whole database in the memory. You are probably not going to need that good performance. RaspberryPi does not have too quick storage (it's like 5-10 times slower than on full-blown computers even without RAID) so your performance will be really slow when it hits storage. Continuing already mentioned VPSes - they have much quicker storage solutions in most cases but they also share this storage with many other VPSes (often 16 or even 32) so it's very often not better than the one on RaspberryPi. And again, a lot of sites run happily on those servers.

So to sum up - you should be perfectly fine with 256MB of RAM but you are going to have to tweak some configuration options to lower the memory usage. It should be easy to find some tutorials about that on the Internet, especially when looking for articles about optimising server for VPS use etc. If you don't plan on using something that needs more memory in the future and can safe some money by buying 256 MB version of RaspberryPi, it can be worth it. And you may learn some interesting skills like designing your application so that it uses less memory or configuring your system to need less memory. That skills may pay of in the future.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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