Short answer: a CPU is built to run a few tens of threads of varied, branching code as fast as possible, one step after another. A GPU is built to run thousands of threads that do the same arithmetic on large blocks of data, with far more memory bandwidth. Web servers, databases and most hosting work are CPU jobs; training neural networks, running large AI models, 3D rendering and bulk video encoding are where a GPU pays off.
nproc # logical CPUs you may use
lscpu | grep -E '^(CPU\(s\)|Thread|Core|Socket|Hypervisor)'
grep -o -w -E 'avx2|avx512f' /proc/cpuinfo | sort -u # CPU vector (SIMD) extensions
lspci -nn | grep -E 'VGA|3D|Display' # any graphics device at all
nvidia-smi # exists only once an NVIDIA driver is installedThe design difference is spelled out in NVIDIA’s CUDA Programming Guide: CPUs “dedicate more transistors to data caching and flow control”, while GPUs “devote more transistors to data processing units”, trading lower single-thread performance for much greater total throughput. Everything below follows from that trade.
GPU vs CPU at a glance
| CPU | GPU | |
|---|---|---|
| Built for | Low latency on one thread: branches, pointers, system calls | High throughput over many threads doing the same work |
| Parallelism | A few tens of threads in parallel, per NVIDIA's guide | Thousands of threads in parallel |
| Vector model | SIMD: one instruction on a fixed-width vector (AVX2, AVX-512, NEON, SVE) | SIMT: warps of 32 threads run one instruction, each thread may branch |
| Memory | System RAM; one 64-bit DDR5-4800 channel peaks at 38.4 GB/s | Its own on-board memory; an H100 SXM lists 3.35 TB/s |
| Runs the OS | Yes, plus every program by default | No; the CPU launches work on it and copies data over PCIe or NVLink |
| Programming | Any language, any program | Kernels through CUDA, HIP, oneAPI, Vulkan or a framework that wraps them |
| Good at | Web serving, databases, compiling, game servers, VPN, mail | ML training and inference, rendering, video encode, simulation |
What each processor is built for
CPU: few fast cores, big caches
A CPU core spends its transistors on making one instruction stream fast: deep caches, branch prediction and out-of-order execution, so code full of if statements, pointer chasing and system calls keeps moving. Each core also has SIMD units, vector instructions such as AVX2 and AVX-512 on x86 or NEON and SVE on Arm, which apply one instruction to a short, fixed-width vector of numbers. Compilers and libraries use them for checksums, compression, encryption and video encoding. How cores and hardware threads relate, and what a vCPU on a VPS is, is covered in CPU cores vs threads.
GPU: many simple lanes, huge bandwidth
A GPU groups its threads into warps of 32. In NVIDIA’s SIMT model all threads of a warp execute the same instruction at the same time, but each may follow its own control flow path; when they disagree, the hardware runs each path in turn with the other threads idle. That is why branch-heavy code wastes most of a GPU, and why “SIMT does not have a fixed data-width like SIMD”, as the guide puts it.
Memory is the other half. A GPU has its own memory (the device memory) next to the chip. NVIDIA lists 3.35 TB/s of memory bandwidth for the H100 SXM, read on nvidia.com on 13 November 2026. System RAM is far slower per socket: one 64-bit DDR5-4800 memory channel peaks at 4,800 million transfers of 8 bytes a second, 38.4 GB/s, so even many channels add up to hundreds of GB/s, not terabytes. Data a GPU works on must first be copied to it across PCIe or NVLink, which only pays when the job is large enough.
Which workloads go where
| Workload | Runs best on | Why |
|---|---|---|
| Web serving (nginx, PHP, Node.js, Python) | CPU | Short, branchy requests that mostly wait on network and disk |
| Databases (MySQL, PostgreSQL, MongoDB, Redis) | CPU, RAM and fast disk | Index lookups, locks and I/O; these servers execute queries on the CPU |
| Video transcoding | Either | Software encoders (libx264, libx265, libsvtav1) on CPU; fixed-function encoders (NVENC, VAAPI, QSV) on a GPU |
| ML training | GPU | The same matrix multiply over large batches, limited by memory bandwidth |
| ML inference | GPU for large models; CPU for small quantized ones | The model's weights must fit in, and stream from, memory |
| 3D rendering | GPU, CPU still works | Blender's Cycles renders on CUDA, OptiX, HIP, oneAPI or Metal, or on the CPU |
| Compiling, CI, game servers, VPN, mail | CPU | Serial logic, many small processes |
Video sits in the middle. FFmpeg documents both kinds of encoder: the software ones run on CPU cores and expose every tuning option, the hardware ones run on a dedicated block of the GPU and leave the CPU free, which matters when many live streams are encoded at once. Inference also splits: small quantized models answer at readable speed on CPU cores, as the Open WebUI and Ollama guide shows, while large models need the bandwidth that only GPU memory has.
Why most server workloads are CPU-bound
A GPU only helps when a job is one operation over a lot of data and the data stays on the card long enough to amortise the copy. Typical server work is the opposite:
- Requests are small and different. Every HTTP request walks its own path through routing, templates, a database query and a TLS write. There is no batch of identical math to hand off.
- The wait is I/O, not arithmetic. A slow site is usually waiting on disk, the database or the network. More arithmetic throughput does nothing for that.
- The software does not use one. nginx, Apache, PHP-FPM, MySQL, PostgreSQL, Redis and almost every game server run entirely on CPU cores.
So when a VPS is slow, look at CPU, memory and disk first. htop shows whether all cores are busy or one thread is pinned at 100 percent; the htop guide explains how to read it. More vCPUs help the first case, a faster core helps the second, and a GPU helps neither.
How to check what you have on Linux
We ran the first four commands from the top of this page on a KVM virtual machine with Debian 12 (util-linux 2.38.1, pciutils 3.9.0), with the CPU model line left out:
$ nproc
10
$ lscpu | grep -E '^(CPU\(s\)|Thread|Core|Socket|Hypervisor)'
CPU(s): 10
Thread(s) per core: 1
Core(s) per socket: 10
Socket(s): 1
Hypervisor vendor: KVM
$ grep -o -w -E 'avx2|avx512f' /proc/cpuinfo | sort -u
avx2
avx512f
$ lspci -nn | grep -E 'VGA|3D|Display'
00:02.0 VGA compatible controller [0300]: Device [1234:1111] (rev 02)- lscpu reports logical CPUs, threads per core and sockets, and a
Hypervisor vendorline when you are inside a VM. - The flags in
/proc/cpuinfotell you which SIMD extensions software can use. Some prebuilt binaries need them: MongoDB’s production notes, for example, say MongoDB 5.0 and later requires AVX on x86_64. - lspci lists PCI devices.
1234:1111is the PCI ID of QEMU’s standard VGA adapter, per QEMU’s documentation: an emulated card that draws the console and does no compute. A real GPU appears with its vendor’s name, as class[0300]or[0302](3D controller). - nvidia-smi comes with NVIDIA’s driver and shows each GPU, its memory and its load. On this guest it does not exist: no driver, and no GPU to drive.
GPU or CPU: which one should you pick?
Decide by the shape of the work, not by the headline speed:
- Choose CPU capacity when the workload is websites, APIs, databases, game servers, a VPN, CI builds or mail. Pick core count for many parallel requests and per-core speed for single-threaded servers.
- Choose a GPU when most of the time goes into the same math over large arrays (training, inference of models that do not fit a CPU’s memory bandwidth, rendering, dozens of live encodes) and the software supports CUDA, HIP, oneAPI or Vulkan.
- Choose by memory for AI models: what has to fit is the model’s weights, in GPU memory for a GPU and in RAM for a CPU.
- Measure first: if
htopshows idle cores while the app is slow, neither more CPU nor a GPU will fix it; look at disk and network.
GPUs, CPUs and hosting
A typical VPS is a KVM virtual machine with vCPUs, RAM and disk, and a dedicated server is a whole machine for one customer, as what is a dedicated server explains. That covers the CPU-bound list above: web stacks, databases, game servers, CPU video encoding and small quantized AI models. For GPU training or large-model inference, rent a machine whose plan lists a specific GPU model, and keep the web front end and database on CPU servers next to it.
Frequently asked
What is the main difference between a CPU and a GPU?
A CPU spends its transistors on caches and control logic so a few tens of threads run branching code with low latency. A GPU spends them on arithmetic units so thousands of threads run the same operation over large data at once, fed by much faster on-board memory. The CPU runs the operating system and launches work on the GPU.
Do web servers or databases need a GPU?
No. nginx, Apache, PHP, Node.js, MySQL, PostgreSQL and Redis run entirely on CPU cores, and their requests are small, varied and mostly waiting on disk or network. A slow site needs more CPU, RAM or faster storage, not a GPU.
How do I check if my Linux server has a GPU?
Run lspci -nn | grep -E 'VGA|3D|Display'. A real GPU shows its vendor's name; on a KVM virtual machine you typically see only QEMU's emulated VGA adapter with the ID 1234:1111, which does no compute. With an NVIDIA card and its driver installed, nvidia-smi lists the GPU, its memory and its load.
What is the difference between SIMD and SIMT?
SIMD, used in CPU vector instructions such as AVX2 or NEON, applies one instruction to a fixed-width vector of values on one control flow path. SIMT, NVIDIA's GPU model, runs one instruction across a warp of 32 threads, but each thread may branch on its own; diverging threads are run one path after another, which costs throughput.