Unix Fork Performance

Discussions center on the performance issues of fork() and fork/exec in Unix-like systems, particularly copy-on-write overhead for large processes, and alternatives like posix_spawn, vfork, and Windows CreateProcess.

📉 Falling 0.3x DevOps & Infrastructure
2,690
Comments
19
Years Active
5
Top Authors
#8688
Topic ID

Activity Over Time

2008
6
2009
74
2010
48
2011
69
2012
56
2013
55
2014
172
2015
132
2016
156
2017
130
2018
205
2019
217
2020
136
2021
214
2022
382
2023
217
2024
222
2025
191
2026
8

Keywords

COW PHP IMHO GC DBAPI CreateProcess GDB OS github.com UNIX fork exec forking process cow processes child memory gc copy

Sample Comments

andreasvc • Sep 7, 2013 • View on HN

It's mostly about copy-on-write memory due to forks.

LgWoodenBadger • Mar 23, 2023 • View on HN

What else is there besides fork/exec?

evilotto • Mar 22, 2023 • View on HN

Is basic fork/exec from a large process still slow or have newer apis fixed that?

blibble • Jan 29, 2013 • View on HN

it's like a really really really expensive version of fork()!

brooksbp • Dec 7, 2012 • View on HN

Seems like more overhead than fork & execv technique.

justincormack • Jan 18, 2016 • View on HN

Use posix_spawn not fork and exec, then at least the OS may not allocate twice the memory, eg the BSDs will not.

ithkuil • Jul 10, 2021 • View on HN

Wasn't vfork designed to solve this issue? Does it not work in practice?

guenthert • Nov 13, 2020 • View on HN

You wouldn't fork() for performance, but for security reasons.

brcmthrowaway • Aug 14, 2025 • View on HN

What about OSes that dont use fork()?

knightoffaith • Feb 20, 2024 • View on HN

Could you educate me on what's wrong with fork()?