How much CPU and RAM needed ?

happylama

Regular Member
Joined
Aug 1, 2016
Messages
485
Reaction score
184
Hi,
So, as the title says , how much does a website with around 500k-1m pageviews a day requires of RAM and CPU to handle all the traffic ?
 
I was going to say two Xeon cpus and 64 gigs of ram, but I as said above, 32 gigs will probably be enough.
 
Like @MrDarkFlame said. It will need to be optimized from web server, php and much more. Don't forget that to handle with such of traffic maybe, you will need to use a CDN or load balacing if you want to run it smoothly.
Optimization will be needed, also never forget to hardening the server in terms of security, because you don't only will have such traffic, but people and bad bots trying to do brute force, scanning ports and many other things.

Hardening the server also another thing, you should look for.
There are a plenty of Hosting Providers HERE in marketplace can help you. One is the guy that has been replied to you in this post.

PM him if you need help or visit marketplace.
 
Like @MrDarkFlame said. It will need to be optimized from web server, php and much more. Don't forget that to handle with such of traffic maybe, you will need to use a CDN or load balacing if you want to run it smoothly.
Optimization will be needed, also never forget to hardening the server in terms of security, because you don't only will have such traffic, but people and bad bots trying to do brute force, scanning ports and many other things.

Hardening the server also another thing, you should look for.
There are a plenty of Hosting Providers HERE in marketplace can help you. One is the guy that has been replied to you in this post.

PM him if you need help or visit marketplace.

Yes,I already checked @MrDarkFlame website and got interested, ill have to read more about servers to understand the security protocols.
 
It's hard to say it completely depends on what you are running. Just try to cache as much of it as possible.
 
Yes,I already checked @MrDarkFlame website and got interested, ill have to read more about servers to understand the security protocols.

If you don't understand, try Managed Dedicated Servers, they will manage your server for you, install and optimize from server side.

Ask them, how much it costs to fully manage server. And you will be fine.
 
A good 12 to 16 cores server with at least 16GB of ram will do the job, but i would recommend to use Nginx with php-fpm or litespeed, mariadb for mysql and some more little tweaks to get the maximum out of it
 
I would say... tell us what are this content based on ?
Is a platform?
If yes, what type of platform.

You can server 1mil pageviews with less than 2GB RAM and 1 x 3.5GHz+ CPU.... for text based html website..
 
I would say... tell us what are this content based on ?
Is a platform?
If yes, what type of platform.

You can server 1mil pageviews with less than 2GB RAM and 1 x 3.5GHz+ CPU.... for text based html website..
GPU just as important as CPU
 
You're going to need a really beefy setup with that amount of pageviews..Assuming we're not talking about some static html website heh

As others have already stated:
- Web server for your website or app and separate server(s) that handle your database(s)
- Load balancing
- CDN

Other things to consider.
- Are you planning on running Apache? Apache + LiteSpeed? Nginx? Node? Something else?
- How resource intensive is your website or application (think plugins, extensions, queries, etc.)?
- Easy scalability with the the host or server provider you choose
 
To calculate the actual RAM usage, you should have given traffic data for your peak Hours. Whole traffic in a day could never calculate the RAM actually required.

Anyway, I am trying to calculate based on the data you have given.
You said 500K-1M per day. On average, lets say 750K.

---- Now back to the point

Lets say, if a single visit consume 3MB data.
If you have optimized your web site images & used a CDN service, and used a good caching system, then you could save a lot of traffic from every visit by increasing re-usage content.

For most of sites, average time spent by any user on it is less than 3 minutes.

Now lets calculate 1 hour data usage:
750K / 24 := 32K Visit
Next calculate 1 minute data usage:
32K/60 := 550 Visit
at last, calculate 1 second data usage:
550/60 := 9 Visit

So on each and every second your traffic would consume
9 * 3MB = 27MB Data.

That above amount of data need to be travelled from your Hard Disc to User Monitor via RAM using Server Bandwidth, where RAM is storing that data in its memory for next frequent usage.

RAM basically used for swapping data in between Hard Disc & CPU cache.
So basically, if an user visit a page, which is already visited by another user few moments ago, RAM would serve it from its own memory, rather than calling it from Hard Disc.
In Computer Science, it is called HIT.
if another user visit a new page and if that page was not called before. So RAM need to bring that data from Hard Disc.
It is called MISS.

Now, if your Server RAM need to swap data very frequently, it would become less efficient.
So, If in every moment, whole data/content of your RAM changed, then it is a bad sign & its telling you that you need more RAM.


Since, average time spent by any user on a website is < 3 minutes.
So we have to serve those users for 3 minutes, prior to the current on going second.
Because they can visit any other new pages during those 3 minutes of their visits. So we need take it in our count too.

So users those are visited 3 minutes ago,are still consuming your data in every moment. So lets calculate the consumption:
It will become 27MB * 180 = 4860 MB := 5GB (approx)

So if my calculation is correct you should have at least 6 GB RAM, because other apps(OS/Web Server/Database/Framework-CMS) which are running on your machine, they need their own share on the RAM.

But, I know in peak hours a website generally gets 2x traffic than its normal time.
So optimum value of RAM would be 12GB according to my parameters
 
Last edited:
To calculate the actual RAM usage, you should have given traffic data for your peak Hours. Whole traffic in a day could never calculate the RAM actually required.

Anyway, I am trying to calculate based on the data you have given.
You said 500K-1M per day. On average, lets say 750K.

---- Now back to the point

Lets say, if a single visit consume 3MB data.
If you have optimized your web site images & used a CDN service, and used a good caching system, then you could save a lot of traffic from every visit by increasing re-usage content.

Most of sites, average time spent by any user on a website is less than 3 minutes.
And lets say average page views per user is 6.

Now lets calculate 1 hour data usage:
750K / 24 := 32K Visit
Next calculate 1 minute data usage:
32K/60 := 550 Visit
at last, calculate 1 second data usage:
550/60 := 9 Visit

So on each and every second your traffic would consume
9 * 3MB = 27MB Data.

That above amount of data need to be travelled from your Hard Disc to User Monitor via RAM using Server Bandwidth, where RAM is storing that data in its memory for next frequent usage.

RAM basically used for swapping data in between Hard Disc & CPU cache.
So basically, if an user visit a page, which is already visited by another user few moment ago, RAM would serve from its own memory, rather than calling it from Hard Disc.
In Computer Science, it is called HIT.
if another user visit a new page and if that page was not called before. So RAM need to bring that data from Hard Disc.
It is called MISS.

Now, if your Server RAM need to swap data very frequently, it would become less efficient.
So, If in every minute, whole data/content of RAM your RAM changed, then it is a bad sign & its telling you that you need more RAM.


Since, average time spent by any user on a website is < 3 minutes.
So we have to serve those users for 3 minutes, prior to the current on going second.
Because they can visit any other new pages during those 3 minutes visits. So we need take it in our count too.

So during those 3 minutes of period, following amount of data would be consumed.
it will become 27MB * 180 = 4860 MB := 5GB (approx)

So if my calculation is correct you should have at least 6 GB RAM, because other apps(OS/Web Server/Database/Framework-CMS) which are running on your machine, they need their own share on the RAM.

But, I know in peak hours a website generally gets 2x traffic than its normal time.
So optimum value of RAM would be 12GB according to my parameters

This is the right answer in the thread.

Also, offloading as much as possible to a CDN will decrease this amount 10x at least.

Content doesn't change while the 1M visitors are on the site. Just make the CDN's serve static HTML after the first pull.
 
Back
Top