What is better for VPS: large number of cores or RAM?

Started by Pournima, Jul 21, 2022, 01:24 AM

Previous topic - Next topic

PournimaTopic starter

Hi!
Question in the topic. What is better, large number of cores or RAM for an article website?
  •  

kosmon

Nothing of these. The most important thing is SSD, so that your articles can be quickly retrieved from DB.
Depending on what kind of cache. You can cache both in RAM and on hard, if the site is not large up to 500 entries, I think 2GB of RAM is OK, provided that the cache is in it.

If you cache static, and even more so on the server you compress before sending, look towards the processor.
RAM in this case, even with a visit to 1k, will be consumed minimally, given that you have at least switched to php7 or higher. Best option is to take a server for a test and look at resource consumption for several days.
  •  

arthyk

Since VPS hosting involves the allocation of its own independent resources for each site, the question is relevant. But the common IP remains the weak link, that is, you cannot predict what neighbors you will have, but for a well-known resource with high traffic, this may matter.
As for such elements of the server as the processor and memory, for a serious project with a lot of attendance, I would prefer memory. And both operational and disk. Although if you intend to use additional software, processor power also matters. :)
  •  

vingler

WHEN YOU NEED MORE RAM
When visitors browse the site pages, the VPS web server creates a new process in RAM to process each such request.

Too little RAM on the server will lead to a significant slowdown in the system due to the need to write data to disk - to swap memory, which ultimately significantly increases the risk of freezing.
Each new process takes part of the RAM, and when there are a lot of them, the memory may run out.
After that, in the best case, web server gives visitors the message "500 Internal Server Error" and the site disappears.
1-2 GB of RAM is quite enough for the normal functioning of a site with several hundred users per day. With the growth of traffic to 100-200 thousand visitors per month, a VPS server with about 4-8 GB of RAM is required. But this is in general.


When calculating the necessary web server resources, in addition to determining the expected number of visitors, a number of other issues must be taken into account:

how will/can traffic be distributed throughout the day (evenly or are peaks expected at certain hours)?
what applications (plugins, services, etc.) work on the site and how optimized are they for simultaneous work with a large number of users?
is it possible to attract a qualified specialist who can quickly configure or reconfigure web server?
is it required that all network services (server, database, mail) support one VPS, or can they be distributed across multiple machines?

Also, do not forget that the operating system and applications consume allocated resources in significant amounts. Some CMS, such as online store scripts, require more RAM than others. Dynamic pages "eat" much more memory than static ones.
And as the site develops, a more productive VPS will be required with almost 100% probability. And it is highly desirable to initially order the server not "end-to-end", but at least with 50% of the stock if possible.


WHEN YOU NEED A MORE POWERFUL PROCESSOR
An efficient computing unit will work better when dynamic applications are running on the site, generating content that cannot be cached in significant volumes.

This applies, first of all, to online stores, sites with a large number of users who enter only through the registration procedure, and advanced web services that present dynamic data (stock charts, results of sports competitions, etc.).

We also take into account that VPS servers are used not only for servicing ordinary sites. High computing power is required for high-quality operation of gaming web services, business applications, databases with a wide audience of users, mail servers, audio and video streaming services.

And the problem is that, again, information about the number of processor cores is certainly important, but not paramount.
It is much more important when the provider provides data on the type and model of the CPU, its clock frequency and the number of cores assigned to the virtual server. Only all these data in the complex allow you to get some preliminary idea of the computing power of the VPS.

For example, according to bluevps, a CPU with a 3.3 GHz clock speed can load WordPress site pages 40% faster than a similar web server in a configuration with a processor with a lower clock frequency. Which once again confirms that the number of operations performed in one processor core largely depends on the clock frequency.

Let us briefly recall why this is so. The fact is that the speed of creating web pages in PHP depends on the speed of a single core. PHP and MySQL execute a single query in the same thread, so regardless of the number of processor cores, the execution of a PHP script or a database query will be served by a single core.


The performance of the core (clock speed) affects the speed of page generation, and the number of these cores affects the number of simultaneously supported connections.

In other words: 2 cores of virtual processors with a clock frequency of 3.3 GHz correspond to approximately 3 cores of a processor with a clock frequency of 2.2 GHz.

That is why bluevps recommends that users who plan to host resource-intensive projects on a VPS web server should be more attentive to the issue of choosing a CPU. And if you have any questions at the selection stage, it is better to consult with a technical support specialist in advance — through a "ticket" on the website or in an online messenger.
  •