HACKER Q&A
📣 Pooge

How to guesstimate the needed resources of a server?


Ever since I was a kid, I've always wondered what it took to host a World of Warcraft server with 1000 connected players.

I want to host my personal website/blog pretty soon, so of course that should really need little resources, but I'm wondering if there are some articles giving examples of common services and the resources you need to run them for an expected load. I have a server at home, so I'm thinking of deploying it on that.


  👤 LinuxBender Accepted Answer ✓
This is a big topic but I can give you and rough way to make an educated guess. Develop your stack, content and configuration locally on a VM that has less resources than your physical server. Find tools to load test your setup. The most basic being Apache Benchmark but I am sure you can find other tools that would work with whatever you plan to do. Make many different passes / iterations of load testing, tuning application and web server configuration so that you find a balance of performance and keeping memory usage low. Keep this VM. When you are happy with the basic performance and security, deploy that setup to the web. Keeping the VM around you can test out any potential changes you wish to make and even test out deploying your web content before it is live. That could be "staging.yourdomain.tld". This is also useful should a provider for whatever reason close your account assuming you are colocating your server vs running it at home. Simply create an account somewhere else and push your configuration and content to a VM whilst you move your physical server. Nothing is lost, especially if you rsync your logs back to your local VM via cron or save them to a NAS or USB NVME. A VM is also a good place to test out security hardening changes, patches and so on.

You did not get into details of your stack, but I assume NGinx for the web server? The primary determining factor of memory and performance is number of workers and number of files and sockets each worker is permitted to open. This is a big topic however. It is unlikely we could go down the rabbit hole on HN. One of the rabbit holes is configuring things like vm.panic_on_oom = 2, vm.min_free_kbytes, vm.admin_reserve_kbytes and vm.user_reserve_kbytes so that the server reboots and self heals when people run it out of memory rather than depending on the OOM killa' though your goal should be to tune the stack so that the highest load is unlikely to do that.

If you want a personal challenge, configure the VM so that it has half the memory and CPU resources of your physical server. If you can make your site performant in the minimal VM, then it will surely perform on the physical server.


👤 bubblebeard
I don’t know of any such list unfortunately. What kind of hardware does your server have?