Configuring Website Deployment on Dedicated Server
Dedicated Server is a physical machine entirely at your disposal. Maximum performance, predictable resources, isolation from neighbors. Justified at high load (10k+ rps), DB performance requirements, or large data storage.
Configuration for Web Load
Typical configuration for a high-load website:
CPU: 2× Intel Xeon E5-2670 (16 cores / 32 threads)
RAM: 128 GB DDR4 ECC
SSD: 2× NVMe 960 GB (RAID 1 for OS, RAID 0 for data)
Network: 1 Gbps Unmetered
OS: Ubuntu 22.04 LTS
RAID Setup
# Check disks
lsblk
fdisk -l
# Create RAID 1 for root partition
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
mkfs.ext4 /dev/md0
# RAID 10 for data (4 disks)
mdadm --create /dev/md1 --level=10 --raid-devices=4 \
/dev/sdc /dev/sdd /dev/sde /dev/sdf
System Optimization for High Load
# /etc/sysctl.conf — network and file optimizations
net.core.somaxconn = 65536
net.core.netdev_max_backlog = 65536
net.ipv4.tcp_max_syn_backlog = 65536
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
fs.file-max = 2097152
vm.swappiness = 10
# /etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576
root soft nofile 1048576
Nginx for High Load
# /etc/nginx/nginx.conf
worker_processes auto;
worker_rlimit_nofile 65536;
events {
worker_connections 4096;
use epoll;
multi_accept on;
}
http {
keepalive_timeout 65;
keepalive_requests 1000;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# Buffering
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 8 4k;
# Gzip
gzip on;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript;
gzip_min_length 1024;
# File descriptor cache
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
}
PHP-FPM Optimization
; /etc/php/8.3/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
; Ulimit
rlimit_files = 65536
; OPcache
[opcache]
opcache.enable = 1
opcache.memory_consumption = 512
opcache.max_accelerated_files = 20000
opcache.validate_timestamps = 0 ; don't re-read files in production
PostgreSQL for Dedicated Server
-- postgresql.conf (tuned for RAM)
max_connections = 200
shared_buffers = 32GB -- 25% of RAM
effective_cache_size = 96GB -- 75% of RAM
maintenance_work_mem = 2GB
work_mem = 128MB
wal_buffers = 64MB
checkpoint_completion_target = 0.9
max_wal_size = 4GB
random_page_cost = 1.1 -- SSD
effective_io_concurrency = 200 -- NVMe
Hardware Monitoring
# Temperature and disk status
apt install -y smartmontools lm-sensors ipmitool
# SMART monitoring
smartctl -a /dev/sda
smartd -d -i 600 # check every 10 minutes
# RAID status
mdadm --detail /dev/md0
cat /proc/mdstat
# CPU temperature
sensors
ipmitool sdr type temperature
Load Testing After Setup
# wrk2 — HTTP performance test
wrk2 -t 12 -c 400 -d 60s -R 10000 https://example.com/api/products
# -t: threads (= number of CPUs)
# -c: connections
# -R: target RPS
Implementation Timeline
Dedicated server setup from scratch (OS, Nginx, PHP, PostgreSQL, SSL, monitoring): 3–5 days. Optimization for specific load — another 2–3 days.







