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 going to develop a simple system of Perl CGI scripts which do email sending, file storage, and simple HTML user interface. The data should be stored in a MySQL database, HTTP is served with Apache.

As it is a typical server-side software system, I ask the question: How much RAM such a typical system needs?

I ask this because we are considering to order a Linux VPS. For example, on CoolHandle hosting VPS memory starts from 512MB. Is it enough for such simple CGI scripts?

share|improve this question
    
OS? number of users the site will serve? –  Cold T Jun 20 '12 at 13:27
    
Linux, probably only 1 user (admin) –  porton Jun 20 '12 at 13:27
1  
if you are only running simple queries, not having a massive user load on the site, 512MB is more then enough –  Cold T Jun 20 '12 at 13:30
    
@ColdT - if MySQL is also on the same system, would 512 MB still be enough? –  mfinni Jun 20 '12 at 13:34
    
Again simple queries (and non-intensive queries) you would get away with on 512MB, but you are also right in saying there is no such thing as "typical server-side system". Only real way to be sure is to benchmark the workload and go from that. –  Cold T Jun 20 '12 at 13:50
show 1 more comment

2 Answers 2

up vote 1 down vote accepted

256MB machine is good enough to host virualmin, with perl, email. To save memory its good to run it like fast-cgi, so can have 1 fast-cgi processor at the time so it makes around 25-50 requests per second, plus one mailbox with antivirus with on-demand spam checking. Fast-cgi runs from a separate context which can be protected with selinux. You can use another account (vhost) to host e.g. your sensitive data, under 64MB Perl process (e.g. without image upload). 256MB ram is more than enough. You might need also some extra RAM for cache, like 32MB.

share|improve this answer
1  
While 512Mb should be enough, a HUGE amount depends on the workload. Badly written perl could double that memory requirement even for a single user. You should up the spec if you want to process more than about 100 emails / day. As for the MySQL.....that could have very large requirements. A bit of tuning can have massive impact on size and performance though. –  symcbean Jun 20 '12 at 14:31
    
It's good to run small RAM for development so you dont have memory leaks or it doesnt work at all ;-) –  Andrew Smith Jun 21 '12 at 7:16
add comment

There's no such thing as "typical server-side software system", especially if you're developing it yourself. Benchmark it under load and figure it out yourself - that's all you can do for this. For commercial software, the vendor may have sizing/scaling recommendations, but that's not the situation you find yourself in. VPS are cheap - start small with your intended host, benchmark it, and go up if you need to. Benchmarking isn't a one-time thing, either - if your userbase grows, you're going to need to be monitoring to determine when you need to grow anyway.

share|improve this answer
add comment

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.