Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sesc360's avatar

RAM Usage and Laravel

Dear all,

please excuse my slightly "noob"-sounding question but I really need advice here. I am using a dedicated server right now as production server with 24GB of RAM (was a lucky shot) for around 25$ a month. Well, now I read more and more about people changing to DigitalOcean. I am a little bit confused, as the droplets they offer have "way less" RAM available. I would pay 80$ a month for 8GB.

Please excuse the question. But how necesary is the RAM at all? Is it, that a high traffic site with laravel can be run on DigitalOcean with 2GB or 4GB of RAM? and my 24GB dedicated server is way to oversized at all? I would be really happy to get you feedback on that. I know it depends on what you do..

But lets just image a high traffic website (SaaS) with an API accessed my iphone apps that is based on Laravel.

0 likes
7 replies
Stephen's avatar
Stephen
Best Answer
Level 3

24GB is a ton of memory. A server like that can serve quite a lot of traffic with sufficient CPU muscle behind it. Since you're not paying a lot it's fine to use a server that's waaaay overkill for your needs. However, where I would be hesitant to use your server is that it's dedicated hardware. Obviously dedicated hardware isn't problematic if you're a good server administrator and can resolve both software and hardware issues yourself. At $25 a month I'd be surprised if that included any management by your hosting provider but if it does that's an obvious bonus. You'll get better performance from dedicated hardware generally speaking but the trade off of doing your own devops makes the choice less appealing. Also, a single dedicated server doesn't provide any redundancy.

For apps that have a high amount of traffic (thousands of daily visitors), two or three mid size (4GB) VPS machines at either Linode or Digital Ocean will be sufficient. You can balance traffic between the machines. You now have server redundancy and no longer need to worry about fixing broken hardware. Essentially you're horizontally scaling your infrastructure as opposed to vertically scaling with this 24GB machine. For a truly "high traffic" app spending around $100 to $200 a month for hosting is just the cost of doing business. Some companies spend quite a bit more than that. If your app is just launching with a small user base start off with two small size (1GB) VPS machines. One machine can serve the app while the other hosts the database. This configuration is pretty cheap at $20 a month. Then, as your app grows in daily usage spin up newer larger VPS instances and balance traffic between them.

2 likes
jekinney's avatar

As @Stephen noted. Scaling vertically with most cloud based solutions can be automated or at least a click of a button up and down. Also as he mentioned redundancy and failures, specifically hard drives. All servers should have the hard drive always spooled up even if not used to help performance. While hard drives should last x amount of hours those hours add up fast at 24/7. With cloud based it should never be a factor for the user, but dedicated your on your own. If it fails you have to wait for a replacement to be installed. Lose of data that way is huge factor along with downtime.

As mentioned two, location. Cloud you can scale horizontally with a few clicks and done. Dedicated, unless you purchase more.... Users around the globe have to deal with network delays.

Running trace routes you'll notice huge swings in routing a connection. For example LA to Chicago I have seen the route go to through Virginia. Imagine Germany to Chicago going to Japan, back to UK, to US.

1 like
gregrobson's avatar

A lot of the providers such as Linode and Digital Ocean scale up the RAM and CPUs in equal measure for each package for simplicity.

A high traffic sight (assuming your just serving pages and not doing any background processes) might need a lot of CPU, but the RAM should stay relatively low. If you were running a large database, you tend to keep a lot cached data in RAM for performance, but the CPU usage may be relatively low.

1 like
sesc360's avatar

Dear guys, you really got me thinking about my infrastructure setup. These were amazing elaborate answers! I totally missed out on so many different things you mentioned there, but totally reinforced the decision to move to DO in order to setup a proper system for a start without putting to much emphasis on the dedicated thing in the beginning.

You are right. 24GM is a ton of memory. But as I found out, these are regular computers being used at my providers place as dedicated servers and not server machines. The hardware at the moment is an Intel Core i7 950, with HDD2x HDD 1,5 TB SATA and RAM3x RAM 8192 MB DDR3. But there are a lot of things that you mentioned that are very true and I did not take into account. Well... The hardware is being managed by the provider. It is a used dedicated server, thats why they offer them cheaper on a so called, server market at Hetzner, the provider. The problem of single dedicated servers without redundancy is something I put way to less focus on to be honest.

I was a little bit shocked, so to speak, why such a dedi got so much physical RAM whereas all the VPS can scale up to the same amount of RAM, but for way more money. So the question came up, if this is necessary at all. I don't think my app will have thousands of daily visitors at the moment :) But even 2-3 mid size 4GB VPS machines at DO would be definitely an option. Actually I was thinking about the balancer as well and about the server redundancy now that you mention it. I totally missed out on the idea of how important it is to scale horizontally to make it stable instead of vertically initially.

I will go now for the two 1GB VPS machines for App and DB. And one smaller VPS with the 512MB as a Backup machine I guess?

This was a really really nice answer to my question guys. I feel really well now about the setup. For me it is important to have the data based in Germany/EU. Which is now possible with DO as well, as they have a hub in Frankfurt now. Which is good. Well.. one could argue about the NSA access which is always possible for them with american providers even if they host in the EU. Not sure about that actually...

The network delays is another thing you mentioned. THe horizontal scaling is easy with DO. But I think there will be no difference in terms of cost. If I need another droplet at DO and pay for that or book another server will be almost the same I guess. But it is way faster.

So I think I will use this proposed setup, maybe one more 1GB droplet as staging server, then I would have a really nice package. Very nice guys! THaaaaaanks.

jekinney's avatar

@sesc360

Nice! It's a fun subject for me! Obviously a huge one if your a freelancer dealing with clients you have to have a good knowledge of why not use a cheap shared host to start or the other extreme of many dedicated servers....

sesc360's avatar

I agree with you totally. Shared Hosting was not an option.. But I was really not satisfied with the Dedi option.. I already cancelled this one and went to DO. My setup is now:

  • 1x 1GB RAM Staging Server
  • 1x 1GB RAM App Server
  • 1x 1GB RAM DB Server

At the moment backups by Snapshots. Will be expanded to 1GB RAM Backup Server. When the system is growing i want to setup a 2nd App Server with a Load balancer system and a private DNS. I think this will be a fun learning experience.

Thanks so much guys.. Now I got a good basic system for the same amount of money.....

1 like
TheWizard's avatar

@sesc360

Hi there! after a year of this question, how does it goes your project? how many users can it handle with the last configuration? I'm working on a project and I would like to have 10,000 users (or even more!) doing stuff like here, at Laracasts (NOT screencasts, but there is some business logic).

Any information of yours would be very very useful, thanks in advance!

Please or to participate in this conversation.