{"id":873,"date":"2026-08-14T22:45:15","date_gmt":"2026-08-14T22:45:15","guid":{"rendered":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?p=873"},"modified":"2026-08-14T22:45:15","modified_gmt":"2026-08-14T22:45:15","slug":"cpu-pinning-numa-game-servers","status":"publish","type":"post","link":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/","title":{"rendered":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Modern game servers rarely use every core you give them \u2014 most run their simulation on one or two threads while the rest of the box idles. On a shared or multi-instance machine, the OS scheduler can bounce those hot threads between cores, dragging cache and latency with them. CPU pinning (affinity) and NUMA awareness fix exactly that: they lock threads to specific cores and keep memory access local, which translates directly into steadier tick rates and lower worst-case ping. It is one of the cheapest performance upgrades available, because it costs nothing but configuration time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When Pinning Actually Helps<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Multiple game instances on one box<\/strong> \u2014 each server gets its own cores, so a busy Minecraft world cannot steal CPU from a Rust server on the same machine.<\/li><li><strong>Latency-sensitive simulations<\/strong> \u2014 single-thread games like Project Zomboid or ARK benefit when the main thread never migrates.<\/li><li><strong>Dedicated boxes with background services<\/strong> \u2014 backups, monitoring agents, and databases get their own cores instead of competing.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Skip pinning on a single-instance server with plenty of idle cores \u2014 the scheduler already keeps the hot thread resident, and you gain nothing but complexity. Pinning is a fix for contention, not a free speed boost.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Checking Your Topology First<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before pinning anything, find out how cores and memory are laid out. On Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lscpu -e          # core\/socket\/NUMA mapping per CPU\nlscpu | grep NUMA # NUMA node layout\ntaskset -pc $$    # current affinity of a shell<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A two-socket EPYC or Xeon box has two NUMA nodes, each with its own memory. Threads that run on node 0 but allocate memory on node 1 pay a cross-node penalty \u2014 small per access, but it adds up at thousands of ticks per minute. Single-socket machines have one node and none of these concerns, which is why many game hosts prefer them despite the lower core ceiling.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pinning with taskset and systemd<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For a quick test, launch the server pinned to cores 0\u20131:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>taskset -c 0,1 .\/server.sh start<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For something that survives reboots, use a systemd unit with CPUAffinity:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[Service]\nExecStart=\/srv\/games\/minecraft\/start.sh\nCPUAffinity=0,1\nMemoryMax=8G<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or pin by PID at runtime with <code>taskset -p -c 0,1 $(pgrep -f java)<\/code>. To pin all threads of a multithreaded server, walk <code>\/proc\/PID\/task\/*<\/code> and set affinity per thread \u2014 a short loop does it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for t in \/proc\/$(pgrep -f server)\/task\/*; do\n  taskset -p -c 0,1 ${t##*\/}\ndone<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that core numbers from <code>lscpu -e<\/code> are physical IDs; on a hyperthreaded CPU, cores 0 and 1 may share a physical core. If you pin two busy instances to sibling threads, you get contention instead of isolation \u2014 check the CPU column of <code>lscpu -e<\/code> and give each instance its own physical core.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">NUMA-Aware Memory Placement<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Pinning CPU without pinning memory gets you half the benefit. Use <code>numactl<\/code> to keep the process&#8217;s memory on the same node as its cores:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>numactl --cpunodebind=0 --membind=0 .\/server.sh start<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a single-socket box there is one node, so this is a no-op \u2014 but on dual-socket hardware, membind prevents the &#8220;local CPU, remote RAM&#8221; pattern that shows up as erratic lag spikes. Check allocation with <code>numastat -p PID<\/code> and <code>\/proc\/PID\/numa_maps<\/code>. If the game allocates a huge world buffer at startup, keep it on the same node as the threads that touch it every tick.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Realistic Expectations<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Scenario<\/th><th>Expected change<\/th><\/tr><\/thead><tbody><tr><td>Two game servers on one box, cores split 4+4<\/td><td>Worst-case tick spikes drop 30\u201350%; average tick time unchanged<\/td><\/tr><tr><td>Single server, idle box<\/td><td>No measurable difference<\/td><\/tr><tr><td>Dual-socket, cross-node traffic eliminated<\/td><td>P99 latency improves; average latency roughly flat<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The pattern to notice: pinning smooths the tail, not the average. Your players will feel it as fewer lag spikes during raids and server-wide events, not as a lower baseline ping. That is exactly the profile a gaming community notices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pitfalls to Avoid<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Pinning to logical (HT) siblings<\/strong> \u2014 two busy threads on one physical core contend for execution units; verify with <code>lscpu -e<\/code>.<\/li><li><strong>Over-pinning<\/strong> \u2014 leaving the OS with no cores for interrupts, SSH, and monitoring causes system-wide stalls. Reserve at least one core for the kernel.<\/li><li><strong>Pinning before measuring<\/strong> \u2014 capture baseline tick times with <code>top -H<\/code> or a tick-rate mod first; otherwise you cannot tell if the change helped.<\/li><li><strong>Ignoring cgroup limits<\/strong> \u2014 if you run containers, set <code>--cpuset-cpus<\/code> at the container level instead of relying on in-container taskset.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Pinning is a tuning step, not a substitute for correct sizing. If the box is under-powered, affinity just makes the shortage more consistent. Pair it with real capacity planning \u2014 and if you would rather have a host that handles the CPU layout for you, <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/\">bare-metal game server hosting<\/a> gives you full BIOS and scheduler control without shared-neighbor noise. Start with the baseline measurement, pin one instance, compare the tail latency, and only then roll the change out to the rest of your fleet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern game servers rarely use every core you give them \u2014 most run their simulation on one or two threads while the rest of the box idles. On a shared&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-873","post","type-post","status-publish","format-standard","hentry","category-server-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CPU Pinning and NUMA for Game Servers: Locking Threads to Cores - Best Dedicated Web Hosting Server Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores\" \/>\n<meta property=\"og:description\" content=\"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/\" \/>\n<meta property=\"og:site_name\" content=\"Best Dedicated Web Hosting Server Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-14T22:45:15+00:00\" \/>\n<meta name=\"author\" content=\"bestdedicatedwebhostingserver\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bestdedicatedwebhostingserver\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"bestdedicatedwebhostingserver\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/\",\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/\",\"name\":\"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores - Best Dedicated Web Hosting Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website\"},\"datePublished\":\"2026-08-14T22:45:15+00:00\",\"author\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1\"},\"breadcrumb\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website\",\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/\",\"name\":\"Best Dedicated Web Hosting Server Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1\",\"name\":\"bestdedicatedwebhostingserver\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g\",\"caption\":\"bestdedicatedwebhostingserver\"},\"sameAs\":[\"https:\/\/bestdedicatedwebhostingserver.com\/blog\",\"https:\/\/x.com\/bestdedicatedwebhostingserver\"],\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/author\/bestdedicatedwebhostingserver\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores - Best Dedicated Web Hosting Server Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/","og_locale":"en_US","og_type":"article","og_title":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores","og_description":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores","og_url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/","og_site_name":"Best Dedicated Web Hosting Server Blog","article_published_time":"2026-08-14T22:45:15+00:00","author":"bestdedicatedwebhostingserver","twitter_card":"summary_large_image","twitter_creator":"@bestdedicatedwebhostingserver","twitter_misc":{"Written by":"bestdedicatedwebhostingserver","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/","url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/","name":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores - Best Dedicated Web Hosting Server Blog","isPartOf":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website"},"datePublished":"2026-08-14T22:45:15+00:00","author":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1"},"breadcrumb":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/cpu-pinning-numa-game-servers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CPU Pinning and NUMA for Game Servers: Locking Threads to Cores"}]},{"@type":"WebSite","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website","url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/","name":"Best Dedicated Web Hosting Server Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1","name":"bestdedicatedwebhostingserver","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g","caption":"bestdedicatedwebhostingserver"},"sameAs":["https:\/\/bestdedicatedwebhostingserver.com\/blog","https:\/\/x.com\/bestdedicatedwebhostingserver"],"url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/author\/bestdedicatedwebhostingserver\/"}]}},"_links":{"self":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/comments?post=873"}],"version-history":[{"count":1,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/873\/revisions"}],"predecessor-version":[{"id":874,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/873\/revisions\/874"}],"wp:attachment":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/media?parent=873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/categories?post=873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/tags?post=873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}